@SubscribeEvent public static void onEntityDeath(LivingDeathEvent event) { // if villager death drops are enabled, if the newly dead entity is a villager, and that villager was killed by a player... if ((ModConfiguration.enableDeathDrops) && (event.getEntityLiving() instanceof EntityVillager) && (event.getSource().getTrueSource() instanceof EntityPlayerMP)) { // iterate through the itemstacks in the villager's inventory InventoryBasic inventory = ((EntityVillager)event.getEntityLiving()).getVillagerInventory(); for (int i = 0; i < inventory.getSizeInventory(); i++) { // remove the stack from the inventory and spawn it in the world ItemStack stack = inventory.getStackInSlot(i); if (stack != ItemStack.EMPTY) { event.getEntityLiving().entityDropItem(stack, 0.0F); } } } }
/** * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. */ public void onInventoryChanged(InventoryBasic p_76316_1_) { int i = this.getHorseArmorIndexSynced(); boolean flag = this.isHorseSaddled(); this.updateHorseSlots(); if (this.ticksExisted > 20) { if (i == 0 && i != this.getHorseArmorIndexSynced()) { this.playSound("mob.horse.armor", 0.5F, 1.0F); } else if (i != this.getHorseArmorIndexSynced()) { this.playSound("mob.horse.armor", 0.5F, 1.0F); } if (!flag && this.isHorseSaddled()) { this.playSound("mob.horse.leather", 0.5F, 1.0F); } } }
public EntityVillager(World worldIn, int professionId) { super(worldIn); this.villagerInventory = new InventoryBasic("Items", false, 8); this.setProfession(professionId); this.setSize(0.6F, 1.8F); ((PathNavigateGround)this.getNavigator()).setBreakDoors(true); ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D)); this.tasks.addTask(1, new EntityAITradePlayer(this)); this.tasks.addTask(1, new EntityAILookAtTradePlayer(this)); this.tasks.addTask(2, new EntityAIMoveIndoors(this)); this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this)); this.tasks.addTask(4, new EntityAIOpenDoor(this, true)); this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); this.tasks.addTask(6, new EntityAIVillagerMate(this)); this.tasks.addTask(7, new EntityAIFollowGolem(this)); this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F)); this.tasks.addTask(9, new EntityAIVillagerInteract(this)); this.tasks.addTask(9, new EntityAIWander(this, 0.6D)); this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); this.setCanPickUpLoot(true); }
/** * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. */ public void onInventoryChanged(InventoryBasic invBasic) { HorseArmorType horsearmortype = this.getHorseArmorType(); boolean flag = this.isHorseSaddled(); this.updateHorseSlots(); if (this.ticksExisted > 20) { if (horsearmortype == HorseArmorType.NONE && horsearmortype != this.getHorseArmorType()) { this.playSound(SoundEvents.ENTITY_HORSE_ARMOR, 0.5F, 1.0F); } else if (horsearmortype != this.getHorseArmorType()) { this.playSound(SoundEvents.ENTITY_HORSE_ARMOR, 0.5F, 1.0F); } if (!flag && this.isHorseSaddled()) { this.playSound(SoundEvents.ENTITY_HORSE_SADDLE, 0.5F, 1.0F); } } }
public static NBTTagCompound writeInventoryBasicToNBT(final NBTTagCompound tag, final InventoryBasic inventoryBasic) { if (inventoryBasic.hasCustomInventoryName()) { tag.setString("CustomName", inventoryBasic.getInventoryName()); } final NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < inventoryBasic.getSizeInventory(); ++i) { final ItemStack stackInSlot = inventoryBasic.getStackInSlot(i); if (stackInSlot != null) { final NBTTagCompound itemTag = new NBTTagCompound(); itemTag.setByte("Slot", (byte)i); stackInSlot.writeToNBT(itemTag); nbttaglist.appendTag((NBTBase)itemTag); } } tag.setTag("Items", (NBTBase)nbttaglist); return tag; }
public TMultiPart convert(final World world, final BlockCoord pos) { final Block id = world.getBlock(pos.x, pos.y, pos.z); int meta = world.getBlockMetadata(pos.x, pos.y, pos.z); if (id != ExtraUtils.transferPipe && id != ExtraUtils.transferPipe2) { return null; } if (id == ExtraUtils.transferPipe2) { meta += 16; } if (meta != 9) { return (TMultiPart)new PipePart(meta); } if (world.getTileEntity(pos.x, pos.y, pos.z) instanceof TileEntityFilterPipe) { final InventoryBasic t = ((TileEntityFilterPipe)world.getTileEntity(pos.x, pos.y, pos.z)).items; return (TMultiPart)new FilterPipePart(t); } return (TMultiPart)new FilterPipePart(); }
private void createListOfItemsInExpandableBackpack() { if (!TombManyGraves.isExpandableBackpacksInstalled) { expandableBackpackItems = new ArrayList<>(); return; } NBTTagCompound tag = deathList.getTagCompound().getCompoundTag("ExpandableBackpack"); ItemStack stack = ItemStack.loadItemStackFromNBT(tag); if (stack == null || stack.stackSize == 0) { expandableBackpackItems = new ArrayList<>(); return; } IInventory inventory = new InventoryBasic("temp",false,1); inventory.setInventorySlotContents(0,stack); expandableBackpackItems = createListFromInventory(inventory, EXPANDABLE); }
private void createListOfItemsInEydamosBackpack() { if (!TombManyGraves.isEydamosBackpacksInstalled) { eydamosBackpackItems = new ArrayList<>(); return; } NBTTagCompound tag = deathList.getTagCompound().getCompoundTag("EydamosBackpack"); ItemStack stack = ItemStack.loadItemStackFromNBT(tag); if (stack == null || stack.stackSize == 0) { eydamosBackpackItems = new ArrayList<>(); return; } // BackpackSave instance = BackpackSave.loadBackpack(player.worldObj, stack, player, false); // // eydamosBackpackItems = createListFromInventory(instance, EYDAMOS); // return; IInventory inventory = new InventoryBasic("temp",false,1); inventory.setInventorySlotContents(0, stack); eydamosBackpackItems = createListFromInventory(inventory, EYDAMOS); }
/** * Writes an inventory to an NBTTagCompound. Can be used to save an inventory in a * TileEntity, or perhaps an ItemStack. * * @param tag: The NBTTagCompound to write the inventory to. * @param inventory: The inventory to write to the NBTTagCompound. * @return NBTTagCompound: The same NBTTagCompound that was passed to this method. */ public static NBTTagCompound writeInventoryToNBT (NBTTagCompound tag, InventoryBasic inventory) { if (inventory.hasCustomName()) tag.setString("CustomName", inventory.getName()); final NBTTagList nbttaglist = new NBTTagList(); for (int slotCount = 0; slotCount < inventory.getSizeInventory(); slotCount++) { final ItemStack stackInSlot = inventory.getStackInSlot(slotCount); if (stackInSlot != null) { final NBTTagCompound itemTag = new NBTTagCompound(); itemTag.setByte("Slot", (byte) slotCount); stackInSlot.writeToNBT(itemTag); nbttaglist.appendTag(itemTag); } } tag.setTag("Items", nbttaglist); return tag; }
public ContainerStorageCore(EntityPlayer player, World world, int x, int y, int z) { this.tileEntity = ((TileEntityStorageCore) world.getTileEntity(new BlockPos(x, y, z))); int startingY = 18; int startingX = 8; // the EZStorage slots IInventory inventory = new InventoryBasic("title", false, this.rowCount() * 9); for (int i = 0; i < this.rowCount(); i++) { for (int j = 0; j < 9; j++) { addSlotToContainer(new Slot(inventory, j + i * 9, startingX + j * 18, startingY + i * 18)); } } // the player inventory bindPlayerInventory(player.inventory); }
public void addPlayerSlots(InventoryPlayer player) { for (int i = 0; i < 3; ++i) { for (int j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(player, j + i * 9 + 9, 8 + j * 18, 51 + i * 18)); } } for (int i = 0; i < 9; ++i) this.addSlotToContainer(new Slot(player, i, 8 + i * 18, 109)); IInventory tableInventory = new InventoryBasic("Trash", false, 1) { public void setInventorySlotContents(int index, ItemStack stack) { } }; this.addSlotToContainer(new Slot(tableInventory, 0, 80, 20)); }
/** * Writes an inventory to an NBTTagCompound. Can be used to save an inventory in a * TileEntity, or perhaps an ItemStack. * * @param tag: The NBTTagCompound to write the inventory to. * @param inventory: The inventory to write to the NBTTagCompound. * @return NBTTagCompound: The same NBTTagCompound that was passed to this method. */ public static NBTTagCompound writeInventoryToNBT (NBTTagCompound tag, InventoryBasic inventory) { if (inventory.hasCustomName()) { tag.setString("CustomName", inventory.getName()); } final NBTTagList nbttaglist = new NBTTagList(); for (int slotCount = 0; slotCount < inventory.getSizeInventory(); slotCount++) { final ItemStack stackInSlot = inventory.getStackInSlot(slotCount); if (!stackInSlot.isEmpty()) { final NBTTagCompound itemTag = new NBTTagCompound(); itemTag.setByte("Slot", (byte) slotCount); stackInSlot.writeToNBT(itemTag); nbttaglist.appendTag(itemTag); } } tag.setTag("Items", nbttaglist); return tag; }
/** * Reads an inventory from an NBTTagCompound. Can be used to load an Inventory from a * TileEntity or perhaps an ItemStak. * * @param tag: The NBTTagCompound to read the inventory data from. * @param inventory: The inventory to set all of the inventory data to. * @return InventoryBasic: The same instance of InventoryBasic that was passed to this * method. */ public static InventoryBasic readInventoryFromNBT (NBTTagCompound tag, InventoryBasic inventory) { if (tag.hasKey("CustomName", 8)) { inventory.setCustomName(tag.getString("CustomName")); } final NBTTagList items = tag.getTagList("Items", 10); for (int storedCount = 0; storedCount < items.tagCount(); storedCount++) { final NBTTagCompound itemTag = items.getCompoundTagAt(storedCount); final int slotCount = itemTag.getByte("Slot") & 0xFF; if (slotCount >= 0 && slotCount < inventory.getSizeInventory()) { inventory.setInventorySlotContents(slotCount, new ItemStack(itemTag)); } } return inventory; }
/** * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. */ public void onInventoryChanged(InventoryBasic par1InventoryBasic) { int var2 = this.func_110241_cb(); boolean var3 = this.isHorseSaddled(); this.func_110232_cE(); if (this.ticksExisted > 20) { if (var2 == 0 && var2 != this.func_110241_cb()) { this.playSound("mob.horse.armor", 0.5F, 1.0F); } else if (var2 != this.func_110241_cb()) { this.playSound("mob.horse.armor", 0.5F, 1.0F); } if (!var3 && this.isHorseSaddled()) { this.playSound("mob.horse.leather", 0.5F, 1.0F); } } }
public EntityGreenVillager(World worldIn, int professionId) { super(worldIn); this.villagerInventory = new InventoryBasic("Items", false, 8); this.setProfession(professionId); this.setSize(0.6F, 1.8F); ((PathNavigateGround)this.getNavigator()).setBreakDoors(true); ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D)); this.tasks.addTask(1, new EntityAITradeGreen(this)); this.tasks.addTask(1, new EntityAILookAtTradeGreen(this)); this.tasks.addTask(2, new EntityAIMoveIndoors(this)); this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this)); this.tasks.addTask(4, new EntityAIOpenDoor(this, true)); this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F)); this.tasks.addTask(9, new EntityAIWander(this, 0.6D)); this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); this.setCanPickUpLoot(true); }
public EntityPigman(World worldIn, int professionId) { super(worldIn); this.villagerInventory = new InventoryBasic("Items", false, 8); this.setProfession(professionId); this.setSize(0.6F, 1.8F); ((PathNavigateGround)this.getNavigator()).setBreakDoors(true); ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D)); this.tasks.addTask(1, new EntityAITradePigman(this)); this.tasks.addTask(1, new EntityAILookAtTradePigman(this)); this.tasks.addTask(2, new EntityAIMoveIndoors(this)); this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this)); this.tasks.addTask(4, new EntityAIOpenDoor(this, true)); this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); this.tasks.addTask(6, new EntityAIPigmanMate(this)); this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F)); this.tasks.addTask(9, new EntityAIWander(this, 0.6D)); this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); this.setCanPickUpLoot(true); }
public int countPossibleRecipes(IInventory inventory) { InventoryBasic basic = new InventoryBasic("basic", false, inventory.getSizeInventory()); for (int i = 0; i < basic.getSizeInventory(); i++) if(inventory.getStackInSlot(i) != null) basic.setInventorySlotContents(i, inventory.getStackInSlot(i).copy()); searched.clear(); ArrayList<RecipeOverflow> overflow = new ArrayList<RecipeOverflow>(); int ammount = 0; ConsumeResult result = consumeRecipe(basic, input, overflow, new SearchLimiter()); while(result != null) { overflow.addAll(result.overflow); ammount++; result = consumeRecipe(basic, input, overflow, new SearchLimiter()); searched.clear(); } searched.clear(); return ammount; }
public ContainerCrafter(EntityPlayer player, TileCrafter inventory) { super(player, inventory, 140); this.crafter = inventory; for (int x = 0; x < 3; x++) { for (int y = 0; y < 3; y++) { addSlotToContainer(new SlotRO(inventory.craftingInv, x + y * 3, 30 + x * 18, 17 + y * 18)); } } addSlotToContainer(craftResult = new SlotRO(new InventoryBasic("", false, 1), 0, 124, 35)); for (int x = 0; x < 9; x++) { for (int y = 0; y < 2; y++) { addSlotToContainer(new Slot(crafter, x + y * 9, 8 + x * 18, 90 + y * 18)); } } }
/** * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. */ @Override public void onInventoryChanged(InventoryBasic par1InventoryBasic) { int i = this.func_110241_cb(); boolean flag = this.isHorseSaddled(); this.func_110232_cE(); if (this.ticksExisted > 20) { if (i == 0 && i != this.func_110241_cb()) { this.playSound("mob.horse.armor", 0.5F, 1.0F); } else if (i != this.func_110241_cb()) { this.playSound("mob.horse.armor", 0.5F, 1.0F); } if (!flag && this.isHorseSaddled()) { this.playSound("mob.horse.leather", 0.5F, 1.0F); } } }
public ContainerCrafter(EntityPlayer player, TileComputerCrafter inventory) { super(inventory); crafter = inventory; // the crafting grid for (int row = 0; row < 3; ++row) { for (int col = 0; col < 3; ++col) { addSlotToContainer(new SlotReadOnly(inventory.craftingInv, col + row * 3, 30 + col * 18, 17 + row * 18)); } } // the TE inventory for (int row = 0; row < 2; ++row) { for (int col = 0; col < 9; ++col) { addSlotToContainer(new Slot(crafter, col + row * 9, 8 + col * 18, 90 + row * 18)); } } // the fake output slot is so fake that it's not even stored in the TE addSlotToContainer(craftResult = new SlotReadOnly(new InventoryBasic("", false, 1), 0, 124, 35)); bindPlayerInventory(player.inventory, 140); }
public void onInventoryChanged(InventoryBasic p_76316_1_) { int i = this.func_110241_cb(); boolean flag = this.isHorseSaddled(); this.func_110232_cE(); if (this.ticksExisted > 20) { if (i == 0 && i != this.func_110241_cb()) { this.playSound("mob.horse.armor", 0.5F, 1.0F); } else if (i != this.func_110241_cb()) { this.playSound("mob.horse.armor", 0.5F, 1.0F); } if (!flag && this.isHorseSaddled()) { this.playSound("mob.horse.leather", 0.5F, 1.0F); } } }
private boolean shouldMineBlock(Block block, int x, int y, int z) { if (block instanceof BlockOre || block instanceof BlockRedstoneOre) { InventoryBasic minerInventory = this.miner.inventory; if (InventoryUtils.hasRoomInInventory(minerInventory)) { return true; } else { World world = this.miner.worldObj; ArrayList<ItemStack> items = block.getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0); for (ItemStack item : items) { if (InventoryUtils.canFitItem(item, minerInventory)) { return true; } } } } return false; }
public static void addToInventory(ItemStack itemStack, InventoryBasic inventory) { if (itemStack != null && itemStack.stackSize != 0 && itemStack.getItem() != null) { int emptySlot = getFirstEmptyStack(inventory); if (itemStack.isItemDamaged()) { if (emptySlot > -1) { inventory.setInventorySlotContents(emptySlot, itemStack); } } else { int compatibleSlot = getExistingCompatibleStack(itemStack, inventory); if (compatibleSlot > -1) { ItemStack existingStack = inventory.getStackInSlot(compatibleSlot); existingStack.stackSize += itemStack.stackSize; } else if (emptySlot > -1) { inventory.setInventorySlotContents(emptySlot, itemStack); } } } }
/** * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. */ public void onInventoryChanged(InventoryBasic par1InventoryBasic) { int i = this.func_110241_cb(); boolean flag = this.isHorseSaddled(); this.func_110232_cE(); if (this.ticksExisted > 20) { if (i == 0 && i != this.func_110241_cb()) { this.playSound("mob.horse.armor", 0.5F, 1.0F); } if (!flag && this.isHorseSaddled()) { this.playSound("mob.horse.leather", 0.5F, 1.0F); } } }
public ContainerShopSell(InventoryPlayer inventoryPlayer) { this.invPlayer = inventoryPlayer; // Assign trade slots: invSelling = new InventoryBasic("Selling", false, 1); addSlotToContainer(new Slot(invSelling, 0, 20, 45)); // Assign player's inventory: int i; for (i = 0; i < 3; ++i) { for (int j = 0; j < 9; ++j) { addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, PLAYER_INV_X + j * 18, PLAYER_INV_Y + i * 18)); } } for (i = 0; i < 9; ++i) { addSlotToContainer(new Slot(inventoryPlayer, i, PLAYER_INV_X + i * 18, 58 + PLAYER_INV_Y)); } }
private static void dropInventory(List<EntityItem> drops, EntityVillager villager) { // 村人自身のインベントリの内容をドロップ // InventoryBasicもIterableにしてくれ~ InventoryBasic inv = villager.getVillagerInventory(); final int invElements = inv.getSizeInventory(); for(int i = 0; i < invElements; i++) { // スロットごとにItemStackがないか確認 ItemStack stack = inv.getStackInSlot(i); if(stack == null) { continue; } // ItemStackがあればそれをドロップアイテムとして登録 EntityItem entityDropItem = new EntityItem(villager.world, villager.posX, villager.posY + 1, villager.posZ, stack); drops.add(entityDropItem); } }
public ContainerVillagerInventory(IInventory playerInventory, final InventoryBasic villagerInventoryIn, final EntityVillager villager, EntityPlayer player) { this.villagerInventory = villagerInventoryIn; this.villager = villager; this.villagerInventory.setCustomName(this.villager.getDisplayName().getUnformattedText()); villagerInventoryIn.openInventory(player); // villager inventory slots int offsetX = 17; int offsetY = 20; for (int col = 0; col < 8; col++) { this.addSlotToContainer(new Slot(villagerInventoryIn, col, offsetX + col * 18, offsetY)); } // player inventory offsetX = 8; offsetY = 51; for (int row = 0; row < 3; row++) { for (int col = 0; col < 9; col++) { this.addSlotToContainer(new Slot(playerInventory, col + row * 9 + 9, offsetX + col * 18, offsetY + row * 18)); } } // player hotbar inventory offsetY = 109; for (int col = 0; col < 9; col++) { this.addSlotToContainer(new Slot(playerInventory, col, offsetX + col * 18, offsetY)); } }
public GuiVillagerInventory(InventoryPlayer playerInv, InventoryBasic villagerInv, EntityVillager villager) { super(new ContainerVillagerInventory(playerInv, villagerInv, villager, playerInv.player)); this.playerInventory = playerInv; this.villagerInventory = villagerInv; this.villagerEntity = villager; this.allowUserInput = false; this.ySize = 133; }
/** * Displays a GUI by ID. In order starting from id 0: Chest, Workbench, Furnace, Dispenser, Enchanting table, * Brewing stand, Villager merchant, Beacon, Anvil, Hopper, Dropper, Horse */ public void handleOpenWindow(S2DPacketOpenWindow packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); EntityPlayerSP entityplayersp = this.gameController.thePlayer; if ("minecraft:container".equals(packetIn.getGuiId())) { entityplayersp.displayGUIChest(new InventoryBasic(packetIn.getWindowTitle(), packetIn.getSlotCount())); entityplayersp.openContainer.windowId = packetIn.getWindowId(); } else if ("minecraft:villager".equals(packetIn.getGuiId())) { entityplayersp.displayVillagerTradeGui(new NpcMerchant(entityplayersp, packetIn.getWindowTitle())); entityplayersp.openContainer.windowId = packetIn.getWindowId(); } else if ("EntityHorse".equals(packetIn.getGuiId())) { Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId()); if (entity instanceof EntityHorse) { entityplayersp.displayGUIHorse((EntityHorse)entity, new AnimalChest(packetIn.getWindowTitle(), packetIn.getSlotCount())); entityplayersp.openContainer.windowId = packetIn.getWindowId(); } } else if (!packetIn.hasSlots()) { entityplayersp.displayGui(new LocalBlockIntercommunication(packetIn.getGuiId(), packetIn.getWindowTitle())); entityplayersp.openContainer.windowId = packetIn.getWindowId(); } else { ContainerLocalMenu containerlocalmenu = new ContainerLocalMenu(packetIn.getGuiId(), packetIn.getWindowTitle(), packetIn.getSlotCount()); entityplayersp.displayGUIChest(containerlocalmenu); entityplayersp.openContainer.windowId = packetIn.getWindowId(); } }
/** * Displays a GUI by ID. In order starting from id 0: Chest, Workbench, Furnace, * Dispenser, Enchanting table, Brewing stand, Villager merchant, Beacon, Anvil, * Hopper, Dropper, Horse */ public void handleOpenWindow(S2DPacketOpenWindow packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); EntityPlayerSP entityplayersp = this.gameController.thePlayer; if ("minecraft:container".equals(packetIn.getGuiId())) { entityplayersp.displayGUIChest(new InventoryBasic(packetIn.getWindowTitle(), packetIn.getSlotCount())); entityplayersp.openContainer.windowId = packetIn.getWindowId(); } else if ("minecraft:villager".equals(packetIn.getGuiId())) { entityplayersp.displayVillagerTradeGui(new NpcMerchant(entityplayersp, packetIn.getWindowTitle())); entityplayersp.openContainer.windowId = packetIn.getWindowId(); } else if ("EntityHorse".equals(packetIn.getGuiId())) { Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId()); if (entity instanceof EntityHorse) { entityplayersp.displayGUIHorse((EntityHorse) entity, new AnimalChest(packetIn.getWindowTitle(), packetIn.getSlotCount())); entityplayersp.openContainer.windowId = packetIn.getWindowId(); } } else if (!packetIn.hasSlots()) { entityplayersp.displayGui(new LocalBlockIntercommunication(packetIn.getGuiId(), packetIn.getWindowTitle())); entityplayersp.openContainer.windowId = packetIn.getWindowId(); } else { ContainerLocalMenu containerlocalmenu = new ContainerLocalMenu(packetIn.getGuiId(), packetIn.getWindowTitle(), packetIn.getSlotCount()); entityplayersp.displayGUIChest(containerlocalmenu); entityplayersp.openContainer.windowId = packetIn.getWindowId(); } }