Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Ives

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Ives

  1. Very nice find! Did you solve it without downgrading to IntelliJ 13 or is downgrading necessary to fix this problem?
  2. Woops, just saw it too! Sorry! I hope it works now.
  3. Ah I see, this tutorial gives some insight in NBT http://www.minecraftforge.net/wiki/Tile_Entities Your whole code should be like this: public void writeToNBT(NBTTagCompound tag) { super.writeToNBT(tag); NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < this.inv.length; ++i) { if (this.inv[i] != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("slot", (byte)i); this.inv[i].writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); } } } public void readFromNBT(NBTTagCompound p_145839_1_) { super.readFromNBT(p_145839_1_); NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10); this.inv = new ItemStack[this.getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); int j = nbttagcompound1.getByte("slot") & 255; if (j >= 0 && j < this.inv.length) { this.inv[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } } } If that code doesn't work the problem lies elsewhere. Did you register the TileEntity in the GameRegistry?
  4. I looked at the code from the chest and that code did have brackets.
  5. I think you forgot to add brackets after inv sometimes. For example you have this: for (int i = 0; i < this.inv.length; ++i) { if (this.inv != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("slot", (byte)i); this.inv.writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); } } It should be this: for (int i = 0; i < this.inv.length; ++i) { if (this.inv[i] != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("slot", (byte)i); this.inv[i].writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); } } Do the same for readNBT and it should work
  6. I think I'm using the Simple Network Implementation the wrong way. I want to change a boolean of a TileEntity when I click a button in the GUI. I now have this but I don't think I'm supposed to do it like this.
  7. Hey! I'm trying to add javadocs to Forge but haven't succeeded yet. Is there a way to add javadocs to Forge?
  8. I would use @SideOnly(Side.CLIENT) private Icon[] azulnow = new Icon[4]; @Override public void registerIcons(IconRegister iconRegister){ this.itemIcon = iconRegister.registerIcon((this.getUnlocalizedName().substring(5)) + "_0"); for (int N = 0; N < 4; N++){ this.azulbow[N] = iconRegister.registerIcon((this.getUnlocalizedName().substring(5)) + "_" + N); } }{ The Override is important, otherwise the texturer asks for the wrong textures.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.