Search in sources :

Example 1 with ContainerTeleporter

use of net.dyeo.teleporter.inventory.ContainerTeleporter in project VanillaTeleporter by dyeo.

the class GuiHandler method getServerGuiElement.

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
    if (ID == GUI_ID_TELEPORTER) {
        BlockPos pos = new BlockPos(x, y, z);
        TileEntity tileentity = world.getTileEntity(pos);
        if (tileentity instanceof TileEntityTeleporter) {
            TileEntityTeleporter tileentityteleporter = (TileEntityTeleporter) tileentity;
            return new ContainerTeleporter(player.inventory, tileentityteleporter);
        }
    }
    return null;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) ContainerTeleporter(net.dyeo.teleporter.inventory.ContainerTeleporter) BlockPos(net.minecraft.util.math.BlockPos) TileEntityTeleporter(net.dyeo.teleporter.tileentity.TileEntityTeleporter)

Aggregations

ContainerTeleporter (net.dyeo.teleporter.inventory.ContainerTeleporter)1 TileEntityTeleporter (net.dyeo.teleporter.tileentity.TileEntityTeleporter)1 TileEntity (net.minecraft.tileentity.TileEntity)1 BlockPos (net.minecraft.util.math.BlockPos)1