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


Java GuiInventory类代码示例

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


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

示例1: guiInstance

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的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: onRender

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的package包/类
@Override
public void onRender(float partialTicks)
{
	boolean found = false;
	for(Object entity : WMinecraft.getWorld().loadedEntityList)
		if(entity instanceof EntityOtherPlayerMP)
		{
			EntityOtherPlayerMP player = (EntityOtherPlayerMP)entity;
			if(player.getName().equals(playerName))
			{
				ChatUtils.message(
					"Showing inventory of " + player.getName() + ".");
				mc.displayGuiScreen(new GuiInventory(player));
				found = true;
			}
		}
	if(!found)
		ChatUtils.error("Player not found.");
	playerName = null;
	wurst.events.remove(RenderListener.class, this);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:22,代码来源:InvseeCmd.java

示例3: onTick

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的package包/类
@EventTarget
private void onTick(TickEvent event) {
    if (this.mc.currentScreen == null || this.mc.currentScreen instanceof GuiInventory || !this.mc.currentScreen.getClass().getName().contains("inventory")) {
        int slotID = -1;
        double maxProt = -1.0;
        int i = 9;
        while (i < 45) {
            double protValue;
            ItemStack stack = this.mc.thePlayer.inventoryContainer.getSlot(i).getStack();
            if (stack != null && this.canEquip(stack) && (protValue = this.getProtValue(stack)) >= maxProt) {
                slotID = i;
                maxProt = protValue;
            }
            ++i;
        }
        if (slotID != -1) {
            this.mc.playerController.windowClick(this.mc.thePlayer.inventoryContainer.windowId, slotID, 0, 1, (EntityPlayer)this.mc.thePlayer);
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:21,代码来源:AutoArmor.java

示例4: guiPostInit

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的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

示例5: guiPostAction

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的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

示例6: shouldDisplayGuiOverlay

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的package包/类
/**
 * Returns if the current GUI should have the extra slots visible.
 */
boolean shouldDisplayGuiOverlay(GuiScreen gui)
{
    if (gui == null) { return false; }
    if (Minecraft.getMinecraft().world == null) { return false; }
    if (!(gui instanceof GuiContainer)) { return false; }
    if (gui instanceof GuiInventory) { return false; }
    if (gui.mc.player.isSpectator()) { return false; }

    // Edge case for modders that use GuiContainer with no inventory (Y U do dis?)
    final GuiContainer guiWithStuff = (GuiContainer) gui;
    if (guiWithStuff.inventorySlots == null || guiWithStuff.inventorySlots.inventorySlots == null || guiWithStuff.inventorySlots.inventorySlots.size() == 0) { return false; }

    final InfoGuiOverlayDisplayParams displayParams = getDisplayParamsForGui(gui);
    return displayParams.getShouldDisplay();
}
 
开发者ID:sidben,项目名称:VisibleArmorSlots,代码行数:19,代码来源:EventDelegatorGuiOverlay.java

示例7: setExternalGuiPosition

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的package包/类
public void setExternalGuiPosition(GuiScreen gui)
{
    if (gui instanceof GuiContainer) {
        final int candidateGuiLeft = ((GuiContainer) gui).getGuiLeft();
        final int candidateGuiTop = ((GuiContainer) gui).getGuiTop();

        // -- NOTE --
        // The creative inventory would cause this method to be fired twice, once for
        // net.minecraft.client.gui.inventory.GuiContainerCreative (with correct values)
        // and once for net.minecraft.client.gui.inventory.GuiInventory (with wrong values).
        //
        // I ignore the second call so the gui overlay preserves the correct values.
        if (gui instanceof GuiInventory && candidateGuiLeft == 0 && candidateGuiTop == 0) { return; }

        this._externalGuiLeft = candidateGuiLeft;
        this._externalGuiTop = candidateGuiTop;

    } else {
        this._externalGuiLeft = -1;
        this._externalGuiTop = -1;

    }

    LogHelper.trace("GuiExtraSlotsOverlay.setExternalGuiPosition() - left: %d, top: %d", this._externalGuiLeft, this._externalGuiTop);
}
 
开发者ID:sidben,项目名称:VisibleArmorSlots,代码行数:26,代码来源:GuiExtraSlotsOverlay.java

示例8: shouldDisplayTankGui

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public static boolean shouldDisplayTankGui(GuiScreen gui)
{
    if (FMLClientHandler.instance().getClient().gameSettings.hideGUI)
    {
        return false;
    }

    if (gui == null)
    {
        return true;
    }

    if (gui instanceof GuiInventory)
    {
        return false;
    }

    return gui instanceof GuiChat;

}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:22,代码来源:OxygenUtil.java

示例9: drawCharacter

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的package包/类
private void drawCharacter(int x, int y, int size, int cursorX, int cursorY) {
    final float mouseX = (float) x - cursorX;
    final float mouseY = (float) y - size * 1.67F - cursorY;
    EntityLivingBase tmp = (EntityLivingBase)character.ridingEntity;

    IS_VIEWING = true;
    if (character.isRiding() && OptionCore.MOUNT_STAT_VIEW.getValue())
        GuiInventory.drawEntityOnScreen(x, y, size, mouseX, mouseY, tmp);
    else GuiInventory.drawEntityOnScreen(x, y, size, mouseX, mouseY, character);
    IS_VIEWING = false;

    GLCore.glRescaleNormal(true);
    GLCore.glTexture2D(true);
    GLCore.glBlend(true);

    GLCore.tryBlendFuncSeparate(770, 771, 1, 0);
}
 
开发者ID:Tencao,项目名称:SAO-UI---1.8.8,代码行数:18,代码来源:CharacterView.java

示例10: keyTyped

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的package包/类
@Override
protected void keyTyped(char chr, int keySym) throws IOException {
    if (keySym == Keyboard.KEY_BACK || chr == 'z') {
        actionPerformed(backButton);
    } else if (keySym == Keyboard.KEY_NEXT || chr == ' ') {
        actionPerformed(nextPage);
    } else if (keySym == Keyboard.KEY_PRIOR) {
        actionPerformed(prevPage);
    } else if (keySym == Keyboard.KEY_HOME) {
        actionPerformed(homeButton);
    } else if (chr == 'r') {
        initGui();
    } else if (chr == 's') {
        state.dark_color_scheme ^= true;
    } else if (keySym == mc.gameSettings.keyBindInventory.getKeyCode()) {
        mc.displayGuiScreen(new GuiInventory(mc.thePlayer));
    } else if (chr == 'l') {
        RecipeViewer.resetCache();
        initGui();
    } else {
        super.keyTyped(chr, keySym);
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:24,代码来源:DocViewer.java

示例11: onRender

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的package包/类
@Override
public void onRender() {
    boolean found = false;
    for (Object entity : Minecraft.getMinecraft().theWorld.loadedEntityList) {
        if (entity instanceof EntityOtherPlayerMP) {
            EntityOtherPlayerMP player = (EntityOtherPlayerMP) entity;
            if (player.getName().equals(playerName)) {
                WurstClient.INSTANCE.chat.message("Showing inventory of " + player.getName() + ".");
                Minecraft.getMinecraft().displayGuiScreen(new GuiInventory(player));
                found = true;
            }
        }
    }
    if (!found) WurstClient.INSTANCE.chat.error("Player not found.");
    playerName = null;
    WurstClient.INSTANCE.events.remove(RenderListener.class, this);
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:18,代码来源:InvseeCmd.java

示例12: onEnable

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的package包/类
@Override
public void onEnable() {
    if (Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem() == null ||
            !(Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem().getItem() instanceof ItemNameTag)) {
        WurstClient.INSTANCE.chat.error("You are not holding a nametag in your hand.");
        setEnabled(false);
        return;
    } else if (!Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) {
        WurstClient.INSTANCE.chat.error("Creative mode only.");
        setEnabled(false);
        return;
    }
    String stackName = "";
    for (int i = 0; i < 3000; i++) {
        StringBuilder builder = new StringBuilder().append(stackName);
        stackName = builder.append("############").toString();
    }
    Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem().setStackDisplayName(stackName);
    Minecraft.getMinecraft().displayGuiScreen(new GuiInventory(Minecraft.getMinecraft().thePlayer));
    Minecraft.getMinecraft().thePlayer.closeScreen();
    WurstClient.INSTANCE.chat.message("CrashItem created. Right click a mob with it.");
    setEnabled(false);
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:24,代码来源:CrashItemMod.java

示例13: drawGuiContainerBackgroundLayer

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
	if(player.getEntityData().hasKey("craftingTable"))
		Core.bindTexture(UPPER_TEXTURE);
	else
		Core.bindTexture(UPPER_TEXTURE_2X2);
	int k = this.guiLeft;
	int l = this.guiTop;
	this.drawTexturedModalRect(k, l, 0, 0, this.xSize, 102);

	//Draw the player avatar
	GuiInventory.drawEntityOnScreen(k + 51, l + 75, 30, k + 51 - this.xSizeLow, l + 75 - 50 - this.ySizeLow, this.mc.player);

	PlayerInventory.drawInventory(this, width, height, ySize - PlayerInventory.invYSize);
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:19,代码来源:GuiInventoryTFC.java

示例14: drawGuiContainerBackgroundLayer

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int mouseX, int mouseY) {
       GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
       this.mc.getTextureManager().bindTexture(textures);
       this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
       // weight
	drawIconBar(cat.getWeight(), EntityFatCat.WEIGHT_STATUS_MAX, 10, guiLeft + 70, guiTop + 22, xSize, 3*8, xSize+8, 3*8);
	// health
	drawIconBar(cat.getHealth(), cat.getMaxHealth(), 5, guiLeft + 70, guiTop + 46, xSize, 1*8, xSize+8, 1*8);
	// hunger
	drawIconBar(cat.getHunger(), EntityFatCat.HUNGER_MAX, 5, guiLeft + 130, guiTop + 46, xSize, 2*8, xSize+8, 2*8);
	// bladder
	drawIconBar(cat.getBladder(), EntityFatCat.BLADDER_MAX, 5, guiLeft + 70, guiTop + 68, xSize, 0*8, xSize+8, 0*8);
	// tiredness
	drawIconBar(cat.getTiredness(), EntityFatCat.TIREDNESS_MAX, 5, guiLeft + 130, guiTop + 68, xSize, 8*4, xSize+8, 8*4);
	// friendship
	drawIconBar(cat.getFriendship(), EntityFatCat.FRIENDSHIP_MAX, 5, guiLeft + 70, guiTop + 90, xSize, 8*5, xSize+8, 8*5);
	// loveness
	drawIconBar(cat.getLoveness(), EntityFatCat.FRIENDSHIP_MAX, 5, guiLeft + 130, guiTop + 90, xSize, 8*6, xSize+8, 8*6);
	
	
	// !! change scale in the following method, so we should put this at last !!
       GuiInventory.drawEntityOnScreen(guiLeft + 36, guiTop + 55, 30, guiLeft + 24 - mouseX, guiTop + 5 - mouseY, cat);
}
 
开发者ID:shu3,项目名称:FatCatMOD,代码行数:25,代码来源:GuiStatus.java

示例15: drawPages

import net.minecraft.client.gui.inventory.GuiInventory; //导入依赖的package包/类
public static void drawPages(FontRenderer renderer, int mouseX, int mouseY, int currentPage, CATEGORY currentCategory, GuiScreen gui)
{
    if (currentCategory == null)
    {
        drawCategoryModels();
    }
    if (currentCategory == CATEGORY.DINOS)
    {
        if (currentPage == 0)
        {
            /* Page 1 / 2*/
            GuiInventory.drawEntityOnScreen(getLeft() + 14, 90, 20, -350f, -5F, new EntityRaptor(Minecraft.getMinecraft().theWorld, 1));
            drawTitle(renderer, DINO_NAME.UTAHRAPTOR);
            drawDiet(renderer, getLeft() + 40, 135, DINO_NAME.UTAHRAPTOR, gui);
            drawSpecies(renderer, getLeft() + 15, 150, DINO_NAME.UTAHRAPTOR);
        }
        else if (currentPage == 2)
        {

        }
    }
}
 
开发者ID:Archiving,项目名称:ARKCraft-Code,代码行数:23,代码来源:BookDrawHandler.java


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