Search in sources :

Example 1 with InventoryPanelContainer

use of crazypants.enderio.machine.invpanel.InventoryPanelContainer in project EnderIO by SleepyTrousers.

the class ClientRemoteGuiManager method getServerGuiElement.

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int posLow, int dim, int posHigh) {
    long posl = ((long) posHigh << 32) | (posLow & 0xffffffffL);
    BlockPos pos = BlockPos.fromLong(posl);
    World targetWorld = world;
    if (world.provider.getDimension() != dim) {
        targetWorld = DimensionManager.getWorld(dim);
        if (targetWorld == null) {
            Log.warn("Unexpected failure to get dimension " + dim + " for the Inventory Panel Remote");
            return null;
        }
    }
    TileEntity te = targetWorld.getTileEntity(pos);
    if (te instanceof TileInventoryPanel) {
        return new InventoryPanelContainer(player.inventory, (TileInventoryPanel) te);
    }
    Log.warn("Unexpected failure to get tileentity at " + pos + " in dimension " + dim + " for the Inventory Panel Remote. Got: " + te);
    return null;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileInventoryPanel(crazypants.enderio.machine.invpanel.TileInventoryPanel) InventoryPanelContainer(crazypants.enderio.machine.invpanel.InventoryPanelContainer) BlockPos(net.minecraft.util.math.BlockPos) World(net.minecraft.world.World)

Example 2 with InventoryPanelContainer

use of crazypants.enderio.machine.invpanel.InventoryPanelContainer in project EnderIO by SleepyTrousers.

the class ClientRemoteGuiManager method getClientGuiElement.

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
    TileInventoryPanel te;
    if (targetTE != null && targetTEtime >= EnderIO.proxy.getTickCount()) {
        te = targetTE;
        targetTE = null;
    } else {
        te = new TileInventoryPanel();
    }
    return new GuiInventoryPanel(te, new InventoryPanelContainer(player.inventory, te));
}
Also used : TileInventoryPanel(crazypants.enderio.machine.invpanel.TileInventoryPanel) InventoryPanelContainer(crazypants.enderio.machine.invpanel.InventoryPanelContainer) GuiInventoryPanel(crazypants.enderio.machine.invpanel.GuiInventoryPanel)

Example 3 with InventoryPanelContainer

use of crazypants.enderio.machine.invpanel.InventoryPanelContainer in project EnderIO by SleepyTrousers.

the class CraftingHelper method refill.

public void refill(GuiInventoryPanel gui, int amount) {
    InventoryPanelContainer container = gui.getContainer();
    refill(container, amount);
}
Also used : InventoryPanelContainer(crazypants.enderio.machine.invpanel.InventoryPanelContainer)

Aggregations

InventoryPanelContainer (crazypants.enderio.machine.invpanel.InventoryPanelContainer)3 TileInventoryPanel (crazypants.enderio.machine.invpanel.TileInventoryPanel)2 GuiInventoryPanel (crazypants.enderio.machine.invpanel.GuiInventoryPanel)1 TileEntity (net.minecraft.tileentity.TileEntity)1 BlockPos (net.minecraft.util.math.BlockPos)1 World (net.minecraft.world.World)1