public void func_146101_a(TileEntityFurnace p_146101_1_) { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerFurnace(this.inventory, p_146101_1_)); if (container == null) { p_146101_1_.closeInventory(); // Cauldron - prevent chests from being stuck in open state on clients return; } // CraftBukkit end this.getNextWindowId(); this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 2, p_146101_1_.getInventoryName(), p_146101_1_.getSizeInventory(), p_146101_1_.hasCustomInventoryName())); this.openContainer = container; // CraftBukkit - Use container we passed to event this.openContainer.windowId = this.currentWindowId; this.openContainer.addCraftingToCrafters(this); }
@Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID == MINI_CHEST) { return new ContainerMiniChest(player.inventory, (TileEntityMiniChest) world.getTileEntity(new BlockPos(x, y, z))); } if(ID == COPPER_FURNACE) { return new ContainerFurnace(player.inventory, (TileEntityCopperFurnace) world.getTileEntity(new BlockPos(x, y, z))); } return null; }
public void func_146101_a(TileEntityFurnace p_146101_1_) { this.getNextWindowId(); this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 2, p_146101_1_.getInventoryName(), p_146101_1_.getSizeInventory(), p_146101_1_.isInventoryNameLocalized())); this.openContainer = new ContainerFurnace(this.inventory, p_146101_1_); this.openContainer.windowId = this.currentWindowId; this.openContainer.addCraftingToCrafters(this); }
public GuiKeypadFurnaceInventory(InventoryPlayer p_i1091_1_, TileEntityKeypadFurnace p_i1091_2_){ super(new ContainerFurnace(p_i1091_1_, p_i1091_2_)); tileFurnace = p_i1091_2_; if(new Random().nextInt(100) < 5) gurnace = true; }
public GuiKeypadFurnaceInventory(InventoryPlayer p_i1091_1_, TileEntityFurnace p_i1091_2_){ super(new ContainerFurnace(p_i1091_1_, p_i1091_2_)); tileFurnace = p_i1091_2_; if(new Random().nextInt(100) < 5) gurnace = true; }
public void func_146101_a(TileEntityFurnace p_146101_1_) { this.getNextWindowId(); this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 2, p_146101_1_.getInventoryName(), p_146101_1_.getSizeInventory(), p_146101_1_.hasCustomInventoryName())); this.openContainer = new ContainerFurnace(this.inventory, p_146101_1_); this.openContainer.windowId = this.currentWindowId; this.openContainer.addCraftingToCrafters(this); }
public void func_71042_a(TileEntityFurnace p_71042_1_) { this.func_71117_bO(); this.field_71135_a.func_72567_b(new Packet100OpenWindow(this.field_71139_cq, 2, p_71042_1_.func_70303_b(), p_71042_1_.func_70302_i_(), p_71042_1_.func_94042_c())); this.field_71070_bA = new ContainerFurnace(this.field_71071_by, p_71042_1_); this.field_71070_bA.field_75152_c = this.field_71139_cq; this.field_71070_bA.func_75132_a(this); }
/** * Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace */ public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace) { this.incrementWindowID(); this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 2, par1TileEntityFurnace.getInvName(), par1TileEntityFurnace.getSizeInventory(), par1TileEntityFurnace.isInvNameLocalized())); this.openContainer = new ContainerFurnace(this.inventory, par1TileEntityFurnace); this.openContainer.windowId = this.currentWindowId; this.openContainer.addCraftingToCrafters(this); }
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { return new ContainerFurnace(playerInventory, this); }
public GuiFurnace(InventoryPlayer playerInv, IInventory furnaceInv) { super(new ContainerFurnace(playerInv, furnaceInv)); this.playerInventory = playerInv; this.tileFurnace = furnaceInv; }
public static ItemStack transferStackInSlot(ContainerFurnace inv, EntityPlayer p_82846_1_, int p_82846_2_) { ItemStack itemstack = null; Slot slot = (Slot) inv.inventorySlots.get(p_82846_2_); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (p_82846_2_ == 2) { if (!mergeItemStack(inv, itemstack1, 3, 39, true)) { return null; } slot.onSlotChange(itemstack1, itemstack); } else if (p_82846_2_ != 1 && p_82846_2_ != 0) { // I have moved this check to the beginning if (TileEntityFurnace.isItemFuel(itemstack1)) { if (!mergeItemStack(inv, itemstack1, 1, 2, false)) { // Nest this inside so that if the above fails it will // attempt to do the input slot if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) { if (!mergeItemStack(inv, itemstack1, 0, 1, false)) { return null; } } } } else if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) { if (!mergeItemStack(inv, itemstack1, 0, 1, false)) { return null; } } else if (p_82846_2_ >= 3 && p_82846_2_ < 30) { if (!mergeItemStack(inv, itemstack1, 30, 39, false)) { return null; } } else if (p_82846_2_ >= 30 && p_82846_2_ < 39 && !mergeItemStack(inv, itemstack1, 3, 30, false)) { return null; } } else if (!mergeItemStack(inv, itemstack1, 3, 39, false)) { return null; } if (itemstack1.stackSize == 0) { slot.putStack((ItemStack) null); } else { slot.onSlotChanged(); } if (itemstack1.stackSize == itemstack.stackSize) { return null; } slot.onPickupFromSlot(p_82846_1_, itemstack1); } return itemstack; }
@Override public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { return new ContainerFurnace(playerInventory, this); }
public GuiFurnace(InventoryPlayer par1InventoryPlayer, TileEntityFurnace par2TileEntityFurnace) { super(new ContainerFurnace(par1InventoryPlayer, par2TileEntityFurnace)); this.field_147086_v = par2TileEntityFurnace; }