chbachman
Members-
Posts
11 -
Joined
-
Last visited
Everything posted by chbachman
-
[1.7.10] How to tell when Armour has been taken off and put on.
chbachman replied to chbachman's topic in Modder Support
Yeah, i thought about that, not sure the best way to do this, mabye onArmourTick on first call calls the put on method, not sure how to do take off, thinking living entity update, checking every tick to see if they do not have the armour on any more. however not sure how to call it on that armour piece. -
[1.7.10] How to tell when Armour has been taken off and put on.
chbachman replied to chbachman's topic in Modder Support
I am making upgrades for armour, these upgrades sometimes need to react when armour is taken off or put on. -
[1.7.10] How to tell when Armour has been taken off and put on.
chbachman replied to chbachman's topic in Modder Support
I have checked that. Is there any way besides saving whether they have armour, and updating it? -
Hello, I have been having problems trying to add slots to a Inventory/Container/Gui for a Tile Entity. Sort of like how the Tool Station from Tinker's Construct Works. However, i have had trouble, because i cannot figure out how i would add one or two slots to the inventory screen dynamically, with me being able to just register where i want them and having my code add them. I get this would require a lot of code, especially with the gui, but i keep on having different exceptions thrown whenever i try to register that there could be more slots than are hard-coded into me TileEntity.
-
[1.7.2] NBTTagCompound.getTagList() not working
chbachman replied to chbachman's topic in Modder Support
thank you, i thought that the constant was for getting the nbttag, and not for the type of it. sorry i didn't realize that. -
This is the code: NBTTagCompound stackTagCompound = new NBTTagCompound(); NBTTagList list = (NBTTagList) stackTagCompound.getTag("String"); // Works NBTTagList list = stackTagCompoung.getTagList("String", Constants.NBT.TAG_LIST); // Does not work. And yes, i know i didn't give the stackTagCompound anything to pull from, but this is just example code. i have already figured out the workaround, but i wanted to let the community know, and ask if i am doing anything wrong. Sorry if i am, but it was really annoying to deal with that.
-
ok i fixed up the method, but the nbt is still not saving. I am sorry for asking, but i have been trying to figure this out for a week. Here is the total source code: https://github.com/chbachman/ModularStorage with the relevant code here (i think): https://github.com/chbachman/ModularStorage/blob/master/common/io/github/chbachman/fluid/Tank.java and here: https://github.com/chbachman/ModularStorage/blob/master/common/io/github/chbachman/blocks/modulartank/TileModularTank.java Thank you for your help
-
I have read so many of the posts where people just stick the two lines of code that they think are causing the problem, and tell others to fix it. I am sorry if this comes off as one of those posts, but i am using code borrowed from build craft for saving the nbt of my tank and it is not working, and i cannot figure out why, because it traces back to code from KingLemming. This is my nbt saving code: the class extends the FluidTank class @Override public final NBTTagCompound writeToNBT(NBTTagCompound nbt) { NBTTagCompound tankData = new NBTTagCompound(); super.writeToNBT(tankData); this.writeTankToNBT(tankData); nbt.setCompoundTag(this.name, tankData); return nbt; } @Override public final FluidTank readFromNBT(NBTTagCompound nbt) { if (nbt.hasKey(this.name)) { NBTTagCompound tankData = nbt.getCompoundTag(this.name); super.readFromNBT(tankData); this.readTankFromNBT(tankData); } return this; } public void writeTankToNBT(NBTTagCompound nbt) { } public void readTankFromNBT(NBTTagCompound nbt) { } Thank you for your time.
-
Where is the tile entity class for a vanilla crafting table?
chbachman replied to chbachman's topic in Modder Support
I found the code i needed. It was in the slot class, thank you for the pointer.