本文整理汇总了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);
}
}
}
示例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
}
}
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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_));
}
示例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_));
}