Java 类net.minecraft.client.gui.inventory.GuiShulkerBox 实例源码

项目:VisibleArmorSlots    文件:InfoGuiOverlayDisplayParams.java   
public static InfoGuiOverlayDisplayParams create(GuiContainer gui, String guiClassName)
{
    if (gui == null) { return InfoGuiOverlayDisplayParams.EMPTY; }


    // Check for blacklisted gui's
    if (isBlacklisted(gui)) { return InfoGuiOverlayDisplayParams.EMPTY; }


    int overlayX = 0;
    int overlayY = 0;

    if (ModConfig.extraSlotsSide().equals(ModConfig.POSITION_LEFT)) {
        overlayX = gui.getGuiLeft() - GuiExtraSlotsOverlay.GUI_WIDTH - ModConfig.extraSlotsMargin();
    } else if (ModConfig.extraSlotsSide().equals(ModConfig.POSITION_RIGHT)) {
        overlayX = gui.getGuiLeft() + gui.getXSize() + ModConfig.extraSlotsMargin();
    }
    overlayY = gui.getGuiTop() + gui.getYSize() - GuiExtraSlotsOverlay.GUI_HEIGHT - 4;


    // HOTFIX: Chest containers have their height (YSize) wrong
    if (gui instanceof GuiChest || gui instanceof GuiShulkerBox) {
        overlayY -= 1;
    }


    final InfoGuiOverlayDisplayParams displayParams = new InfoGuiOverlayDisplayParams(overlayX, overlayY, true);
    return displayParams;
}
项目:Zombe-Modpack    文件:EntityPlayerSP.java   
/**
 * Displays the GUI for interacting with a chest inventory.
 */
public void displayGUIChest(IInventory chestInventory)
{
    String s = chestInventory instanceof IInteractionObject ? ((IInteractionObject)chestInventory).getGuiID() : "minecraft:container";

    if ("minecraft:chest".equals(s))
    {
        this.mc.displayGuiScreen(new GuiChest(this.inventory, chestInventory));
    }
    else if ("minecraft:hopper".equals(s))
    {
        this.mc.displayGuiScreen(new GuiHopper(this.inventory, chestInventory));
    }
    else if ("minecraft:furnace".equals(s))
    {
        this.mc.displayGuiScreen(new GuiFurnace(this.inventory, chestInventory));
    }
    else if ("minecraft:brewing_stand".equals(s))
    {
        this.mc.displayGuiScreen(new GuiBrewingStand(this.inventory, chestInventory));
    }
    else if ("minecraft:beacon".equals(s))
    {
        this.mc.displayGuiScreen(new GuiBeacon(this.inventory, chestInventory));
    }
    else if (!"minecraft:dispenser".equals(s) && !"minecraft:dropper".equals(s))
    {
        if ("minecraft:shulker_box".equals(s))
        {
            this.mc.displayGuiScreen(new GuiShulkerBox(this.inventory, chestInventory));
        }
        else
        {
            this.mc.displayGuiScreen(new GuiChest(this.inventory, chestInventory));
        }
    }
    else
    {
        this.mc.displayGuiScreen(new GuiDispenser(this.inventory, chestInventory));
    }
}
项目:Backmemed    文件:EntityPlayerSP.java   
/**
 * Displays the GUI for interacting with a chest inventory.
 */
public void displayGUIChest(IInventory chestInventory)
{
    String s = chestInventory instanceof IInteractionObject ? ((IInteractionObject)chestInventory).getGuiID() : "minecraft:container";

    if ("minecraft:chest".equals(s))
    {
        this.mc.displayGuiScreen(new GuiChest(this.inventory, chestInventory));
    }
    else if ("minecraft:hopper".equals(s))
    {
        this.mc.displayGuiScreen(new GuiHopper(this.inventory, chestInventory));
    }
    else if ("minecraft:furnace".equals(s))
    {
        this.mc.displayGuiScreen(new GuiFurnace(this.inventory, chestInventory));
    }
    else if ("minecraft:brewing_stand".equals(s))
    {
        this.mc.displayGuiScreen(new GuiBrewingStand(this.inventory, chestInventory));
    }
    else if ("minecraft:beacon".equals(s))
    {
        this.mc.displayGuiScreen(new GuiBeacon(this.inventory, chestInventory));
    }
    else if (!"minecraft:dispenser".equals(s) && !"minecraft:dropper".equals(s))
    {
        if ("minecraft:shulker_box".equals(s))
        {
            this.mc.displayGuiScreen(new GuiShulkerBox(this.inventory, chestInventory));
        }
        else
        {
            this.mc.displayGuiScreen(new GuiChest(this.inventory, chestInventory));
        }
    }
    else
    {
        this.mc.displayGuiScreen(new GuiDispenser(this.inventory, chestInventory));
    }
}