当前位置: 首页>>代码示例>>Java>>正文


Java GuiContainerCreative类代码示例

本文整理汇总了Java中net.minecraft.client.gui.inventory.GuiContainerCreative的典型用法代码示例。如果您正苦于以下问题:Java GuiContainerCreative类的具体用法?Java GuiContainerCreative怎么用?Java GuiContainerCreative使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GuiContainerCreative类属于net.minecraft.client.gui.inventory包,在下文中一共展示了GuiContainerCreative类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: guiInstance

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
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);
    }
}
 
开发者ID:Tencao,项目名称:SAO-UI---1.8.8,代码行数:22,代码来源:RenderHandler.java

示例2: guiPostInit

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
@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;
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:18,代码来源:TF2EventsClient.java

示例3: guiPostAction

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
@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));
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:23,代码来源:TF2EventsClient.java

示例4: load

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
@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
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:LayoutManager.java

示例5: onMouseClicked

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
@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();
		}
	}
}
 
开发者ID:Modding-Legacy,项目名称:Aether-Legacy,代码行数:27,代码来源:AetherClientEvents.java

示例6: load

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
@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
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:18,代码来源:LayoutManager.java

示例7: drawButtons

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
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);
    }
}
 
开发者ID:univrsal,项目名称:JustEnoughButtons,代码行数:18,代码来源:ModSubsetButtonHandler.java

示例8: load

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
@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
    }
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:19,代码来源:LayoutManager.java

示例9: func_72490_a

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
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);
      }
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:25,代码来源:NetClientHandler.java

示例10: ContainerCreative

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
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);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:17,代码来源:ContainerCreative.java

示例11: func_75183_a

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
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);
         }
      }
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:20,代码来源:ContainerCreative.java

示例12: handleSetSlot

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
/**
 * 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());
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:NetHandlerPlayClient.java

示例13: handleSetSlot

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
/**
 * 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());
		}
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:34,代码来源:NetHandlerPlayClient.java

示例14: isInventoryOpen

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
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;
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:11,代码来源:IMinecraft.java

示例15: modifyVisiblity

import net.minecraft.client.gui.inventory.GuiContainerCreative; //导入依赖的package包/类
@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;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:12,代码来源:NEICreativeGuiHandler.java


注:本文中的net.minecraft.client.gui.inventory.GuiContainerCreative类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。