Здравствуйте. Написал свой блок с GUI. Есть небольшая проблема. При попытке открыть гуи имея какой-то блок в руках. При нажатии ПКМ на блок идет где-то секундная попытка установить тот блок, что в руке, и затем открывается GUI. То есть визуально при нажатии ПКМ на мой блок на секунду визуально ставится новый блок, затем пропадает и открывается GUI. Причем не важно, как в это время блок в руке. вот как открываю GUI:
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player,
int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
BlockTestTile tile = (BlockTestTile) world.getTileEntity(x, y, z);
if (tile != null) {
if (!player.isSneaking()&&!world.isRemote) {
player.openGui(instance, BlockTestGuiHandler.GuiID, world, x, y, z);
return true;
} else {
return false;
}
} else return false;
}
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player,
int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
BlockTestTile tile = (BlockTestTile) world.getTileEntity(x, y, z);
if (tile != null) {
if (!player.isSneaking()&&!world.isRemote) {
player.openGui(instance, BlockTestGuiHandler.GuiID, world, x, y, z);
return true;
} else {
return false;
}
} else return false;
}