Jump to content

Recommended Posts

Posted

Hey Guys!

I created a TileEntity which should work nearly the same as a furnace with the difference that it uses no fuel.

 

I have a problem with this furnace: If I place a stack in the slot to take the ingredients from, it starts taking them, but if I leave the Gui and reopen it, the process is back at zero. Why?

 

Code:

 

  Reveal hidden contents

 

 

Actually, the block should smelt every tick because of the onUpdate method. Actually it resets everytime I open the gui.

Posted

I think it is related with syncing container... you have to send the progress data to client.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

I copied some code and now I think I found the problem..

I have a button in the Gui which controls the furnace. (Sorry, I havent posted this part of code)

The Furnace only works if this button is pressed (It's a toggle-button)

I thought, this would work, thats why I didn't post it. But: The value of the button is not synchronized with the server.

Do I need a packet to do this or is there another way?

Posted
  On 5/28/2014 at 1:05 PM, diesieben07 said:

There is an easy way to transfer button-clicks when viewing a GuiContainer.

When you want a send a button-click, call

Minecraft#playerController.sendEnchantPacket(windowId, buttonId)

. The windowId you get from your Container, the buttonId can be a byte (-128 through 127).

That will then trigger a call to

enchantItem

on your Container (on the server!) with the same buttonId.

The naming is a bit stupid (classic MCP...), I bet in the original Mojang code this is called clickButton or something like that.

 

Thanks a lot! It works now..

 

The deobfuscated names are a little bit weird sometimes, you're right....

I think, ICrafting would better be called ICraftingUser or something, because thats what it is used for....

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.