Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

So I have a GUI, a Container, a TileEntity, a Block, and everything works well until I attempt to place items into the GUI.

 

To clarify, when I click to interact with the block, the GUI opens, and all the slots appear in the appropriate locations. However, when I go to move an item from within my inventory, just after it is clicked it returns to the slot from which it came. Shift clicking makes the item appear in both the GUI slot and the first slot of my hotbar. It then proceeds to return to the slot from which it came. Additionally, if the GUI is opened with an item in the first hotbar slot it appears in the GUI slot. Removing it from either slot removes it from the other as well, but it returns to both upon returning to the original slot.

 

The GUI that the problem occurs with is the one for the Combustion Generator. Relevant files contain GeneratorCombustion in the file name.

 

It may be three separate issues but I suspect that they are caused by the same problem in the code or very similar problems. All the files can be found in the GitHub repository I linked at the bottom of the post. Thanks in advance for any help you may be able to give.

 

If you need a built copy of the mod in order to better understand the issue, or any other files, just ask for them. I will be glad to provide them.

 

Note that the code is very similar to the Vanilla furnace code as the block I am creating functions almost exactly the same as the fuel slot in the  furnace.

 

GitHub Repository: https://github.com/cjs07/ChemistryCraft/tree/master

  • Author

Do I have to call FMLNetworkHandker.openGui(...) in the same if block as player.openGui(...)? Because I thought the onBlockActivated method got called once by the client and once by the server, and you call player.openGui when it's called by the client, and FMLNetworkHandler.openGui when it's called by the server. Is that incorrect?

  • Author

So, since they are exactly the same, does it matter which one should I use? And should it be called by the client or server version of onBlockActivated?

  • Author

Ok so that fixed the problem with the inventory items jumping from slot to slot. Now there's just the problem of the slot in the gui becoming the same as the first slot in the hotbar and vice-versa, but it does not result in duplication. Any ideas on how to fix that?

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.