Posted September 28, 20168 yr I made a pedestal, you right click items on and off of it, or shift right click to open the gui. most of it works fine except when you right click an item off the pedestal it still renders there until you log out or open the gui. I am at a loss as to what to do. Pedestal Block Code Pedestal TE Code Pedestal TESR
September 28, 20168 yr I made a pedestal, you right click items on and off of it, or shift right click to open the gui. most of it works fine except when you right click an item off the pedestal it still renders there until you log out or open the gui. I am at a loss as to what to do. Pedestal Block Code Pedestal TE Code Pedestal TESR You need to sync the inventory using markDirty() meaning call markDirty() after removing/adding the item. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 28, 20168 yr Author public void setStack(ItemStack stack) { this.stack = stack; this.markDirty(); if (worldObj != null) { IBlockState state = worldObj.getBlockState(getPos()); worldObj.notifyBlockUpdate(getPos(), state, state, 3); } } Is it suppose to be somewhere else? because it doesn't work.
September 28, 20168 yr public void setStack(ItemStack stack) { this.stack = stack; this.markDirty(); if (worldObj != null) { IBlockState state = worldObj.getBlockState(getPos()); worldObj.notifyBlockUpdate(getPos(), state, state, 3); } } Is it suppose to be somewhere else? because it doesn't work. Did you override getUpdatePacket(...) and handleUpdatePacket(...) or something like that. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 28, 20168 yr Author Is this what you mean? @Override public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound nbtTag = new NBTTagCompound(); this.writeToNBT(nbtTag); return new SPacketUpdateTileEntity(getPos(), 1, nbtTag); } @Override public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) { this.readFromNBT(packet.getNbtCompound()); }
September 28, 20168 yr Hi I don't see an obvious problem; have you tried placing breakpoints in your getUpdatePacket() to see if it's being called properly You could try comparing your code to this example project https://github.com/TheGreyGhost/MinecraftByExample MBE30 and MBE31 are two working examples which sound similar to what you're doing. -TGG
September 29, 20168 yr I've been trying to figure this out for a while, the proper way of calling a TileEntity sync. I knew how to do it back in 1.8 by calling markBlockForUpdate(BlockPos) and markDirty() which would immediately trigger a call to getDescriptionPacket(). After removal of the first function I don't know how to do it any more as calling markDirty() alone doesn't seem to do anything or am I missing something... Does anyone know how we're suppose to do it in 1.10? I still haven't published a mod because I can never get that in-dev version just right to warrant a public release. And yes, after two years of mod development I am still learning to speak Java. Follow me on GitHub: https://github.com/yooksi Contact me on Twitter: https://twitter.com/yooksi Read my Minecraft blog: https://yooksidoesminecraft.blogspot.de/
September 29, 20168 yr I've been trying to figure this out for a while, the proper way of calling a TileEntity sync. I knew how to do it back in 1.8 by calling markBlockForUpdate(BlockPos) and markDirty() which would immediately trigger a call to getDescriptionPacket(). After removal of the first function I don't know how to do it any more as calling markDirty() alone doesn't seem to do anything or am I missing something... Does anyone know how we're suppose to do it in 1.10? Call World#notifyBlockUpdate on the server to send the TileEntity 's update packet and re-render the chunk containing it. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
September 29, 20168 yr Call World#notifyBlockUpdate on the server to send the TileEntity 's update packet and re-render the chunk containing it. Do I actually need to provide two different BlockStates? I would like to call an instant entity sync without actually changing the BlockState. And what about the flags, any idea what I should enter there? I still haven't published a mod because I can never get that in-dev version just right to warrant a public release. And yes, after two years of mod development I am still learning to speak Java. Follow me on GitHub: https://github.com/yooksi Contact me on Twitter: https://twitter.com/yooksi Read my Minecraft blog: https://yooksidoesminecraft.blogspot.de/
September 29, 20168 yr Do I actually need to provide two different BlockStates? I would like to call an instant entity sync without actually changing the BlockState. No, the two IBlockState arguments can be (and usually are) the same. And what about the flags, any idea what I should enter there? The flags are completely ignored by ServerWorldEventHandler (the server-side IWorldEventListener instance). Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
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.