Posted June 4, 20196 yr My block is supposed to save the block placer as the owner when it is placed which it does correctly on both client and server side but when checking it afterwords anywhere else it only shows up server-side. Anyone know why? https://github.com/BeardlessBrady/Currency-Mod/blob/master-2-1.12/src/main/java/beardlessbrady/modcurrency/block/vending/BlockVending.java#L61 Edited June 4, 20196 yr by BeardlessBrady
June 5, 20196 yr Author I was playing around with things since it wasn't saving correctly, saving it as a string was one of those things. I have tried adding tile.markDirty() after setting owner but it doesn't seem to have changed anything, what exactly do I need to do to re-send the packet? https://github.com/BeardlessBrady/Currency-Mod/blob/64b43d05b8e67f0b6ae469889cd5823ae05ff23d/src/main/java/beardlessbrady/modcurrency/block/vending/BlockVending.java#L62
June 5, 20196 yr Author Background: I have a base tile entity I extend the tile entity off of which is where the owner is created and saved via NBT stuff. Peculiarly if I move the NBT stuff for the owner to the main tile not the one its extended everything works fine despite the nbt methods running super first? EDIT: I figured it out. So when @Overriding #getUpdatePacket() I was just doing: super.getUpdatePacket(); NBTTagCompound compound = new NBTTageCompound; but I didn't realize that wasn't using the super's method correctly so I changed it to: NBTTagCompound compound = super.getUpdatePacket().getNbtCompound(); Thanks for trying to help! Edited June 5, 20196 yr by BeardlessBrady
June 5, 20196 yr Author Its very weird, owner works until I close and reopen the world. Obviously this is an issue with the NBT writing and reading but I do not understand why it isn't working correctly. https://github.com/BeardlessBrady/Currency-Mod/blob/627fabebd0635a71b1bf8103a2b291c4558d67b3/src/main/java/beardlessbrady/modcurrency/block/vending/TileVending.java https://github.com/BeardlessBrady/Currency-Mod/blob/627fabebd0635a71b1bf8103a2b291c4558d67b3/src/main/java/beardlessbrady/modcurrency/block/TileEconomyBase.java
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.