Jump to content

[1.8] Gui Handler not working?


Looke81

Recommended Posts

It seems that:

 

public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) {

      super.onBlockActivated(world, pos, state, player, side, hitX, hitY, hitZ);

 

        if (world.isRemote) return true;

        else {

            TileEntity tile =  world.getTileEntity(pos);

            if (tile != null) {

                player.openGui(BioWarfare.instance, BioWarfareGuiHandler.MICROBE_EXTRACTOR_GUI_ID, world, pos.getX(), pos.getY(), pos.getZ());

            System.out.println("Block Activated");

            }

        }

        return true;

}

 

Gets called fine but when we get to the guihandler:

 

@Override

  public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {

 

BlockPos pos = BlockPos.ORIGIN;

if (id == MICROBE_EXTRACTOR_GUI_ID) {

 

TileEntity tileEntity = world.getTileEntity(new BlockPos(x, y, z));

if (tileEntity instanceof TileEntityMicrobeExtractor) {

System.out.println("Debugger Server Container");

return new ContainerMicrobeExtractor(player.inventory, (TileEntityMicrobeExtractor) tileEntity);

}

}

return null;

}

 

@Override

public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {

if (id == MICROBE_EXTRACTOR_GUI_ID) {

 

TileEntity tileEntity = world.getTileEntity(new BlockPos(x, y, z));

if (tileEntity instanceof TileEntityMicrobeExtractor) {

System.out.println("Debugger Client Gui");

return new GuiMicrobeExtractor(player.inventory, (TileEntityMicrobeExtractor) tileEntity);

 

}

 

}

return null;

}

 

Neither of these get called. Does anyone know why this might be?

BioWarfare Mod: http://goo.gl/BYWQty

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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