The Meaning of Life, the Universe, and Everything.
Join Date:
7/2/2014
Posts:
43
Member Details
Hello.
I have some problems with syncing entity (not TileEntity).
And it's a long story...
I have block ("multi-anvil") with TileEntity and NBT-based ItemBlock. This anvil has different textures, depends on data stored in TIleEntity (or NBT, if there is ItemBlock). To solve that task I use ISBRH and IItemRenderer.
And (as vanilla anvil) this block must fall. For that purpose I create custom custom falling entity (because EntityFallingBlock doesn't use right txture and drops wrong ItemStack - ItemStack without NBT). I created custom Entity and fix bug with wrong drops.
And I created EntityRender (extends Render). And there I have sync problem:
- I copy data to my entity from TIleEntity using custom constructor.
- I create and spawn my entity on server-side (as shown in BlockFalling).
- But render occurs on client-side (and there entity initializes using default constructor => entity doesn't store any data).
How to sync that data between server and client? (Because, as I said before, block texture depends on data stored in TileEntity => entity texture should be the same and should depend on data stored in it).
The Meaning of Life, the Universe, and Everything.
Join Date:
7/2/2014
Posts:
43
Member Details
1) And how to do that with custom packet handler?
2) Without explicit packet handling for entity (with vanilla packet handling) all works fine, except one thing: I create entity on server side with custom constructor (that allows store custom data in entity). On client side entity initializes automatically (implicit) with default constructor (custom data doesn't stored in it). How to copy that data from server to client (without PacketHandling or with custom packet handler based on MessageToMessageCodec<FMLProxyPacket, MyPacket>)?
Hello.
I have some problems with syncing entity (not TileEntity).
And it's a long story...
I have block ("multi-anvil") with TileEntity and NBT-based ItemBlock. This anvil has different textures, depends on data stored in TIleEntity (or NBT, if there is ItemBlock). To solve that task I use ISBRH and IItemRenderer.
And (as vanilla anvil) this block must fall. For that purpose I create custom custom falling entity (because EntityFallingBlock doesn't use right txture and drops wrong ItemStack - ItemStack without NBT). I created custom Entity and fix bug with wrong drops.
And I created EntityRender (extends Render). And there I have sync problem:
- I copy data to my entity from TIleEntity using custom constructor.
- I create and spawn my entity on server-side (as shown in BlockFalling).
- But render occurs on client-side (and there entity initializes using default constructor => entity doesn't store any data).
How to sync that data between server and client? (Because, as I said before, block texture depends on data stored in TileEntity => entity texture should be the same and should depend on data stored in it).
P. S. Sorry for my English. I'm from Russia.
Put it simply, I have entity with some data. That data initializes and works only on server side.
But I need this data to render my entity. How to sync that data with client-side entity?
Packet handling!
http://jabelarminecraft.blogspot.co.nz/p/minecraft-forge.html
Please don't PM me asking for help, I will just redirect you to the appropriate forum, where there are others who are far more skilled than me.
This is not the signature you are looking for.
Banners and such things
1) And how to do that with custom packet handler?
2) Without explicit packet handling for entity (with vanilla packet handling) all works fine, except one thing: I create entity on server side with custom constructor (that allows store custom data in entity). On client side entity initializes automatically (implicit) with default constructor (custom data doesn't stored in it). How to copy that data from server to client (without PacketHandling or with custom packet handler based on MessageToMessageCodec<FMLProxyPacket, MyPacket>)?
Please, anyone, help me solve my problem in that situation...