mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 20:42:35 +00:00
Simple Cleanup
This commit is contained in:
1 parent
09df969bcf
commit
e2fff11ea8
141 files changed
+545
-859
No files matched your search
@@ -25,19 +25,19 @@ public class ContainerBottler extends ContainerLiquidTanks {
|
||||
super(tile, tile);
|
||||
|
||||
this.tile = tile;
|
||||
this.addSlot(new SlotLiquidContainer(tile, MachineBottler.SLOT_RESOURCE, 116, 19, true));
|
||||
this.addSlot(new SlotClosed(tile, MachineBottler.SLOT_PRODUCT, 116, 55));
|
||||
this.addSlot(new SlotLiquidContainer(tile, MachineBottler.SLOT_CAN, 26, 38));
|
||||
this.addSlotToContainer(new SlotLiquidContainer(tile, MachineBottler.SLOT_RESOURCE, 116, 19, true));
|
||||
this.addSlotToContainer(new SlotClosed(tile, MachineBottler.SLOT_PRODUCT, 116, 55));
|
||||
this.addSlotToContainer(new SlotLiquidContainer(tile, MachineBottler.SLOT_CAN, 26, 38));
|
||||
|
||||
int var3;
|
||||
for (var3 = 0; var3 < 3; ++var3) {
|
||||
for (int var4 = 0; var4 < 9; ++var4) {
|
||||
this.addSlot(new Slot(player, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
|
||||
this.addSlotToContainer(new Slot(player, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (var3 = 0; var3 < 9; ++var3) {
|
||||
this.addSlot(new Slot(player, var3, 8 + var3 * 18, 142));
|
||||
this.addSlotToContainer(new Slot(player, var3, 8 + var3 * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +40,6 @@ public class ContainerCarpenter extends ContainerLiquidTanks implements IContain
|
||||
}
|
||||
private MachineCarpenter machine;
|
||||
private final IInventory craftingInventory;
|
||||
private IInventory internalInventory;
|
||||
public final InventoryCraftingAuto craftMatrix;
|
||||
public final InventoryCraftResult craftResult;
|
||||
|
||||
@@ -50,7 +49,7 @@ public class ContainerCarpenter extends ContainerLiquidTanks implements IContain
|
||||
machine = tile;
|
||||
machine.activeContainer = this;
|
||||
craftingInventory = machine.getCraftingInventory();
|
||||
internalInventory = machine.getInternalInventory();
|
||||
IInventory internalInventory = machine.getInternalInventory();
|
||||
|
||||
craftMatrix = new InventoryCraftingAuto(this, 3, 3);
|
||||
craftResult = new InventoryCraftResult();
|
||||
@@ -58,36 +57,36 @@ public class ContainerCarpenter extends ContainerLiquidTanks implements IContain
|
||||
// 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));
|
||||
addSlotToContainer(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));
|
||||
this.addSlotToContainer(new SlotLiquidContainer(internalInventory, MachineCarpenter.SLOT_CAN_INPUT, 120, 20));
|
||||
// Boxes
|
||||
this.addSlot(new SlotCrate(this, internalInventory, MachineCarpenter.SLOT_BOX, 83, 20));
|
||||
this.addSlotToContainer(new SlotCrate(this, internalInventory, MachineCarpenter.SLOT_BOX, 83, 20));
|
||||
// Product
|
||||
this.addSlot(new SlotOutput(internalInventory, MachineCarpenter.SLOT_PRODUCT, 120, 56));
|
||||
this.addSlotToContainer(new SlotOutput(internalInventory, MachineCarpenter.SLOT_PRODUCT, 120, 56));
|
||||
|
||||
// CraftResult display
|
||||
addSlot(new SlotLocked(craftResult, 0, 80, 51));
|
||||
addSlotToContainer(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, craftingInventory, k1 + l * 3, 10 + k1 * 18, 20 + l * 18));
|
||||
addSlotToContainer(new SlotCraftMatrix(this, craftingInventory, 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));
|
||||
addSlotToContainer(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));
|
||||
addSlotToContainer(new Slot(inventoryplayer, j1, 8 + j1 * 18, 194));
|
||||
}
|
||||
|
||||
// Update crafting matrix with current contents of tileentity.
|
||||
@@ -114,12 +113,6 @@ public class ContainerCarpenter extends ContainerLiquidTanks implements IContain
|
||||
updateProductSlot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces the original onCraftMatrixChanged
|
||||
*
|
||||
* @param iinventory
|
||||
* @param slot
|
||||
*/
|
||||
@Override
|
||||
public void onCraftMatrixChanged(IInventory iinventory, int slot) {
|
||||
craftingInventory.setInventorySlotContents(slot, iinventory.getStackInSlot(slot));
|
||||
|
||||
@@ -27,20 +27,20 @@ public class ContainerCentrifuge extends ContainerForestry {
|
||||
this.tile = tile;
|
||||
|
||||
// Resource
|
||||
this.addSlot(new Slot(tile, 0, 34, 37));
|
||||
this.addSlotToContainer(new Slot(tile, 0, 34, 37));
|
||||
|
||||
// Product Inventory
|
||||
for (int l = 0; l < 3; l++)
|
||||
for (int k = 0; k < 3; k++)
|
||||
addSlot(new SlotClosed(tile, 1 + k + l * 3, 98 + k * 18, 19 + l * 18));
|
||||
addSlotToContainer(new SlotClosed(tile, 1 + k + l * 3, 98 + k * 18, 19 + l * 18));
|
||||
|
||||
// Player inventory
|
||||
for (int i1 = 0; i1 < 3; i1++)
|
||||
for (int l1 = 0; l1 < 9; l1++)
|
||||
addSlot(new Slot(player, l1 + i1 * 9 + 9, 8 + l1 * 18, 84 + i1 * 18));
|
||||
addSlotToContainer(new Slot(player, l1 + i1 * 9 + 9, 8 + l1 * 18, 84 + i1 * 18));
|
||||
// Player hotbar
|
||||
for (int j1 = 0; j1 < 9; j1++)
|
||||
addSlot(new Slot(player, j1, 8 + j1 * 18, 142));
|
||||
addSlotToContainer(new Slot(player, j1, 8 + j1 * 18, 142));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,46 +10,44 @@
|
||||
******************************************************************************/
|
||||
package forestry.factory.gui;
|
||||
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotCrafter;
|
||||
import forestry.factory.gadgets.MachineFabricator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
public class ContainerFabricator extends ContainerLiquidTanks {
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotCrafter;
|
||||
import forestry.factory.gadgets.MachineFabricator;
|
||||
|
||||
private final MachineFabricator tile;
|
||||
public class ContainerFabricator extends ContainerLiquidTanks {
|
||||
|
||||
public ContainerFabricator(InventoryPlayer playerInventory, MachineFabricator tile) {
|
||||
super(tile, tile);
|
||||
this.tile = tile;
|
||||
|
||||
// Internal inventory
|
||||
for (int i = 0; i < 2; i++)
|
||||
for (int k = 0; k < 9; k++)
|
||||
addSlot(new Slot(tile, MachineFabricator.SLOT_INVENTORY_1 + k + i * 9, 8 + k * 18, 84 + i * 18));
|
||||
addSlotToContainer(new Slot(tile, MachineFabricator.SLOT_INVENTORY_1 + k + i * 9, 8 + k * 18, 84 + i * 18));
|
||||
|
||||
// Molten resource
|
||||
this.addSlot(new Slot(tile, MachineFabricator.SLOT_METAL, 26, 21));
|
||||
this.addSlotToContainer(new Slot(tile, MachineFabricator.SLOT_METAL, 26, 21));
|
||||
|
||||
// Plan
|
||||
this.addSlot(new Slot(tile, MachineFabricator.SLOT_PLAN, 139, 17));
|
||||
this.addSlotToContainer(new Slot(tile, MachineFabricator.SLOT_PLAN, 139, 17));
|
||||
|
||||
// Result
|
||||
this.addSlot(new SlotCrafter(playerInventory.player, tile, tile, MachineFabricator.SLOT_RESULT, 139, 53));
|
||||
this.addSlotToContainer(new SlotCrafter(playerInventory.player, tile, tile, MachineFabricator.SLOT_RESULT, 139, 53));
|
||||
|
||||
// Crafting matrix
|
||||
for (int l = 0; l < 3; l++)
|
||||
for (int k = 0; k < 3; k++)
|
||||
addSlot(new Slot(tile, MachineFabricator.SLOT_CRAFTING_1 + k + l * 3, 67 + k * 18, 17 + l * 18));
|
||||
addSlotToContainer(new Slot(tile, MachineFabricator.SLOT_CRAFTING_1 + k + l * 3, 67 + k * 18, 17 + l * 18));
|
||||
|
||||
// Player inventory
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int k = 0; k < 9; k++)
|
||||
addSlot(new Slot(playerInventory, k + i * 9 + 9, 8 + k * 18, 129 + i * 18));
|
||||
addSlotToContainer(new Slot(playerInventory, k + i * 9 + 9, 8 + k * 18, 129 + i * 18));
|
||||
// Player hotbar
|
||||
for (int j = 0; j < 9; j++)
|
||||
addSlot(new Slot(playerInventory, j, 8 + j * 18, 187));
|
||||
addSlotToContainer(new Slot(playerInventory, j, 8 + j * 18, 187));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -26,20 +26,20 @@ public class ContainerFermenter extends ContainerLiquidTanks {
|
||||
super(fermenter, fermenter);
|
||||
|
||||
this.fermenter = fermenter;
|
||||
this.addSlot(new SlotCustom(fermenter, MachineFermenter.SLOT_RESOURCE, 85, 23).setExclusion(true));
|
||||
this.addSlot(new SlotCustom(fermenter, MachineFermenter.SLOT_FUEL, 75, 57).setExclusion(true));
|
||||
this.addSlot(new SlotOutput(fermenter, MachineFermenter.SLOT_CAN_OUTPUT, 150, 58));
|
||||
this.addSlot(new SlotLiquidContainer(fermenter, MachineFermenter.SLOT_CAN_INPUT, 150, 22, true));
|
||||
this.addSlot(new SlotLiquidContainer(fermenter, MachineFermenter.SLOT_INPUT, 10, 40));
|
||||
this.addSlotToContainer(new SlotCustom(fermenter, MachineFermenter.SLOT_RESOURCE, 85, 23).setExclusion(true));
|
||||
this.addSlotToContainer(new SlotCustom(fermenter, MachineFermenter.SLOT_FUEL, 75, 57).setExclusion(true));
|
||||
this.addSlotToContainer(new SlotOutput(fermenter, MachineFermenter.SLOT_CAN_OUTPUT, 150, 58));
|
||||
this.addSlotToContainer(new SlotLiquidContainer(fermenter, MachineFermenter.SLOT_CAN_INPUT, 150, 22, true));
|
||||
this.addSlotToContainer(new SlotLiquidContainer(fermenter, MachineFermenter.SLOT_INPUT, 10, 40));
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int var4 = 0; var4 < 9; ++var4) {
|
||||
this.addSlot(new Slot(player, var4 + i * 9 + 9, 8 + var4 * 18, 84 + i * 18));
|
||||
this.addSlotToContainer(new Slot(player, var4 + i * 9 + 9, 8 + var4 * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlot(new Slot(player, i, 8 + i * 18, 142));
|
||||
this.addSlotToContainer(new Slot(player, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -30,32 +30,32 @@ public class ContainerMoistener extends ContainerLiquidTanks implements IContain
|
||||
// Stash
|
||||
for (int l = 0; l < 2; l++) {
|
||||
for (int k1 = 0; k1 < 3; k1++) {
|
||||
addSlot(new Slot(tile, k1 + l * 3, 39 + k1 * 18, 16 + l * 18));
|
||||
addSlotToContainer(new Slot(tile, k1 + l * 3, 39 + k1 * 18, 16 + l * 18));
|
||||
}
|
||||
}
|
||||
// Reservoir
|
||||
for (int k1 = 0; k1 < 3; k1++) {
|
||||
addSlot(new Slot(tile, k1 + 6, 39 + k1 * 18, 22 + 36));
|
||||
addSlotToContainer(new Slot(tile, k1 + 6, 39 + k1 * 18, 22 + 36));
|
||||
}
|
||||
|
||||
// Working slot
|
||||
this.addSlot(new SlotWorking(tile, 9, 105, 37));
|
||||
this.addSlotToContainer(new SlotWorking(tile, 9, 105, 37));
|
||||
|
||||
// Product slot
|
||||
this.addSlot(new Slot(tile, 10, 143, 55));
|
||||
this.addSlotToContainer(new Slot(tile, 10, 143, 55));
|
||||
// Boxes
|
||||
this.addSlot(new SlotCraftAuto(this, tile, 11, 143, 19));
|
||||
this.addSlotToContainer(new SlotCraftAuto(this, tile, 11, 143, 19));
|
||||
|
||||
// Player inventory
|
||||
int var3;
|
||||
for (var3 = 0; var3 < 3; ++var3) {
|
||||
for (int var4 = 0; var4 < 9; ++var4) {
|
||||
this.addSlot(new Slot(player, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
|
||||
this.addSlotToContainer(new Slot(player, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (var3 = 0; var3 < 9; ++var3) {
|
||||
this.addSlot(new Slot(player, var3, 8 + var3 * 18, 142));
|
||||
this.addSlotToContainer(new Slot(player, var3, 8 + var3 * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,23 +19,20 @@ import net.minecraft.inventory.Slot;
|
||||
|
||||
public class ContainerRaintank extends ContainerLiquidTanks {
|
||||
|
||||
protected MachineRaintank tile;
|
||||
|
||||
public ContainerRaintank(InventoryPlayer player, MachineRaintank tile) {
|
||||
super(tile, tile);
|
||||
|
||||
this.tile = tile;
|
||||
this.addSlot(new SlotLiquidContainer(tile, MachineRaintank.SLOT_RESOURCE, 116, 19, true));
|
||||
this.addSlot(new SlotClosed(tile, MachineRaintank.SLOT_PRODUCT, 116, 55));
|
||||
this.addSlotToContainer(new SlotLiquidContainer(tile, MachineRaintank.SLOT_RESOURCE, 116, 19, true));
|
||||
this.addSlotToContainer(new SlotClosed(tile, MachineRaintank.SLOT_PRODUCT, 116, 55));
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlot(new Slot(player, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
this.addSlotToContainer(new Slot(player, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlot(new Slot(player, i, 8 + i * 18, 142));
|
||||
this.addSlotToContainer(new Slot(player, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,42 +10,39 @@
|
||||
******************************************************************************/
|
||||
package forestry.factory.gui;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotClosed;
|
||||
import forestry.core.gui.slots.SlotLiquidContainer;
|
||||
import forestry.factory.gadgets.MachineSqueezer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
public class ContainerSqueezer extends ContainerLiquidTanks {
|
||||
|
||||
protected MachineSqueezer tile;
|
||||
|
||||
public ContainerSqueezer(InventoryPlayer player, MachineSqueezer tile) {
|
||||
super(tile, tile);
|
||||
|
||||
this.tile = tile;
|
||||
|
||||
// Resource inventory
|
||||
for (int l = 0; l < 3; l++)
|
||||
for (int k = 0; k < 3; k++)
|
||||
addSlot(new Slot(tile, k + l * 3, 19 + k * 18, 18 + l * 18));
|
||||
addSlotToContainer(new Slot(tile, k + l * 3, 19 + k * 18, 18 + l * 18));
|
||||
|
||||
// Remnants slot
|
||||
this.addSlot(new SlotClosed(tile, 9, 123, 19));
|
||||
this.addSlotToContainer(new SlotClosed(tile, 9, 123, 19));
|
||||
|
||||
// Can slot
|
||||
this.addSlot(new SlotLiquidContainer(tile, 10, 106, 55, true));
|
||||
this.addSlotToContainer(new SlotLiquidContainer(tile, 10, 106, 55, true));
|
||||
// Output slot
|
||||
this.addSlot(new SlotClosed(tile, 11, 140, 55));
|
||||
this.addSlotToContainer(new SlotClosed(tile, 11, 140, 55));
|
||||
|
||||
// Player inventory
|
||||
for (int i1 = 0; i1 < 3; i1++)
|
||||
for (int l1 = 0; l1 < 9; l1++)
|
||||
addSlot(new Slot(player, l1 + i1 * 9 + 9, 8 + l1 * 18, 84 + i1 * 18));
|
||||
addSlotToContainer(new Slot(player, l1 + i1 * 9 + 9, 8 + l1 * 18, 84 + i1 * 18));
|
||||
// Player hotbar
|
||||
for (int j1 = 0; j1 < 9; j1++)
|
||||
addSlot(new Slot(player, j1, 8 + j1 * 18, 142));
|
||||
addSlotToContainer(new Slot(player, j1, 8 + j1 * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,32 +10,30 @@
|
||||
******************************************************************************/
|
||||
package forestry.factory.gui;
|
||||
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotLiquidContainer;
|
||||
import forestry.factory.gadgets.MachineStill;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
public class ContainerStill extends ContainerLiquidTanks {
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotLiquidContainer;
|
||||
import forestry.factory.gadgets.MachineStill;
|
||||
|
||||
protected MachineStill processor;
|
||||
public class ContainerStill extends ContainerLiquidTanks {
|
||||
|
||||
public ContainerStill(InventoryPlayer player, MachineStill tile) {
|
||||
super(tile, tile);
|
||||
|
||||
this.processor = tile;
|
||||
this.addSlot(new Slot(tile, MachineStill.SLOT_PRODUCT, 150, 54));
|
||||
this.addSlot(new SlotLiquidContainer(tile, MachineStill.SLOT_RESOURCE, 150, 18, true));
|
||||
this.addSlot(new SlotLiquidContainer(tile, MachineStill.SLOT_CAN, 10, 36));
|
||||
this.addSlotToContainer(new Slot(tile, MachineStill.SLOT_PRODUCT, 150, 54));
|
||||
this.addSlotToContainer(new SlotLiquidContainer(tile, MachineStill.SLOT_RESOURCE, 150, 18, true));
|
||||
this.addSlotToContainer(new SlotLiquidContainer(tile, MachineStill.SLOT_CAN, 10, 36));
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlot(new Slot(player, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
this.addSlotToContainer(new Slot(player, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlot(new Slot(player, i, 8 + i * 18, 142));
|
||||
this.addSlotToContainer(new Slot(player, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
******************************************************************************/
|
||||
package forestry.factory.gui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.core.gui.ContainerForestry;
|
||||
import forestry.core.gui.IGuiSelectable;
|
||||
import forestry.core.gui.slots.SlotCrafter;
|
||||
@@ -20,56 +26,47 @@ import forestry.core.network.PacketUpdate;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.StackUtils;
|
||||
import forestry.factory.gadgets.TileWorktable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCraftResult;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerWorktable extends ContainerForestry implements IContainerCrafting, IGuiSelectable {
|
||||
|
||||
EntityPlayer player;
|
||||
TileWorktable tile;
|
||||
IInventory craftingInventory;
|
||||
IInventory internalInventory;
|
||||
InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
|
||||
InventoryCraftResult craftResult = new InventoryCraftResult();
|
||||
long lastUpdate;
|
||||
private final EntityPlayer player;
|
||||
private final TileWorktable tile;
|
||||
private final InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
|
||||
private long lastUpdate;
|
||||
|
||||
public ContainerWorktable(EntityPlayer player, TileWorktable tile) {
|
||||
super(tile.getInternalInventory());
|
||||
this.tile = tile;
|
||||
|
||||
craftingInventory = tile.getCraftingInventory();
|
||||
internalInventory = tile.getInternalInventory();
|
||||
IInventory craftingInventory = tile.getCraftingInventory();
|
||||
IInventory internalInventory = tile.getInternalInventory();
|
||||
|
||||
// Internal inventory
|
||||
for (int i = 0; i < 2; i++) {
|
||||
for (int k = 0; k < 9; k++) {
|
||||
addSlot(new Slot(internalInventory, TileWorktable.SLOT_INVENTORY_1 + k + i * 9, 8 + k * 18, 90 + i * 18));
|
||||
addSlotToContainer(new Slot(internalInventory, TileWorktable.SLOT_INVENTORY_1 + k + i * 9, 8 + k * 18, 90 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
// Crafting matrix
|
||||
for (int l = 0; l < 3; l++) {
|
||||
for (int k1 = 0; k1 < 3; k1++) {
|
||||
addSlot(new SlotCraftMatrix(this, craftingInventory, k1 + l * 3, 11 + k1 * 18, 20 + l * 18));
|
||||
addSlotToContainer(new SlotCraftMatrix(this, craftingInventory, k1 + l * 3, 11 + k1 * 18, 20 + l * 18));
|
||||
}
|
||||
}
|
||||
|
||||
// CraftResult display
|
||||
addSlot(new SlotCrafter(player, craftingInventory, tile, TileWorktable.SLOT_CRAFTING_RESULT, 77, 38));
|
||||
addSlotToContainer(new SlotCrafter(player, craftingInventory, tile, TileWorktable.SLOT_CRAFTING_RESULT, 77, 38));
|
||||
|
||||
// Player inventory
|
||||
for (int i1 = 0; i1 < 3; i1++) {
|
||||
for (int l1 = 0; l1 < 9; l1++) {
|
||||
addSlot(new Slot(player.inventory, l1 + i1 * 9 + 9, 8 + l1 * 18, 136 + i1 * 18));
|
||||
addSlotToContainer(new Slot(player.inventory, l1 + i1 * 9 + 9, 8 + l1 * 18, 136 + i1 * 18));
|
||||
}
|
||||
}
|
||||
// Player hotbar
|
||||
for (int j1 = 0; j1 < 9; j1++) {
|
||||
addSlot(new Slot(player.inventory, j1, 8 + j1 * 18, 194));
|
||||
addSlotToContainer(new Slot(player.inventory, j1, 8 + j1 * 18, 194));
|
||||
}
|
||||
|
||||
// Update crafting matrix with current contents of tileentity.
|
||||
@@ -106,7 +103,7 @@ public class ContainerWorktable extends ContainerForestry implements IContainerC
|
||||
|
||||
private void updateMatrix() {
|
||||
for (int i = 0; i < craftMatrix.getSizeInventory(); i++) {
|
||||
craftMatrix.setInventorySlotContents(i, craftingInventory.getStackInSlot(i));
|
||||
craftMatrix.setInventorySlotContents(i, tile.getCraftingInventory().getStackInSlot(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user