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

项目:SAO-UI---1.8.8    文件:RenderHandler.java   
static void guiInstance(GuiOpenEvent e) {
    if (!(mc.currentScreen instanceof ScreenGUI)) {
        if (mc.currentScreen != e.gui) {
            if ((e.gui instanceof GuiIngameMenu) || ((e.gui instanceof GuiInventory) && (!OptionCore.DEFAULT_INVENTORY.getValue()))) {
                final boolean inv = (e.gui instanceof GuiInventory);

                if (mc.playerController.isInCreativeMode() && inv)
                    e.gui = new GuiContainerCreative(mc.thePlayer);
                else {
                    e.gui = new IngameMenuGUI((inv ? (GuiInventory) mc.currentScreen : null));
                }
            }
            if ((e.gui instanceof GuiGameOver) && (!OptionCore.DEFAULT_DEATH_SCREEN.getValue())) {
                if (mc.ingameGUI instanceof IngameGUI) {
                    e.gui = new DeathScreen();
                }
            }
        }
        else e.setCanceled(true);
    }
}
项目:SAO-UI---1.8.8    文件:RenderHandler.java   
static void guiInstance(GuiOpenEvent e) {
    if (!(mc.currentScreen instanceof ScreenGUI)) {
        if (mc.currentScreen != e.gui) {
            if ((e.gui instanceof GuiIngameMenu) || ((e.gui instanceof GuiInventory) && (!OptionCore.DEFAULT_INVENTORY.getValue()))) {
                final boolean inv = (e.gui instanceof GuiInventory);

                if (mc.playerController.isInCreativeMode() && inv)
                    e.gui = new GuiContainerCreative(mc.thePlayer);
                else {
                    e.gui = new IngameMenuGUI((inv ? (GuiInventory) mc.currentScreen : null));
                }
            }
            if ((e.gui instanceof GuiGameOver) && (!OptionCore.DEFAULT_DEATH_SCREEN.getValue())) {
                if (mc.ingameGUI instanceof IngameGUI) {
                    e.gui = new DeathScreen();
                }
            }
        }
        else e.setCanceled(true);
    }
}
项目:Mods    文件:TF2EventsClient.java   
@SubscribeEvent
public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) {
    if (Minecraft.getMinecraft().player != null) {
        if ((event.getGui() instanceof GuiInventory || event.getGui() instanceof GuiContainerCreative || event.getGui() instanceof GuiWearables)
                && !Minecraft.getMinecraft().player.getCapability(TF2weapons.INVENTORY_CAP, null).isEmpty()) {
            // GuiContainer gui = (GuiContainer) event.getGui();
            event.getButtonList().add(new GuiButton(97535627, event.getGui().width / 2 - 10, event.getGui().height / 2 + 95, 20, 20, "W"));
        }

        if (event.getGui() instanceof GuiMerchant)
            if (((GuiMerchant) event.getGui()).getMerchant().getDisplayName().getUnformattedText().equals(I18n.format("entity.hale.name"))) {
                event.getButtonList().add(new GuiButton(7578, event.getGui().width / 2 - 100, event.getGui().height / 2 - 110, 100, 20, "Change Team"));
                event.getButtonList().add(new GuiButton(7579, event.getGui().width / 2, event.getGui().height / 2 - 110, 100, 20, "Recover Lost Items"));
            }
        Minecraft.getMinecraft().player.getCapability(TF2weapons.WEAPONS_CAP, null).state &= 8;
    }
}
项目:Mods    文件:TF2EventsClient.java   
@SubscribeEvent
public void guiPostAction(GuiScreenEvent.ActionPerformedEvent.Post event) {

    if (event.getGui() instanceof GuiInventory || event.getGui() instanceof GuiContainerCreative)
        if (event.getButton().id == 97535627) {
            // Minecraft.getMinecraft().displayGuiScreen(null);
            TF2weapons.network.sendToServer(new TF2Message.ShowGuiMessage(0));
        }

    if (event.getGui() instanceof GuiWearables)
        if (event.getButton().id == 97535627) {
            event.getGui().mc.displayGuiScreen(new GuiInventory(event.getGui().mc.player));
        }
    // PacketHandler.INSTANCE.sendToServer(new
    // PacketOpenNormalInventory(event.getGui().mc.player));
    if (event.getGui() instanceof GuiMerchant && event.getButton().id == 7578) {
        ClientProxy.displayScreenJoinTeam();
    }
    else if (event.getGui() instanceof GuiMerchant && event.getButton().id == 7579) {
        TF2weapons.network.sendToServer(new TF2Message.ActionMessage(18));
    }
}
项目:4Space-5    文件:LayoutManager.java   
@Override
public void load(GuiContainer gui) {
    if (isEnabled()) {
        setInputFocused(null);

        ItemList.loadItems();
        overlayRenderer = null;

        getLayoutStyle().init();
        layout(gui);
    }

    NEIController.load(gui);

    if (checkCreativeInv(gui) && gui.mc.currentScreen instanceof GuiContainerCreative)//override creative with creative+
        gui.mc.displayGuiScreen(null);//close the screen and wait for the server to open it for us
}
项目:Aether-Legacy    文件:AetherClientEvents.java   
@SubscribeEvent
public void onMouseClicked(MouseInputEvent.Post event)
{
    if (event.getGui() instanceof GuiContainerCreative)
    {
        GuiContainerCreative guiScreen = (GuiContainerCreative) event.getGui();
        List<GuiButton> buttonList = ObfuscationReflectionHelper.getPrivateValue(GuiScreen.class, (GuiScreen) guiScreen, 7);

        if (previousSelectedTabIndex != guiScreen.getSelectedTabIndex())
        {
            if (guiScreen.getSelectedTabIndex() == CreativeTabs.INVENTORY.getTabIndex() && !buttonList.contains(ACCESSORY_BUTTON))
            {
                int guiLeft = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer)event.getGui(), "guiLeft", "field_147003_i");
                int guiTop = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer)event.getGui(), "guiTop", "field_147009_r");

                buttonList.add(ACCESSORY_BUTTON.setPosition(guiLeft + 73, guiTop + 38));
            }
            else if (previousSelectedTabIndex == CreativeTabs.INVENTORY.getTabIndex())
            {
                buttonList.remove(ACCESSORY_BUTTON);
            }

            previousSelectedTabIndex = guiScreen.getSelectedTabIndex();
        }
    }
}
项目:BIGB    文件:LayoutManager.java   
@Override
public void load(GuiContainer gui) {
    if (isEnabled()) {
        setInputFocused(null);

        ItemList.loadItems.restart();
        overlayRenderer = null;

        getLayoutStyle().init();
        layout(gui);
    }

    NEIController.load(gui);

    if (checkCreativeInv(gui) && gui.mc.currentScreen instanceof GuiContainerCreative)//override creative with creative+
        gui.mc.displayGuiScreen(null);//close the screen and wait for the server to open it for us
}
项目:JustEnoughButtons    文件:ModSubsetButtonHandler.java   
static void drawButtons(int mouseX, int mouseY, int guiTop) {
    if (CreativeTabs.CREATIVE_TAB_ARRAY.length > 12 && guiTop < 72 && ClientProxy.mc.currentScreen instanceof GuiContainerCreative) {
        subsetButton.setWidth(45);
        subsetButton.y = guiTop - 50;
        subsetButton.x = JEIButtons.proxy.getScreenWidth() / 2 - 74;

        if (guiTop > 21)
            subsetButton.drawButton(ClientProxy.mc, mouseX, mouseY, 0);
    } else {
        subsetButton.setWidth(150);
        subsetButton.y = 2;
        subsetButton.x = JEIButtons.proxy.getScreenWidth() / 2 - 75;

        if (guiTop > 21)
            subsetButton.drawButton(ClientProxy.mc, mouseX, mouseY, 0);
    }
}
项目:NotEnoughItems    文件:LayoutManager.java   
@Override
public void load(GuiContainer gui) {
    if (isEnabled()) {
        setInputFocused(null);

        ItemList.loadItems.restart();

        getLayoutStyle().init();
        layout(gui);
    }

    NEIController.load(gui);

    if (checkCreativeInv(gui) && gui.mc.currentScreen instanceof GuiContainerCreative)//override creative with creative+
    {
        gui.mc.displayGuiScreen(null);//close the screen and wait for the server to open it for us
    }
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72490_a(Packet103SetSlot p_72490_1_) {
   EntityClientPlayerMP var2 = this.field_72563_h.field_71439_g;
   if(p_72490_1_.field_73637_a == -1) {
      var2.field_71071_by.func_70437_b(p_72490_1_.field_73636_c);
   } else {
      boolean var3 = false;
      if(this.field_72563_h.field_71462_r instanceof GuiContainerCreative) {
         GuiContainerCreative var4 = (GuiContainerCreative)this.field_72563_h.field_71462_r;
         var3 = var4.func_74230_h() != CreativeTabs.field_78036_m.func_78021_a();
      }

      if(p_72490_1_.field_73637_a == 0 && p_72490_1_.field_73635_b >= 36 && p_72490_1_.field_73635_b < 45) {
         ItemStack var5 = var2.field_71069_bz.func_75139_a(p_72490_1_.field_73635_b).func_75211_c();
         if(p_72490_1_.field_73636_c != null && (var5 == null || var5.field_77994_a < p_72490_1_.field_73636_c.field_77994_a)) {
            p_72490_1_.field_73636_c.field_77992_b = 5;
         }

         var2.field_71069_bz.func_75141_a(p_72490_1_.field_73635_b, p_72490_1_.field_73636_c);
      } else if(p_72490_1_.field_73637_a == var2.field_71070_bA.field_75152_c && (p_72490_1_.field_73637_a != 0 || !var3)) {
         var2.field_71070_bA.func_75141_a(p_72490_1_.field_73635_b, p_72490_1_.field_73636_c);
      }
   }

}
项目:RuneCraftery    文件:ContainerCreative.java   
public ContainerCreative(EntityPlayer p_i1086_1_) {
   InventoryPlayer var2 = p_i1086_1_.field_71071_by;

   int var3;
   for(var3 = 0; var3 < 5; ++var3) {
      for(int var4 = 0; var4 < 9; ++var4) {
         this.func_75146_a(new Slot(GuiContainerCreative.func_74229_i(), var3 * 9 + var4, 9 + var4 * 18, 18 + var3 * 18));
      }
   }

   for(var3 = 0; var3 < 9; ++var3) {
      this.func_75146_a(new Slot(var2, var3, 9 + var3 * 18, 112));
   }

   this.func_75183_a(0.0F);
}
项目:RuneCraftery    文件:ContainerCreative.java   
public void func_75183_a(float p_75183_1_) {
   int var2 = this.field_75185_e.size() / 9 - 5 + 1;
   int var3 = (int)((double)(p_75183_1_ * (float)var2) + 0.5D);
   if(var3 < 0) {
      var3 = 0;
   }

   for(int var4 = 0; var4 < 5; ++var4) {
      for(int var5 = 0; var5 < 9; ++var5) {
         int var6 = var5 + (var4 + var3) * 9;
         if(var6 >= 0 && var6 < this.field_75185_e.size()) {
            GuiContainerCreative.func_74229_i().func_70299_a(var5 + var4 * 9, (ItemStack)this.field_75185_e.get(var6));
         } else {
            GuiContainerCreative.func_74229_i().func_70299_a(var5 + var4 * 9, (ItemStack)null);
         }
      }
   }

}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
/**
 * Handles pickin up an ItemStack or dropping one in your inventory or an open (non-creative) container
 */
public void handleSetSlot(S2FPacketSetSlot packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.thePlayer;

    if (packetIn.func_149175_c() == -1)
    {
        entityplayer.inventory.setItemStack(packetIn.func_149174_e());
    }
    else
    {
        boolean flag = false;

        if (this.gameController.currentScreen instanceof GuiContainerCreative)
        {
            GuiContainerCreative guicontainercreative = (GuiContainerCreative)this.gameController.currentScreen;
            flag = guicontainercreative.getSelectedTabIndex() != CreativeTabs.tabInventory.getTabIndex();
        }

        if (packetIn.func_149175_c() == 0 && packetIn.func_149173_d() >= 36 && packetIn.func_149173_d() < 45)
        {
            ItemStack itemstack = entityplayer.inventoryContainer.getSlot(packetIn.func_149173_d()).getStack();

            if (packetIn.func_149174_e() != null && (itemstack == null || itemstack.stackSize < packetIn.func_149174_e().stackSize))
            {
                packetIn.func_149174_e().animationsToGo = 5;
            }

            entityplayer.inventoryContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e());
        }
        else if (packetIn.func_149175_c() == entityplayer.openContainer.windowId && (packetIn.func_149175_c() != 0 || !flag))
        {
            entityplayer.openContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e());
        }
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Handles pickin up an ItemStack or dropping one in your inventory or an open (non-creative) container
 */
public void handleSetSlot(S2FPacketSetSlot packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.thePlayer;

    if (packetIn.func_149175_c() == -1)
    {
        entityplayer.inventory.setItemStack(packetIn.func_149174_e());
    }
    else
    {
        boolean flag = false;

        if (this.gameController.currentScreen instanceof GuiContainerCreative)
        {
            GuiContainerCreative guicontainercreative = (GuiContainerCreative)this.gameController.currentScreen;
            flag = guicontainercreative.getSelectedTabIndex() != CreativeTabs.tabInventory.getTabIndex();
        }

        if (packetIn.func_149175_c() == 0 && packetIn.func_149173_d() >= 36 && packetIn.func_149173_d() < 45)
        {
            ItemStack itemstack = entityplayer.inventoryContainer.getSlot(packetIn.func_149173_d()).getStack();

            if (packetIn.func_149174_e() != null && (itemstack == null || itemstack.stackSize < packetIn.func_149174_e().stackSize))
            {
                packetIn.func_149174_e().animationsToGo = 5;
            }

            entityplayer.inventoryContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e());
        }
        else if (packetIn.func_149175_c() == entityplayer.openContainer.windowId && (packetIn.func_149175_c() != 0 || !flag))
        {
            entityplayer.openContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e());
        }
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Handles pickin up an ItemStack or dropping one in your inventory or an open
 * (non-creative) container
 */
public void handleSetSlot(S2FPacketSetSlot packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.thePlayer;

    if (packetIn.func_149175_c() == -1) {
        entityplayer.inventory.setItemStack(packetIn.func_149174_e());
    } else {
        boolean flag = false;

        if (this.gameController.currentScreen instanceof GuiContainerCreative) {
            GuiContainerCreative guicontainercreative = (GuiContainerCreative) this.gameController.currentScreen;
            flag = guicontainercreative.getSelectedTabIndex() != CreativeTabs.tabInventory.getTabIndex();
        }

        if (packetIn.func_149175_c() == 0 && packetIn.func_149173_d() >= 36 && packetIn.func_149173_d() < 45) {
            ItemStack itemstack = entityplayer.inventoryContainer.getSlot(packetIn.func_149173_d()).getStack();

            if (packetIn.func_149174_e() != null
                    && (itemstack == null || itemstack.stackSize < packetIn.func_149174_e().stackSize)) {
                packetIn.func_149174_e().animationsToGo = 5;
            }

            entityplayer.inventoryContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e());
        } else if (packetIn.func_149175_c() == entityplayer.openContainer.windowId
                && (packetIn.func_149175_c() != 0 || !flag)) {
            entityplayer.openContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e());
        }
    }
}
项目:EMC    文件:IMinecraft.java   
public static boolean isInventoryOpen() {
    if (Minecraft.getMinecraft().currentScreen != null) {
        if (Minecraft.getMinecraft().currentScreen instanceof GuiContainer
                && (Minecraft.getMinecraft().currentScreen instanceof GuiInventory
                        || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative)) {
            return true;
        }
    }
    return false;
}
项目:4Space-5    文件:NEICreativeGuiHandler.java   
@Override
public VisiblityData modifyVisiblity(GuiContainer gui, VisiblityData currentVisibility)
{
    if(!(gui instanceof GuiContainerCreative))
        return currentVisibility;

    if(((GuiContainerCreative)gui).func_147056_g() != CreativeTabs.tabInventory.getTabIndex())
        currentVisibility.showItemSection = currentVisibility.enableDeleteMode = false;

    return currentVisibility;
}
项目:4Space-5    文件:LayoutManager.java   
@Override
public void onPreDraw(GuiContainer gui) {
    if (!isHidden() && isEnabled() && gui instanceof InventoryEffectRenderer)//Reset the gui to the center of the screen, for potion effect offsets etc
    {
        gui.guiLeft = (gui.width - gui.xSize) / 2;
        gui.guiTop = (gui.height - gui.ySize) / 2;

        if (gui instanceof GuiContainerCreative && gui.buttonList.size() >= 2) {
            GuiButton button1 = (GuiButton) gui.buttonList.get(0);
            GuiButton button2 = (GuiButton) gui.buttonList.get(1);
            button1.xPosition = gui.guiLeft;
            button2.xPosition = gui.guiLeft + gui.xSize - 20;
        }
    }
}
项目:4Space-5    文件:LayoutManager.java   
public boolean checkCreativeInv(GuiContainer gui) {
    if (gui instanceof GuiContainerCreative && invCreativeMode()) {
        NEICPH.sendCreativeInv(true);
        return true;
    } else if (gui instanceof GuiExtendedCreativeInv && !invCreativeMode()) {
        NEICPH.sendCreativeInv(false);
        return true;
    }
    return false;
}
项目:Aether-Legacy    文件:AetherClientEvents.java   
@SubscribeEvent
public void onGuiOpened(GuiScreenEvent.InitGuiEvent.Post event)
{
    if (event.getGui() instanceof GuiContainer)
    {
        EntityPlayer player = Minecraft.getMinecraft().thePlayer;
        Class<?> clazz = event.getGui().getClass();

        int guiLeft = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer)event.getGui(), "guiLeft", "field_147003_i");
        int guiTop = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, (GuiContainer)event.getGui(), "guiTop", "field_147009_r");

        if (player.capabilities.isCreativeMode)
        {
            if (event.getGui() instanceof GuiContainerCreative)
            {
                if (((GuiContainerCreative)event.getGui()).getSelectedTabIndex() == CreativeTabs.INVENTORY.getTabIndex())
                {
                    event.getButtonList().add(ACCESSORY_BUTTON.setPosition(guiLeft + 73, guiTop + 38));
                    previousSelectedTabIndex = CreativeTabs.INVENTORY.getTabIndex();
                }
            }
        }
        else if (clazz == GuiInventory.class)
        {
            event.getButtonList().add(ACCESSORY_BUTTON.setPosition(guiLeft + 26, guiTop + 65));
        }
    }
}
项目:Aether-Legacy    文件:AetherClientEvents.java   
@SubscribeEvent
public void onButtonPressed(GuiScreenEvent.ActionPerformedEvent.Pre event)
{
    Class<?> clazz = event.getGui().getClass();

    if ((clazz == GuiInventory.class || clazz == GuiContainerCreative.class) && event.getButton().id == 18067)
    {
        AetherNetworkingManager.sendToServer(new PacketOpenContainer(AetherGuiHandler.accessories));
    }
}
项目:BIGB    文件:NEICreativeGuiHandler.java   
@Override
public VisiblityData modifyVisiblity(GuiContainer gui, VisiblityData currentVisibility)
{
    if(!(gui instanceof GuiContainerCreative))
        return currentVisibility;

    if(((GuiContainerCreative)gui).getSelectedTabIndex() != CreativeTabs.tabInventory.getTabIndex())
        currentVisibility.showItemSection = currentVisibility.enableDeleteMode = false;

    return currentVisibility;
}
项目:BIGB    文件:LayoutManager.java   
@Override
public void onPreDraw(GuiContainer gui) {
    if (!isHidden() && isEnabled() && gui instanceof InventoryEffectRenderer)//Reset the gui to the center of the screen, for potion effect offsets etc
    {
        gui.guiLeft = (gui.width - gui.xSize) / 2;
        gui.guiTop = (gui.height - gui.ySize) / 2;

        if (gui instanceof GuiContainerCreative && gui.buttonList.size() >= 2) {
            GuiButton button1 = (GuiButton) gui.buttonList.get(0);
            GuiButton button2 = (GuiButton) gui.buttonList.get(1);
            button1.xPosition = gui.guiLeft;
            button2.xPosition = gui.guiLeft + gui.xSize - 20;
        }
    }
}
项目:BIGB    文件:LayoutManager.java   
public boolean checkCreativeInv(GuiContainer gui) {
    if (gui instanceof GuiContainerCreative && invCreativeMode()) {
        NEICPH.sendCreativeInv(true);
        return true;
    } else if (gui instanceof GuiExtendedCreativeInv && !invCreativeMode()) {
        NEICPH.sendCreativeInv(false);
        return true;
    }
    return false;
}
项目:Alchemy    文件:CapabilityBauble.java   
@SideOnly(Side.CLIENT)
@Hook(value = "net.minecraft.client.gui.inventory.GuiContainerCreative#func_146976_a", type = Hook.Type.TAIL)
public static final void drawGuiContainerBackgroundLayer(GuiContainerCreative gui, float partialTicks, int mouseX, int mouseY) {
    if (gui.getSelectedTabIndex() == CreativeTabs.INVENTORY.getTabIndex()) {
        HUDManager.bind(GuiContainer.INVENTORY_BACKGROUND);
        for (int i = 0; i < 4; i++)
            gui.drawTexturedModalRect(gui.guiLeft + 126 + i / 2 * 18, gui.guiTop + 10 + i % 2 * 18, 76, 61, 18, 18);
        for (int i = 0; i < 4; i++)
            gui.drawTexturedModalRect(gui.guiLeft + 16 + i / 2 * 18, gui.guiTop + 10 + i % 2 * 18, 76, 61, 18, 18);
    }
}
项目:Alchemy    文件:CapabilityBauble.java   
@SideOnly(Side.CLIENT)
@Hook(value = "net.minecraft.client.gui.inventory.GuiContainerCreative#func_147050_b", type = Hook.Type.TAIL)
public static final void setCurrentCreativeTab(GuiContainerCreative gui, CreativeTabs tab) {
    if (tab == CreativeTabs.INVENTORY)
        for (int len = 8, start = gui.inventorySlots.inventorySlots.size() - len - 1, i = 0; i < len; i++) {
            Slot slot = gui.inventorySlots.getSlot(start + (i == 4 ? 5 : i == 5 ? 4 : i < 4 ? i == 0 ? 3 : i - 1 : i));
            slot.xPos = (i > 3 ? 91 : 17) + i / 2 * 18;
            slot.yPos = 11 + i % 2 * 18;
        }
}
项目:NotEnoughItems    文件:NEICreativeGuiHandler.java   
@Override
public VisibilityData modifyVisibility(GuiContainer gui, VisibilityData currentVisibility) {
    if (!(gui instanceof GuiContainerCreative)) {
        return currentVisibility;
    }

    if (((GuiContainerCreative) gui).getSelectedTabIndex() != CreativeTabs.INVENTORY.getTabIndex()) {
        currentVisibility.showItemPanel = currentVisibility.enableDeleteMode = false;
    }

    return currentVisibility;
}
项目:NotEnoughItems    文件:LayoutManager.java   
public boolean checkCreativeInv(GuiContainer gui) {
    if (gui instanceof GuiContainerCreative && invCreativeMode()) {
        NEIClientPacketHandler.sendCreativeInv(true);
        return true;
    } else if (gui instanceof GuiExtendedCreativeInv && !invCreativeMode()) {
        NEIClientPacketHandler.sendCreativeInv(false);
        return true;
    }
    return false;
}
项目:Creator    文件:ClientEventHandler.java   
@SubscribeEvent
public void onGuiOpen(GuiOpenEvent event) {
    if (allowNext) {
        allowNext = false;
        return;
    }

    if (event.gui instanceof GuiContainerCreative) {
        event.gui = new GuiBetterCreative(Minecraft.getMinecraft().thePlayer);
    }
}
项目:Creator    文件:GuiBetterCreative.java   
@Override
protected void keyTyped(char c, int keycode) {
    super.keyTyped(c, keycode);

    if (keycode == Keyboard.KEY_Q) {
        ClientEventHandler.allowNext = true;
        mc.displayGuiScreen(new GuiContainerCreative(mc.thePlayer));
    }
}
项目:TFC2    文件:GuiInventoryTFC.java   
@Override
/**
 * Called from the main game loop to update the screen.
 */
public void updateScreen()
{
    if (this.mc.playerController.isInCreativeMode())
        this.mc.displayGuiScreen(new GuiContainerCreative(player));
}
项目:TFC2    文件:GuiInventoryTFC.java   
@Override
public void initGui()
{
    super.buttonList.clear();

    if (this.mc.playerController.isInCreativeMode())
    {
        this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.player));
    }
    else
        super.initGui();

    if (!this.mc.player.getActivePotionEffects().isEmpty())
    {
        //this.guiLeft = 160 + (this.width - this.xSize - 200) / 2;
        this.guiLeft = (this.width - this.xSize) / 2;
        this.hasEffect = true;
    }

    buttonList.clear();
    buttonList.add(new GuiInventoryButton(0, new Rectangle(guiLeft+176, guiTop + 3, 25, 20), 
            new Rectangle(0, 103, 25, 20), Core.translate("gui.Inventory.Inventory"), new Rectangle(1,223,32,32)));
    buttonList.add(new GuiInventoryButton(1, new Rectangle(guiLeft+176, guiTop + 22, 25, 20), 
            new Rectangle(0, 103, 25, 20), Core.translate("gui.Inventory.Skills"), new Rectangle(100,223,32,32)));
    buttonList.add(new GuiInventoryButton(2, new Rectangle(guiLeft+176, guiTop + 41, 25, 20), 
            new Rectangle(0, 103, 25, 20), Core.translate("gui.Calendar.Calendar"), new Rectangle(34,223,32,32)));
    buttonList.add(new GuiInventoryButton(3, new Rectangle(guiLeft+176, guiTop + 60, 25, 20), 
            new Rectangle(0, 103, 25, 20), Core.translate("gui.Inventory.Health"), new Rectangle(67,223,32,32)));
}
项目:Resilience-Client-Source    文件:NetHandlerPlayClient.java   
/**
 * Handles pickin up an ItemStack or dropping one in your inventory or an open (non-creative) container
 */
public void handleSetSlot(S2FPacketSetSlot p_147266_1_)
{
    EntityClientPlayerMP var2 = this.gameController.thePlayer;

    if (p_147266_1_.func_149175_c() == -1)
    {
        var2.inventory.setItemStack(p_147266_1_.func_149174_e());
    }
    else
    {
        boolean var3 = false;

        if (this.gameController.currentScreen instanceof GuiContainerCreative)
        {
            GuiContainerCreative var4 = (GuiContainerCreative)this.gameController.currentScreen;
            var3 = var4.func_147056_g() != CreativeTabs.tabInventory.getTabIndex();
        }

        if (p_147266_1_.func_149175_c() == 0 && p_147266_1_.func_149173_d() >= 36 && p_147266_1_.func_149173_d() < 45)
        {
            ItemStack var5 = var2.inventoryContainer.getSlot(p_147266_1_.func_149173_d()).getStack();

            if (p_147266_1_.func_149174_e() != null && (var5 == null || var5.stackSize < p_147266_1_.func_149174_e().stackSize))
            {
                p_147266_1_.func_149174_e().animationsToGo = 5;
            }

            var2.inventoryContainer.putStackInSlot(p_147266_1_.func_149173_d(), p_147266_1_.func_149174_e());
        }
        else if (p_147266_1_.func_149175_c() == var2.openContainer.windowId && (p_147266_1_.func_149175_c() != 0 || !var3))
        {
            var2.openContainer.putStackInSlot(p_147266_1_.func_149173_d(), p_147266_1_.func_149174_e());
        }
    }
}
项目:rpginventory    文件:ClientProxy.java   
@Override
public void openGUI(EntityPlayer p1, int id) {
    if (Minecraft.getMinecraft().playerController.isInCreativeMode()) {
        Minecraft.getMinecraft().displayGuiScreen(new GuiContainerCreative(p1));
    } else {
        Minecraft.getMinecraft().displayGuiScreen(new GuiInventory(p1));
    }
}
项目:TFC2    文件:GuiInventoryTFC.java   
@Override
/**
 * Called from the main game loop to update the screen.
 */
public void updateScreen()
{
    if (this.mc.playerController.isInCreativeMode())
        this.mc.displayGuiScreen(new GuiContainerCreative(player));
}
项目:TFC2    文件:GuiInventoryTFC.java   
@Override
public void initGui()
{
    super.buttonList.clear();

    if (this.mc.playerController.isInCreativeMode())
    {
        this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.player));
    }
    else
        super.initGui();

    if (!this.mc.player.getActivePotionEffects().isEmpty())
    {
        //this.guiLeft = 160 + (this.width - this.xSize - 200) / 2;
        this.guiLeft = (this.width - this.xSize) / 2;
        this.hasEffect = true;
    }

    buttonList.clear();
    buttonList.add(new GuiInventoryButton(0, new Rectangle(guiLeft+176, guiTop + 3, 25, 20), 
            new Rectangle(0, 103, 25, 20), Core.translate("gui.Inventory.Inventory"), new Rectangle(1,223,32,32)));
    buttonList.add(new GuiInventoryButton(1, new Rectangle(guiLeft+176, guiTop + 22, 25, 20), 
            new Rectangle(0, 103, 25, 20), Core.translate("gui.Inventory.Skills"), new Rectangle(100,223,32,32)));
    buttonList.add(new GuiInventoryButton(2, new Rectangle(guiLeft+176, guiTop + 41, 25, 20), 
            new Rectangle(0, 103, 25, 20), Core.translate("gui.Calendar.Calendar"), new Rectangle(34,223,32,32)));
    buttonList.add(new GuiInventoryButton(3, new Rectangle(guiLeft+176, guiTop + 60, 25, 20), 
            new Rectangle(0, 103, 25, 20), Core.translate("gui.Inventory.Health"), new Rectangle(67,223,32,32)));
}
项目:RecipeIGE    文件:RIGETickHandler.java   
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData)
{
    if (FMLCommonHandler.instance().getEffectiveSide().isClient() && Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative)
    {
        GuiContainerCreative gui = (GuiContainerCreative) Minecraft.getMinecraft().currentScreen;
        List<GuiButton> buttons = ObfuscationReflectionHelper.<List<GuiButton>, GuiScreen> getPrivateValue(GuiScreen.class, Minecraft.getMinecraft().currentScreen, "buttonList", "field_73887_h");
        if (buttons.size() > 2)
            buttons.remove(2);
        buttons.add(new SmallButton(10, 0, (Integer) ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, gui, "guiLeft", "field_74198_m"), (Integer) ObfuscationReflectionHelper
                .getPrivateValue(GuiContainer.class, gui, "guiTop", "field_74197_n")));
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleSetSlot(S2FPacketSetSlot p_147266_1_)
{
    EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer;

    if (p_147266_1_.func_149175_c() == -1)
    {
        entityclientplayermp.inventory.setItemStack(p_147266_1_.func_149174_e());
    }
    else
    {
        boolean flag = false;

        if (this.gameController.currentScreen instanceof GuiContainerCreative)
        {
            GuiContainerCreative guicontainercreative = (GuiContainerCreative)this.gameController.currentScreen;
            flag = guicontainercreative.func_147056_g() != CreativeTabs.tabInventory.getTabIndex();
        }

        if (p_147266_1_.func_149175_c() == 0 && p_147266_1_.func_149173_d() >= 36 && p_147266_1_.func_149173_d() < 45)
        {
            ItemStack itemstack = entityclientplayermp.inventoryContainer.getSlot(p_147266_1_.func_149173_d()).getStack();

            if (p_147266_1_.func_149174_e() != null && (itemstack == null || itemstack.stackSize < p_147266_1_.func_149174_e().stackSize))
            {
                p_147266_1_.func_149174_e().animationsToGo = 5;
            }

            entityclientplayermp.inventoryContainer.putStackInSlot(p_147266_1_.func_149173_d(), p_147266_1_.func_149174_e());
        }
        else if (p_147266_1_.func_149175_c() == entityclientplayermp.openContainer.windowId && (p_147266_1_.func_149175_c() != 0 || !flag))
        {
            entityclientplayermp.openContainer.putStackInSlot(p_147266_1_.func_149173_d(), p_147266_1_.func_149174_e());
        }
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleSetSlot(S2FPacketSetSlot p_147266_1_)
{
    EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer;

    if (p_147266_1_.func_149175_c() == -1)
    {
        entityclientplayermp.inventory.setItemStack(p_147266_1_.func_149174_e());
    }
    else
    {
        boolean flag = false;

        if (this.gameController.currentScreen instanceof GuiContainerCreative)
        {
            GuiContainerCreative guicontainercreative = (GuiContainerCreative)this.gameController.currentScreen;
            flag = guicontainercreative.func_147056_g() != CreativeTabs.tabInventory.getTabIndex();
        }

        if (p_147266_1_.func_149175_c() == 0 && p_147266_1_.func_149173_d() >= 36 && p_147266_1_.func_149173_d() < 45)
        {
            ItemStack itemstack = entityclientplayermp.inventoryContainer.getSlot(p_147266_1_.func_149173_d()).getStack();

            if (p_147266_1_.func_149174_e() != null && (itemstack == null || itemstack.stackSize < p_147266_1_.func_149174_e().stackSize))
            {
                p_147266_1_.func_149174_e().animationsToGo = 5;
            }

            entityclientplayermp.inventoryContainer.putStackInSlot(p_147266_1_.func_149173_d(), p_147266_1_.func_149174_e());
        }
        else if (p_147266_1_.func_149175_c() == entityclientplayermp.openContainer.windowId && (p_147266_1_.func_149175_c() != 0 || !flag))
        {
            entityclientplayermp.openContainer.putStackInSlot(p_147266_1_.func_149173_d(), p_147266_1_.func_149174_e());
        }
    }
}
项目:RuneCraftery    文件:GuiInventory.java   
public void func_73866_w_() {
   this.field_73887_h.clear();
   if(this.field_73882_e.field_71442_b.func_78758_h()) {
      this.field_73882_e.func_71373_a(new GuiContainerCreative(this.field_73882_e.field_71439_g));
   } else {
      super.func_73866_w_();
   }

}