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.

somarani

Members
  • Joined

  • Last visited

Everything posted by somarani

  1. Hi here are the classes you asked for, sorry for posting incorrectly, I'm new here Container Class - http://pastebin.com/Jjr6GbVW GUI Handler Class - http://pastebin.com/x0s9Mgsk Block GUI Class - http://pastebin.com/cVDvmuDJ Tile Entity Class - http://pastebin.com/Zq6WQcVd Also please keep in mind that all the smelting recipes, etc are still incomplete as I'm first trying to get the GUI working. If its of any help, when I change it to "if(!par1World.isRemote)" the GUI does open correctly and shows me the player inventory but doesn't allow me to move any of the items in the inventory. Also what I'm attempting to do with this block is have the user place a gold ingot on top, a custom item on the bottom and it results a new item. If anyone could help with that it would be greatly appreciated. Thanks for the help
  2. here is my GUI handler class package somarani.soulcraft.gui; import somarani.soulcraft.common.SoulCraft; import somarani.soulcraft.tileentity.TileEntityInfuser; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; public class GuiHandler implements IGuiHandler { public GuiHandler(){ NetworkRegistry.instance().registerGuiHandler(SoulCraft.instance, this); } public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity entity = world.getBlockTileEntity(x, y, z); if (entity != null) { switch (ID){ case SoulCraft.guiIdInfuser: if (entity instanceof TileEntityInfuser){ return new ContainerInfuser(player.inventory, (TileEntityInfuser) entity); } } } return null; } public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity entity = world.getBlockTileEntity(x, y, z); if (entity != null) { switch (ID){ case SoulCraft.guiIdInfuser: if (entity instanceof TileEntityInfuser){ return new GuiInfuser(player.inventory, (TileEntityInfuser) entity); } } } return null; } }
  3. I have a problem with trying to open a custom GUI. Here is my code public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if (par1World.isRemote) { return true; } else { TileEntityInfuser tileEntityInfuser = (TileEntityInfuser)par1World.getBlockTileEntity(par2, par3, par4); if (tileEntityInfuser != null) { par5EntityPlayer.openGui(SoulCraft.instance, SoulCraft.guiIdInfuser, par1World, par2, par3, par4); } return true; } } That wont work. The only way I can get it to work is to change the par1world.isRemote to "if(!par1World.isRemote)" This makes the gui open but breaks some other things. Any help would be greatly appreciated!

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.