Search in sources :

Example 1 with GenericBlock

use of mcjty.lib.container.GenericBlock in project RFToolsDimensions by McJty.

the class GuiProxy method getServerGuiElement.

@Override
public Object getServerGuiElement(int guiid, EntityPlayer entityPlayer, World world, int x, int y, int z) {
    if (guiid == RFToolsDim.GUI_MANUAL_DIMENSION) {
        return null;
    }
    //        if (guiid == RFToolsDim.GUI_MANUAL_MAIN || guiid == RFTools.GUI_TELEPORTPROBE || guiid == RFTools.GUI_ADVANCEDPORTER) {
    //            return null;
    //        } else if (guiid == RFTools.GUI_REMOTE_STORAGE_ITEM) {
    //            return new RemoteStorageItemContainer(entityPlayer);
    //        } else if (guiid == RFTools.GUI_MODULAR_STORAGE_ITEM) {
    //            return new ModularStorageItemContainer(entityPlayer);
    //        } else if (guiid == RFTools.GUI_STORAGE_FILTER) {
    //            return new StorageFilterContainer(entityPlayer);
    //        }
    BlockPos pos = new BlockPos(x, y, z);
    Block block = world.getBlockState(pos).getBlock();
    if (block instanceof GenericBlock) {
        GenericBlock genericBlock = (GenericBlock) block;
        TileEntity te = world.getTileEntity(pos);
        return genericBlock.createServerContainer(entityPlayer, te);
    }
    return null;
}
Also used : GenericBlock(mcjty.lib.container.GenericBlock) TileEntity(net.minecraft.tileentity.TileEntity) GenericBlock(mcjty.lib.container.GenericBlock) Block(net.minecraft.block.Block) BlockPos(net.minecraft.util.math.BlockPos)

Example 2 with GenericBlock

use of mcjty.lib.container.GenericBlock in project RFToolsDimensions by McJty.

the class GuiProxy method getClientGuiElement.

@Override
public Object getClientGuiElement(int guiid, EntityPlayer entityPlayer, World world, int x, int y, int z) {
    if (guiid == RFToolsDim.GUI_MANUAL_DIMENSION) {
        return new GuiRFToolsManual(GuiRFToolsManual.MANUAL_DIMENSION);
    }
    //        if (guiid == RFTools.GUI_MANUAL_MAIN) {
    //            return new GuiRFToolsManual(GuiRFToolsManual.MANUAL_MAIN);
    //        } else if (guiid == RFTools.GUI_TELEPORTPROBE) {
    //            return new GuiTeleportProbe();
    //        } else if (guiid == RFTools.GUI_ADVANCEDPORTER) {
    //            return new GuiAdvancedPorter();
    //        } else if (guiid == RFTools.GUI_REMOTE_STORAGE_ITEM) {
    //            return new GuiModularStorage(new RemoteStorageItemContainer(entityPlayer));
    //        } else if (guiid == RFTools.GUI_MODULAR_STORAGE_ITEM) {
    //            return new GuiModularStorage(new ModularStorageItemContainer(entityPlayer));
    //        } else if (guiid == RFTools.GUI_STORAGE_FILTER) {
    //            return new GuiStorageFilter(new StorageFilterContainer(entityPlayer));
    //        }
    BlockPos pos = new BlockPos(x, y, z);
    Block block = world.getBlockState(pos).getBlock();
    if (block instanceof GenericBlock) {
        GenericBlock genericBlock = (GenericBlock) block;
        TileEntity te = world.getTileEntity(pos);
        return genericBlock.createClientGui(entityPlayer, te);
    }
    return null;
}
Also used : GenericBlock(mcjty.lib.container.GenericBlock) TileEntity(net.minecraft.tileentity.TileEntity) GenericBlock(mcjty.lib.container.GenericBlock) Block(net.minecraft.block.Block) BlockPos(net.minecraft.util.math.BlockPos) GuiRFToolsManual(mcjty.rftoolsdim.items.manual.GuiRFToolsManual)

Aggregations

GenericBlock (mcjty.lib.container.GenericBlock)2 Block (net.minecraft.block.Block)2 TileEntity (net.minecraft.tileentity.TileEntity)2 BlockPos (net.minecraft.util.math.BlockPos)2 GuiRFToolsManual (mcjty.rftoolsdim.items.manual.GuiRFToolsManual)1