Jump to content

Recommended Posts

Posted

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?

Posted

.... 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.

Posted

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..

Posted

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

Posted

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 :P

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.