Search in sources :

Example 1 with ContainerRequester

use of buildcraft.robotics.gui.ContainerRequester in project BuildCraft by BuildCraft.

the class RoboticsGuiHandler method getServerGuiElement.

@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
    BlockPos pos = new BlockPos(x, y, z);
    if (!world.isBlockLoaded(pos)) {
        return null;
    }
    TileEntity tile = world.getTileEntity(pos);
    switch(id) {
        case GuiIds.MAP:
            if (!(tile instanceof TileZonePlan)) {
                return null;
            } else {
                return new ContainerZonePlan(player, (TileZonePlan) tile);
            }
        case GuiIds.REQUESTER:
            if (!(tile instanceof TileRequester)) {
                return null;
            } else {
                return new ContainerRequester(player, (TileRequester) tile);
            }
        default:
            return null;
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) ContainerRequester(buildcraft.robotics.gui.ContainerRequester) BlockPos(net.minecraft.util.math.BlockPos) ContainerZonePlan(buildcraft.robotics.gui.ContainerZonePlan)

Aggregations

ContainerRequester (buildcraft.robotics.gui.ContainerRequester)1 ContainerZonePlan (buildcraft.robotics.gui.ContainerZonePlan)1 TileEntity (net.minecraft.tileentity.TileEntity)1 BlockPos (net.minecraft.util.math.BlockPos)1