Posted June 30, 201312 yr So I want to use tile entity data to control what texture the related block uses, a bit like how IndustrialCraft fits so many types of blocks into a single ID, but the problem is that the client stubbornly refuses to store any tile entity data. How can I make the server send tile entity data? I've tried using tile entity description packets but I can't seem to make the client process them. EDIT: So I've figured out how to sync server and client data, but on world load/unload the client's tile entity resets. Is there any way to automatically send a tile entity description packet when the tile entity's chunk is loaded?
June 30, 201312 yr So I want to use tile entity data to control what texture the related block uses, a bit like how IndustrialCraft fits so many types of blocks into a single ID, but the problem is that the client stubbornly refuses to store any tile entity data. How can I make the server send tile entity data? I've tried using tile entity description packets but I can't seem to make the client process them. If it renders as a normal block, you can't use TE data. BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
July 1, 201312 yr Author If it renders as a normal block, you can't use TE data. Isn't there a method (getBlockTexture) that takes IBlockAccess as a parameter and returns an icon to display? I was under the impression that the method could be used to grab a block's TE and use data from that to choose a texture to display on a certain side.
July 1, 201312 yr Server and Client Tile Entities are synchronized via the Container class. check out detectAndSaveChanges(), updateProgressBar(), addCraftingToCrafters() methods in the ContainerFurnace class and make you Tile Entity update itself the same way. Otherwise your client and server Tile entities will desync after you log out from the world or unload the chunk it is in. http://www.minecraftforum.net/topic/1871576-152-161forgealchemy-enhance-your-brewing-expirience-now-with-downloads/ Check it out!
July 1, 201312 yr Isn't there a method (getBlockTexture) that takes IBlockAccess as a parameter and returns an icon to display? I was under the impression that the method could be used to grab a block's TE and use data from that to choose a texture to display on a certain side. That is indeed true. Just make sure you sync your TE fields with Packets, the client version is usually dumb and holds no data. >.> Thanks for solving my problem. I thought that method had been removed as of 1.5.2. BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
July 1, 201312 yr Author Server and Client Tile Entities are synchronized via the Container class. check out detectAndSaveChanges(), updateProgressBar(), addCraftingToCrafters() methods in the ContainerFurnace class and make you Tile Entity update itself the same way. Otherwise your client and server Tile entities will desync after you log out from the world or unload the chunk it is in. Aren't containers designed to be used with GUIs? I'm trying to use TE data to control what textures a block should be rendered with, similar to how signs use TE data to control what text to display. I've tried using getTileEntityDescriptionPacket(), but I can't make the game process built-in (or custom!) TE description packets. I'm working on using Forge's packet handling structure, but although I've managed to send xyz coordinates from server to client I have no idea how to send which world the coordinates originate from. (Strangely, neither Packet132TileEntityData nor Packet130UpdateSign seem to have a "world" field, yet both obviously allow minecraft to identify where the described TE is located. . . must look into that.)
July 2, 201312 yr Author You are right about the getDescriptionPacket. What you need to "receive" it on the client side is the onDataPacket method in the tile entity. It will be called when the packet from getDescriptionPacket arrives on the client. Thanks for that, onDataPacket did the trick. (I can't help but wonder why most vanilla TE classes don't override it. . . ah well, the packet must be handled elsewhere in the code)
July 4, 201312 yr Author So. . . new problem: I've figured out how to sync server and client data, but on world load/unload the client's tile entity resets. Is there any way to automatically send a tile entity description packet when the tile entity's chunk is loaded?
July 4, 201312 yr It is automatically send on a chunk load (and also on a chunk "refresh"). Are you sure your TE is doing its work on a server side? mnn.getNativeLang() != English If I helped you please click on the "thank you" button.
July 4, 201312 yr are you sure you're implementing writeEntitytoNBT and readEntityToNBT (or wtv the f they're called) in your tile entity ? can we have the code of your tile entity ? how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 4, 201312 yr Author So I was double-checking my read/writeFromNBT methods and in the process noticed that the onDataPacket method didn't actually change the tile entity's data. . . thanks for the suggestions, though. Problem's fixed, for now. God only knows how onDataPacket could somehow not change the tile entity's data while sneakily appearing to. (Although LexManos would probably know better. . .)
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.