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.

Sebenf0rce

Members
  • Joined

  • Last visited

Everything posted by Sebenf0rce

  1. I tried with EnumActionResult.Success but the result is the same. Because i tried to open gui of the tileEntity that i clicked. In this case is a chest.
  2. Hi, I have a problem when i want to open my gui when i right click with my item. I want to open a gui would show the item in a chest without inventory and without possibility to take items. I have my item class with onItemUse method : @Override public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (!world.isRemote) { TileEntity tile = world.getTileEntity(pos); System.out.println(tile); //renvoie toujours null if (tile == null) { return EnumActionResult.PASS; } if(tile instanceof TileEntityChest) { System.out.println("on lance le gui"); player.openGui(Main.instance, 0, world, pos.getX(), pos.getY(), pos.getZ()); return EnumActionResult.FAIL; } } return EnumActionResult.PASS; } I have my guiHandler class : public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID) { case 0: System.out.println(" création container chest explorer"); return new ContainerChestExplorer(world.getTileEntity(new BlockPos(x, y, z))); } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID) { case 0: System.out.println(" création gui chest explorer"); return new GuiChestExplorer(world.getTileEntity(new BlockPos(x, y, z))); } return null; } } And the class of the gui : public class GuiChestExplorer extends GuiContainer { TileEntity tile; ResourceLocation bg = new ResourceLocation("sebenforcemod:textures/gui/chestexplorer.png"); public GuiChestExplorer(TileEntity te) { super(new ContainerChestExplorer(te)); System.out.println("constructeur gui"); this.xSize = 256; this.ySize = 177; } protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { this.mc.renderEngine.bindTexture(this.bg); System.out.println("draw gui"); drawDefaultBackground(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int x = (this.width - this.xSize) / 2; int y = (this.height - this.ySize) / 2; drawTexturedModalRect(x, y, 0, 0, 256, 256); } } But my gui isn't display. The normal gui of chest is opened.

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.