Posted May 24, 201510 yr world.getBlock() has disappeared in 1.8, so what should I use to get the block for my guihandler in place of my old code: if(ID == DorfsVsGoblins.guiIDDorfAnvil && world.getBlock(x, y, z)) { }
May 24, 201510 yr Author I don't understand how getBlockState() works, what arguments does it need? when I swapped out getBlock() for getBlockState() I get an error telling me it needs a BlockPos but I don't understand what that is.
May 24, 201510 yr Author These are the methods from my guiHandler: @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch(ID) { //case 0: return new ContainerDorfAnvil(player.inventory, world, x, y, z); } if(ID == DorfsVsGoblins.guiIDDorfAnvil) { return ID == DorfsVsGoblins.guiIDDorfAnvil && world.getBlockState(x, y, z) == DorfsVsGoblins.blockDorfAnvil ? new ContainerDorfAnvil(player.inventory, world, x, y, z) : null; } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch(ID) { //case 0: return new GuiDorfAnvil(player.inventory, world, x, y, z); } if(ID == DorfsVsGoblins.guiIDDorfAnvil) { return ID == DorfsVsGoblins.guiIDDorfAnvil && world.getBlockState(x, y, z) == DorfsVsGoblins.blockDorfAnvil ? new GuiDorfAnvil(player.inventory, world, x, y, z) : null; } return null; } What am I doing wrong?
May 24, 201510 yr Author ohhhh I get it now instead of getBlock() I use getBlockState(new BlockPos(x, y, z)) thanks for the help, sorry I'm a bit slow lol
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.