Posted June 8, 201510 yr Hello, I'm trying to make a furnace style block with a progress bar and only thing I'm missing is updating the progress bar in the GUI. And for that I need to access a variable stored in the blocks TileEntity but the problem is that since I can't pass my blocks tilyEntity through the parameters from the getClientGuiElement when I use world.getTileEntity to pass over the tileEntity to the GUI, the world that I use right there (the one that comes in the getClientGuiElement parameters) is the client sided version of the world and when called getTileEntity it doesn't return the actual tileEntity but some other possible fake client side instance of the block which doesn't have the same variable values as the actual server side tileEntity. So basically I need to access the tileEntity from the server side from the GUI or somehow send over the value of an int into the clients GUI. How can I do this? Am I doing something wrong here?
June 8, 201510 yr .... You should sync your client TileEntity with server version.. The aim of the existence of client side tileentity is tileentity-specific rendering and Gui/Container. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
June 8, 201510 yr Author Thank you, after some research I found out that same thing, that tile entities aren't automatically synced but wasn't quite sure if this was the case. Guess I'll have to write a packet handler..
June 8, 201510 yr Hi This tutorial project has a working example of that https://github.com/TheGreyGhost/MinecraftByExample (see MBE31) https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe31_inventory_furnace/Notes.txt icrafting.sendProgressBarUpdate() and icrafting.updateProgressBar() is probably what you need. also this background info http://greyminecraftcoder.blogspot.com.au/2015/01/gui-containers.html -TGG
June 8, 201510 yr Author Hi This tutorial project has a working example of that https://github.com/TheGreyGhost/MinecraftByExample (see MBE31) https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe31_inventory_furnace/Notes.txt icrafting.sendProgressBarUpdate() and icrafting.updateProgressBar() is probably what you need. also this background info http://greyminecraftcoder.blogspot.com.au/2015/01/gui-containers.html -TGG Thank you! I had seen your tutorials before but never actually used them, now with the help of it I got this done
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.