Jump to content

How to make a new instance of a gui for every player?


Mecblader

Recommended Posts

I'm not sure if I worded the title correctly, but I need a way to have my gui have a separates instance for each player. For example, the crafting table, when a player put in items ore blocks, another player  can not see what is happening. I need that sort of thing for my custom furnace. If you know how I could do this, would this be difficult to accomplish. All help is appreciated. Thank you in advance.

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

Link to comment
Share on other sites

If you are using a TileEntity (i doubt you don't), then you can't make a new instance of every gui for every player. If you look at the Workbench code, you can see that the Workbench doesn't use a TileEntity, and that's why it spits it's items on the ground when closing the gui.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

Sorry, but could you explain further. What method could I get the player that is currently using the tile entity and how would IExtendedEntityProperties allow me to store the items in the furnace, is it just another set of nbt data that still exists after the player exits the Tile Entity?

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

Link to comment
Share on other sites

Easiest way would be to use IExtendedEntityProperties. That is only needed if you want the items to persist in the block. If you want it to act like the workbench, you dont need to do that.

Not sure if this is quite the right solution, as it would only introduce one furnace inventory per player -- it would become a sort of "ender furnace".

I like to make mods, just like you. Here's one worth checking out

Link to comment
Share on other sites

Then what solution do you suggest. I don't think that an ender furnace will be bad for my use, unless there is something code-wise that is bad about it. If there nothing bad with an ender furnace, then how would I accomplish this because I can not find a good way to get the player that is currently using the furnace, the way that I have found keeps copying the original players furnace inventory to its own inventory after it rapidly switches between the two inventories for a few seconds.

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

Link to comment
Share on other sites

Is there a method that update every tick because I need this to update every tick, to make the furnace tick.

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

Link to comment
Share on other sites

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.