use of com.builtbroken.mc.api.tile.node.ITileNodeHost in project Engine by VoltzEngine-Project.
the class PacketOpenGUI method handle.
@Override
public void handle(EntityPlayer player, TileEntity tile) {
if (!player.worldObj.isRemote) {
IGuiTile guiTile = null;
if (tile instanceof IGuiTile) {
guiTile = (IGuiTile) tile;
} else if (tile instanceof ITileNodeHost && ((ITileNodeHost) tile).getTileNode() instanceof IGuiTile) {
guiTile = (IGuiTile) ((ITileNodeHost) tile).getTileNode();
}
if (guiTile != null) {
ByteBuf buf = data().slice();
int guiID = buf.readInt();
if (!guiTile.openGui(player, guiID)) {
Engine.logger().error("Failed to open gui with ID(" + guiID + ") at location " + new Location(player.worldObj, x, y, z) + ", tile = " + tile);
}
} else if (Engine.runningAsDev) {
Engine.logger().error("Tile at location " + new Location(player.worldObj, x, y, z) + " is not an instance of ITileGUI, tile = " + tile);
}
} else if (Engine.runningAsDev) {
Engine.logger().error("Can not open GUI on client using PacketOpenGUI, tile = " + tile);
}
}
use of com.builtbroken.mc.api.tile.node.ITileNodeHost in project Engine by VoltzEngine-Project.
the class MultiBlockListener method getLayoutOfMultiBlock.
@Override
public HashMap<IPos3D, String> getLayoutOfMultiBlock() {
if (doRotation) {
TileEntity tileEntity = getTileEntity();
ForgeDirection dir = null;
if (tileEntity instanceof IRotation) {
dir = ((IRotation) tileEntity).getDirection();
} else if (tileEntity instanceof ITileNodeHost && ((ITileNodeHost) tileEntity).getTileNode() instanceof IRotation) {
dir = ((IRotation) ((ITileNodeHost) tileEntity).getTileNode()).getDirection();
}
return getLayoutOfMultiBlock(dir);
}
return MultiBlockLayoutHandler.get(layoutKey);
}
Aggregations