Jump to content

elschemm

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by elschemm

  1. Whilst this is mostly answered above, I thought I'd drop this in: The reason that they are all accessing the same tile entity is that there is actually only one instance of a particular block ever in Minecraft. The constructor for your MyBlock is only ever called once, most likely in the Init function of your mod. The individual instances of blocks don't actually exist (there is no spoon). The world is just a big array of blockIDs. When you try to interact with a block, Minecraft looks that blockID up and calls appropriate functions on the block. TileEntities are a special case. They need to exist uniquely for each instance of them in the world. Which is why you must create a tile entity each time that a block is placed in the world (bit of a hint there). Finally, both the client world and the server world contain copies of this tileEntity. Most of the 'real work' should be done serverside (never trust a client), so now you have the issue of syncing the two. As for how to proceed, Mazetar is correct. Your best bet is to have a look at some of the Furnace/CraftingTable/MiniChest tutorials out there. Some of them are for 1.2.5/1.3.2, and some are for ModLoader, but a comparison of them to the Furnace actually in Vanilla is profitable.
  2. I think this may be because the values after quit/load are not being propagated from the server side to the client. I had a similar problem until I added: public Packet getDescriptionPacket() { NBTTagCompound tag = new NBTTagCompound(); this.writeToNBT(tag); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, tag); } and @Override public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) { This function looks similar to a readFromNBT function, Google some examples } The first function is serverside, and the second is clientside. In my updateEntity, I also have a call (when necessary) to: PacketDispatcher.sendPacketToAllPlayers(getDescriptionPacket()); it keeps things in sync between the server and client. I didn't see an updateEntity in your code, so I don't know if that would be relevant to you.
×
×
  • Create New...

Important Information

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