Jump to content

chbachman

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by chbachman

  1. 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.
  2. I am making upgrades for armour, these upgrades sometimes need to react when armour is taken off or put on.
  3. I have checked that. Is there any way besides saving whether they have armour, and updating it?
  4. Is there a hook somewhere that i am missing, or a way to implement it myself, because i was wondering how to tell when a piece of armour has been taken off or put on.
  5. 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.
  6. 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.
  7. 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.
  8. 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
  9. 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.
  10. I found the code i needed. It was in the slot class, thank you for the pointer.
  11. Sorry to bother people, but i have gone through the vanilla code and cannot find the tile entity file for the vanilla workbench. I am interested to learn how to accurately remove the crafting ingredients after taking the result out. Thank you for your help.
×
×
  • Create New...

Important Information

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