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


Java GuiScreenHorseInventory类代码示例

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


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

示例1: onGuiOpen

import net.minecraft.client.gui.inventory.GuiScreenHorseInventory; //导入依赖的package包/类
@SubscribeEvent
public void onGuiOpen(GuiOpenEvent event)
{
	GuiScreen gui = event.getGui();
	if(gui !=null && gui instanceof GuiScreenHorseInventory){
		GuiScreenHorseInventory horseGui = (GuiScreenHorseInventory)gui;
		EntityHorse horse = (EntityHorse)ReflectionUtils.getPrivateValue(horseGui, GuiScreenHorseInventory.class, ObfuscatedNames.GuiScreenHorseInventory_horseEntity);
		if(horse !=null && HorseAccessories.hasEnderChest(horse)){
			ContainerHorseChest animalchest = new ContainerHorseChest("HorseChest", 2);
			animalchest.setCustomName(horse.getName());
			event.setGui(new GuiHorseEnderChest(CrystalMod.proxy.getClientPlayer().inventory, animalchest, horse));
			PacketGuiMessage pkt = new PacketGuiMessage("Gui");
			pkt.setOpenGui(GuiHandler.GUI_ID_ENTITY, horse.getEntityId(), 0, 0);
			CrystalModNetwork.sendToServer(pkt);
		}
	}
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:18,代码来源:ClientEventHandler.java

示例2: guiPostInit

import net.minecraft.client.gui.inventory.GuiScreenHorseInventory; //导入依赖的package包/类
@SideOnly(value = Side.CLIENT)
@SubscribeEvent
public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) {
  GuiScreen gui = event.getGui();
  boolean showInvToggle = false;
  boolean showCraftToggle = false;
  if (gui instanceof GuiInventory || gui instanceof GuiPlayerExtended
      || gui instanceof GuiPlayerExtWorkbench
      || gui instanceof GuiScreenHorseInventory) {
    // gui left and top are private, so are the sizes
    int xSize = 176;
    int ySize = 166;
    int guiLeft = (gui.width - xSize) / 2;
    int guiTop = (gui.height - ySize) / 2;
    int x = 44 + guiLeft;
    int y = guiTop;
    EntityPlayer player = Minecraft.getMinecraft().player;
    final IPlayerExtendedProperties data = CapabilityRegistry.getPlayerProperties(player);
    showInvToggle = data.hasInventoryExtended();// && !(gui instanceof GuiPlayerExtWorkbench);
    showCraftToggle = data.hasInventoryCrafting();// && !(gui instanceof GuiPlayerExtended);
    if (event.getButtonList() == null) {
      event.setButtonList(new ArrayList<GuiButton>());
    }
    if (showInvToggle) {
      event.getButtonList().add(new ButtonTabToggleInventory(gui, x, y));
    }
    if (showCraftToggle) {
      event.getButtonList().add(new ButtonTabToggleCrafting(gui, x - 17, y));//the 17 is width + 2
    }
  }
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:32,代码来源:EventGuiInvoButtons.java

示例3: displayGUIHorse

import net.minecraft.client.gui.inventory.GuiScreenHorseInventory; //导入依赖的package包/类
public void displayGUIHorse(EntityHorse horse, IInventory horseInventory)
{
    this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, horseInventory, horse));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:EntityPlayerSP.java

示例4: displayGUIHorse

import net.minecraft.client.gui.inventory.GuiScreenHorseInventory; //导入依赖的package包/类
public void displayGUIHorse(EntityHorse horse, IInventory horseInventory) {
	this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, horseInventory, horse));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:4,代码来源:EntityPlayerSP.java

示例5: openGuiHorseInventory

import net.minecraft.client.gui.inventory.GuiScreenHorseInventory; //导入依赖的package包/类
public void openGuiHorseInventory(AbstractHorse horse, IInventory inventoryIn)
{
    this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, inventoryIn, horse));
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:5,代码来源:EntityPlayerSP.java

示例6: openGuiHorseInventory

import net.minecraft.client.gui.inventory.GuiScreenHorseInventory; //导入依赖的package包/类
public void openGuiHorseInventory(EntityHorse horse, IInventory inventoryIn)
{
    this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, inventoryIn, horse));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:EntityPlayerSP.java

示例7: displayGUIHorse

import net.minecraft.client.gui.inventory.GuiScreenHorseInventory; //导入依赖的package包/类
public void displayGUIHorse(EntityHorse par1EntityHorse, IInventory par2IInventory)
{
    this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, par2IInventory, par1EntityHorse));
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:5,代码来源:EntityPlayerSP.java

示例8: displayGUIHorse

import net.minecraft.client.gui.inventory.GuiScreenHorseInventory; //导入依赖的package包/类
public void displayGUIHorse(EntityHorse p_110298_1_, IInventory p_110298_2_)
{
    this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, p_110298_2_, p_110298_1_));
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:5,代码来源:EntityPlayerSP.java

示例9: func_110298_a

import net.minecraft.client.gui.inventory.GuiScreenHorseInventory; //导入依赖的package包/类
public void func_110298_a(EntityHorse p_110298_1_, IInventory p_110298_2_) {
   this.field_71159_c.func_71373_a(new GuiScreenHorseInventory(this.field_71071_by, p_110298_2_, p_110298_1_));
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:EntityPlayerSP.java


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