Posted January 14, 20169 yr Hello, I'm having a strange problem I'm trying to open a gui when I rightclick a block, the problem is that nothing happens. I did some research and found that forge sees my GuiHandler class but doesn't register the getServerGuiElement & getClientGuiElement methods. Did I do something wrong? GuiHandler: public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID == 10) return new GuiMachineBlock(); return null; } } Init: @Mod.EventHandler public void init(FMLInitializationEvent event){ proxy.init(); NetworkRegistry.INSTANCE.registerGuiHandler(MatthProject.instance, new GuiHandler()); } Debug:
January 14, 20169 yr Author I do call openGui: @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { if(!world.isRemote) { player.openGui(MatthProject.instance, 10, world, pos.getX(), pos.getY(), pos.getZ()); //FMLNetworkHandler.openGui(player, MatthProject.instance, 10, world, pos.getX(), pos.getY(), pos.getZ()); } return true; } But I believe this is not the problem, I did everything as I used to do on a 1.7 mod. I didn't find any changes for 1.8.9 on the internet. For more code visit my github repo: https://github.com/Matthbo/MatthProject
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.