Jump to content

Power API 1.10.2


NoVaGaming

Recommended Posts

	if (container.setTagCompound()  == null) {
		container.getTagCompound())  = new NBTTagCompound();
	}

Dude im so sorry if im wasting your time. I think i might just try figuring this stuff out by myself after this questions but is this right  :P If not i think i might go slit my wrist and put it in bleach and then call myself an idiot 60000 times

It is not right but do not go and do that stuff, instead look at setTagCompound() in the ItemStack class and maybe look up what getter and setter methods are in programming.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

    /**
     * Assigns a NBTTagCompound to the ItemStack, minecraft validates that only non-stackable items can have it.
     */
    public void setTagCompound(NBTTagCompound nbt)
    {
        this.stackTagCompound = nbt;
    }

Thats what i found and i see the string and value but do not understand how to use them in the set mothod.

Are You Feeling it now Mr.Krabs?

 

GitHub

https://github.com/nuclearelectricity/Nuclear-Electricity

Link to comment
Share on other sites

    /**
     * Assigns a NBTTagCompound to the ItemStack, minecraft validates that only non-stackable items can have it.
     */
    public void setTagCompound(NBTTagCompound nbt)
    {
        this.stackTagCompound = nbt;
    }

Thats what i found and i see the string and value but do not understand how to use them in the set mothod.

This is the important part.

(NBTTagCompound nbt)

If you do not know what that means you are not yet ready to mod anything.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

So with the set method ive tried both of those and it wont work

Watch this video and  preferably the entire playlist.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Ok so what i got from that i i need to put the arument into my method but when i put this is does not want to work

	if (container.setTagCompound(nbt)  == null) {
		container.getTagCompound()  = new NBTTagCompound();
	}

The first one is two == not one. When I said stackTagCompound = someTagCompound there was only one.

Everything else is getTagCompound()

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

That is mostly correct except for the = and the second one. It doesnt work. You should look up what getters and setters are in programming, they are a big part.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

setTagCompound(...) automatically sets the variable to what is passed into the method. No = is required setTagCompound(...) is a void method. Meaning nothing is returned, seriously look up what getters and setters are.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

if (container.getTagCompound() == null) {
		container.setTagCompound(nbt) new NBTTagCompound();
	}

All i am going to say is look up getters and setters it will tell you what is wrong there.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

		if (container.getTagCompound() == null) {
		container.setTegCompound(nbt) new NBTTagCompound();
	}

Ive watched 3 tutorials and could not figure it out

What tutorial?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

I'll explain it here. Getter methods are usually used to grab a variable nornally a protected or private one. You can not edit the variable using an =, but you can grab any data within the variable. Setters are a loop on to set a variable = to whatever you pass into the method. These normally are void methods and are used for protected or private variables as well. This is done to ensure you do not have full access to a field from outside where it has been declared.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Let me point it out what is nbt? Why do you have new NBTTagCompoumd () after your setTagCompound?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

nbt is the name of the variable inside of the method normally. new NBTTagCompound () is a new variable of the type NBTTagCompound which is what you want to pass in to the method.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Please Just get me through this little thing that im doing rn and then i will go watch the entire siries you gave me

nbt is the name of the variable inside of the method normally. new NBTTagCompound () is a new variable of the type NBTTagCompound which is what you want to pass in to the method.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.