public CraftiniumTableContainer(InventoryPlayer playerInventory, World world, BlockPos table) { this.world = world; this.table = table; this.matrix = new InventoryCrafting(this, 3, 3); this.craftResult = new InventoryCraftResult(); this.player = playerInventory.player; this.addSlotToContainer(new CraftiniumSlotCrafting(playerInventory.player, this.matrix, this.craftResult, 0, 124, 35, this.table)); for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { this.addSlotToContainer(new Slot(this.matrix, j + i * 3, 30 + j * 18, 17 + i * 18)); } } for (int k = 0; k < 3; ++k) { for (int i1 = 0; i1 < 9; ++i1) { this.addSlotToContainer(new Slot(playerInventory, i1 + k * 9 + 9, 8 + i1 * 18, 84 + k * 18)); } } for (int l = 0; l < 9; ++l) { this.addSlotToContainer(new Slot(playerInventory, l, 8 + l * 18, 142)); } this.onCraftMatrixChanged(this.matrix); }
public EntitySheep(World p_i1691_1_) { super(p_i1691_1_); this.setSize(0.9F, 1.3F); this.getNavigator().setAvoidsWater(true); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIPanic(this, 1.25D)); this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); this.tasks.addTask(3, new EntityAITempt(this, 1.1D, Items.wheat, false)); this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); this.tasks.addTask(5, this.field_146087_bs); this.tasks.addTask(6, new EntityAIWander(this, 1.0D)); this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); this.field_90016_e.setInventorySlotContents(0, new ItemStack(Items.dye, 1, 0)); this.field_90016_e.setInventorySlotContents(1, new ItemStack(Items.dye, 1, 0)); this.field_90016_e.resultInventory = new InventoryCraftResult(); // CraftBukkit - add result slot for event }
public ContainerWorkbench(EntityPlayer player, TileEntityWorkbench tile) { this.player = player; workbench = tile; workbench.container = this; craftMatrix = new InventoryCraftMatrix(this, 3, 3, "container.crafting"); craftResult = new InventoryCraftResult(); addSlotToContainer(new SlotTool(workbench, 0, 15, 17, 13)); addSlotToContainer(new SlotTool(workbench, 1, 15, 53, 15)); addSlotToContainer(new SlotCraftingTools(player, this, craftMatrix, craftResult, 0, 138, 35)); for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { addSlotToContainer(new Slot(craftMatrix, i + j * 3, 44 + i * 18, 17 + j * 18)); } } addInventoryPlayer(player.inventory, 8, 84); onCraftMatrixChanged(craftMatrix); }
protected void bindLocalInventory() { this.craftMatrix = new InventorySubCraft(this, (TileEntityWorkBench) this.customInventory); this.craftResult = new InventoryCraftResult(); // Crafting Matrix for (int row = 0; row < 3; ++row) { for (int column = 0; column < 3; ++column) { this.addSlotToContainer(new Slot(this.craftMatrix, column + row * 3, 48 + column * 18, 18 + row * 18)); } } // Plan slot this.addSlotToContainer(new SlotPlan(new InventorySubUpdate(this, this.customInventory, 9, 1), 0, 17, 36)); // Craft slot - Source inventories this.bindCraftingInventory(); // Bench inventory for (int row = 0; row < 2; ++row) { for (int column = 0; column < 9; ++column) { int slotIndex = column + (row * 9); this.addSlotToContainer(new Slot(new InventorySubUpdate(this, this.customInventory, 10, 18), slotIndex, 8 + column * 18, row * 18 + 90)); } } }
public ContainerScentBurner(InventoryPlayer inventory, TileEntity tileEntityBurner) { this.burner = (TileEntityScentBurner) tileEntityBurner; craftMatrix = new InventoryCrafting(this, 4, 4); craftResult = new InventoryCraftResult(); worldObj = burner.worldObj; posX = burner.xCoord; posY = burner.yCoord; posZ = burner.zCoord; this.addSlotToContainer(new Slot(burner, 0, 80, 17)); this.addSlotToContainer(new Slot(burner, 1, 80, 53)); int i; for (i = 0; i < 3; ++i) { for (int j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); } }
public ContainerTectoCrafter(InventoryPlayer invPlayer, World world, int x, int y, int z) { craftMatrix = new InventoryCrafting(this, 5, 5); craftResult = new InventoryCraftResult(); worldObj = world; posX = x; posY = y; posZ = z; // Output slot this.addSlotToContainer(new SlotCrafting(invPlayer.player, craftMatrix, craftResult, 0, 141, 36)); // 5x5 Crafting Area for(int i = 0; i < 5; i++) { for(int j = 0; j < 5; j++) { this.addSlotToContainer(new Slot(craftMatrix, j + i * 5, 10 + j * 18, 18 + i * 18)); } } // Player Inventory for(int i = 0; i < 3; i++) { for(int j = 0; j < 9; j++) { this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 116 + i * 18)); } } // Hotbar for(int i = 0; i < 9; i++) { this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 174)); } onCraftMatrixChanged(craftMatrix); }
public ContainerCarpenter(TileMachine tile) { super(((MachineCarpenter) tile.machine).getInternalInventory(), tile, tile.getSizeInventory()); craftMatrix = new InventoryCraftingAuto(this, 3, 3); craftResult = new InventoryCraftResult(); MachineCarpenter carpenter = (MachineCarpenter) tile.machine; GenericInventoryAdapter internal = carpenter.getInternalInventory(); // Update crafting matrix with current contents of tileentity. for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { craftMatrix.setInventorySlotContents(i, internal.getStackInSlot(i)); } }
public ContainerAnvil(EntityPlayer player, TileEntityAnvil anvil, boolean isRepair) { this.player = player; this.anvil = anvil; this.isRepair = isRepair; anvil.inventory.container = this; craftResult = new InventoryCraftResult(); addSlotToContainer(new SlotTool(anvil.inventory, 0, 142, 98, 13)); if(isRepair) { repairMatrix = new InventoryBasic(this, 2, "container.anvil"); addSlotToContainer(new SlotItemExtends(repairMatrix, 0, 22, 63, ItemTool.class, ItemArmor.class)); addSlotToContainer(new Slot(repairMatrix, 1, 68, 63)); addSlotToContainer(new SlotCraftingTools(player, this, repairMatrix, craftResult, 0, 142, 63)); } else { craftMatrix = new InventoryCraftMatrix(this, 5, 5, "container.anvil"); addSlotToContainer(new SlotCraftingTools(player, this, craftMatrix, craftResult, 0, 142, 63)); for(int i = 0; i < 5; i++) { for(int j = 0; j < 5; j++) { addSlotToContainer(new Slot(craftMatrix, i + j * 5, 8 + i * 18, 26 + j * 18)); } } } addInventoryPlayer(player.inventory, 8, 122); if(isRepair) { onCraftMatrixChanged(repairMatrix); } else { onCraftMatrixChanged(craftMatrix); } }
public ContainerSewing(InventoryPlayer inventory, TileEntity sewing) { Sewing = (TileEntitySewing) sewing; craftMatrix = new InventoryCrafting(this, 4, 4); craftResult = new InventoryCraftResult(); worldObj = sewing.worldObj; posX = sewing.xCoord; posY = sewing.yCoord; posZ = sewing.zCoord; int var3; for (var3 = 0; var3 < 3; ++var3) { for (int var4 = 0; var4 < 9; ++var4) { this.addSlotToContainer(new Slot(inventory, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); } } for (var3 = 0; var3 < 9; ++var3) { this.addSlotToContainer(new Slot(inventory, var3, 8 + var3 * 18, 142)); } for (int x = 0; x < 4; x++) { for (int y = 0; y < 4; y++) { addSlotToContainer(new Slot(craftMatrix, y + x * 4, 8 + y * 18, 8 + x * 18)); } } addSlotToContainer(new SlotSewingRequirements(Sewing, 0, 95, 17, this)); // needle addSlotToContainer(new SlotSewingRequirements(Sewing, 1, 95, 54, this)); // string addSlotToContainer(new SlotSewing(inventory.player, craftMatrix, craftResult, sewing, this, 0, 145, 35)); onCraftMatrixChanged(craftMatrix); }
@Override public InventoryCraftResult getCraftingResult() { return result; }
public InventoryCraftResult getResult() { return result; }
public ContainerCrystalWorkbench(final InventoryPlayer playerInventory, World worldIn, TileEntityCrystalWorkbench tile) { this.worldObj = worldIn; bench = tile; this.pos = tile.getPos(); craftResult = new InventoryCraftResult(); craftMatrix = new InventoryCraftingPersistent(this, tile, 3, 3); this.addSlotToContainer(new SlotCrafting(playerInventory.player, this.craftMatrix, this.craftResult, 0, 124, 35){ @Override public ItemStack onTake(EntityPlayer playerIn, ItemStack stack) { //net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, craftMatrix); this.onCrafting(stack); //net.minecraftforge.common.ForgeHooks.setCraftingPlayer(playerIn); NonNullList<ItemStack> aitemstack = CrystalCraftingManager.getInstance().getRemainingItems(craftMatrix, playerIn.getEntityWorld()); //net.minecraftforge.common.ForgeHooks.setCraftingPlayer(null); for (int i = 0; i < aitemstack.size(); ++i) { ItemStack itemstack = craftMatrix.getStackInSlot(i); ItemStack itemstack1 = aitemstack.get(i); if (!ItemStackTools.isNullStack(itemstack)) { craftMatrix.decrStackSize(i, 1); } if (!ItemStackTools.isNullStack(itemstack1)) { if (ItemStackTools.isNullStack(craftMatrix.getStackInSlot(i))) { craftMatrix.setInventorySlotContents(i, itemstack1); } else if (!playerInventory.player.inventory.addItemStackToInventory(itemstack1)) { playerInventory.player.dropItem(itemstack1, false); } } } return stack; } }); for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 3, 30 + j * 18, 17 + i * 18)); } } for (int k = 0; k < 3; ++k) { for (int i1 = 0; i1 < 9; ++i1) { this.addSlotToContainer(new Slot(playerInventory, i1 + k * 9 + 9, 8 + i1 * 18, 84 + k * 18)); } } for (int l = 0; l < 9; ++l) { this.addSlotToContainer(new Slot(playerInventory, l, 8 + l * 18, 142)); } this.onCraftMatrixChanged(this.craftMatrix); }
public ContainerBetterTable(InventoryPlayer inventoryplayer, TileEntityDeviceCraftingTable tileEntity, World world, int i, int j, int k) { craftMatrix = new SchematicCrafting(this, tileEntity, 5, 5); craftResult = new InventoryCraftResult(); schematicSlot = new InventoryBasic("schematicSlot", false, 1); worldObj = world; posX = i; posY = j; posZ = k; // crafting grid for (int page = 0; page < 5; page++) for (int l = 0; l < 5; l++) { for (int k1 = 0; k1 < 5; k1++) { this.addDualSlotToContainer(new ActiveSlot(craftMatrix, k1 + l * 5 + page * 25, 8 + k1 * 18, 18 + l * 18, page == 0)); // active if first page } } // slot for the skematics this.addSlotToContainer(new Slot(schematicSlot, 0, 131, 56)); // output slot this.addSlotToContainer(new SlotCrafting(inventoryplayer.player, craftMatrix, craftResult, 0, 131, 94)); // player inventory for (int i1 = 0; i1 < 3; i1++) { for (int l1 = 0; l1 < 9; l1++) { this.addSlotToContainer(new Slot(inventoryplayer, l1 + i1 * 9 + 9, 8 + l1 * 18, 94 + 21 + i1 * 18)); } } for (int j1 = 0; j1 < 9; j1++) { this.addSlotToContainer(new Slot(inventoryplayer, j1, 8 + j1 * 18, 148 + 25)); } // System.out.println("active: " + this.activeInventorySlots.size()); // System.out.println("slots: " + this.inventorySlots.size()); setActivePage(1); onCraftMatrixChanged(craftMatrix); // System.out.println("active: " + this.activeInventorySlots.size()); // System.out.println("slots: " + this.inventorySlots.size()); }
public ContainerCarpenter(InventoryPlayer inventoryplayer, TileMachine tile) { super(((MachineCarpenter) tile.machine).getInternalInventory(), tile, tile.getSizeInventory() + 1); // + 1 is for the // SlotProductDisplay machine = (MachineCarpenter) tile.machine; machine.activeContainer = this; internalInventory = machine.getInternalInventory(); craftMatrix = new InventoryCraftingAuto(this, 3, 3); craftResult = new InventoryCraftResult(); // Internal inventory for (int i = 0; i < 2; i++) { for (int k = 0; k < 9; k++) { addSlot(new Slot(internalInventory, MachineCarpenter.SLOT_INVENTORY_1 + k + i * 9, 8 + k * 18, 90 + i * 18)); } } // Liquid Input this.addSlot(new SlotLiquidContainer(internalInventory, MachineCarpenter.SLOT_CAN_INPUT, 120, 20)); // Boxes this.addSlot(new SlotCraftAuto(this, internalInventory, MachineCarpenter.SLOT_BOX, 83, 20)); // Product this.addSlot(new Slot(internalInventory, MachineCarpenter.SLOT_PRODUCT, 120, 56)); // CraftResult display addSlot(new SlotLocked(craftResult, 0, 80, 51)); // Crafting matrix for (int l = 0; l < 3; l++) { for (int k1 = 0; k1 < 3; k1++) { addSlot(new SlotCraftMatrix(this, internalInventory, k1 + l * 3, 10 + k1 * 18, 20 + l * 18)); } } // Player inventory for (int i1 = 0; i1 < 3; i1++) { for (int l1 = 0; l1 < 9; l1++) { addSlot(new Slot(inventoryplayer, l1 + i1 * 9 + 9, 8 + l1 * 18, 136 + i1 * 18)); } } // Player hotbar for (int j1 = 0; j1 < 9; j1++) { addSlot(new Slot(inventoryplayer, j1, 8 + j1 * 18, 194)); } // Update crafting matrix with current contents of tileentity. for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { craftMatrix.setInventorySlotContents(i, internalInventory.getStackInSlot(i)); } }