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.

Blue0500

Members
  • Joined

  • Last visited

  1. Ok I did what you said and basically copied the vanilla gui and container classes and made my own. While doing this, I saw this method: public boolean canInteractWith(EntityPlayer arg0) I set it to always return true and it worked! Then I realized it could be so much simpler: All I had to do was create a custom class that extends ContainerWorkbench and override this method. So now the gui works with the vanilla GuiCrafting class and my custom container. Thanks!
  2. I'm new at gui's so bear with me on this one. I'm trying to make the crafting gui open whenever the player right clicks on my entity. The entity and renderer are working fine, but it's the gui I'm having trouble with. I tried doing this: FMLClientHandler.instance().displayGuiScreen(player, new GuiCrafting(player.inventory, player.worldObj, new BlockPos((int)player.posX, (int)player.posY, (int)player.posZ))); and the gui opens, but whenever I pick up an ItemStack it puts it back down, picks up the ItemStack to the left, and then shuffles the entire inventory. I knew that couldn't be right, so I tried this, which is the vanilla crafting table code: player.displayGui(new BlockWorkbench.InterfaceCraftingTable(player.worldObj, new BlockPos((int)player.posX, (int)player.posY, (int)player.posZ))); but then the gui just flickered open for a second, and then closed. Then, I tried to make my own gui handler, which looks like this: // Imports public class CraftingGuiHandler implements IGuiHandler { @Override public Object getClientGuiElement(int arg0, EntityPlayer player, World world, int x, int y, int z) { return new GuiCrafting(player.inventory, world); } @Override public Object getServerGuiElement(int arg0, EntityPlayer player, World world, int x, int y, int z) { return new ContainerWorkbench(player.inventory, world, new BlockPos(x, y, z)); } } I tryed opening it with this: player.openGui(MyMod.Instance, 0, player.worldObj, (int)player.posX, (int)player.posY, (int)player.posZ); but it just flickered again! Any help would be appreciated, because I'm out of ideas. Thanks!

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.