mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-27 23:33:00 +00:00
Intial stages of an cleanup of the inventory code, this commit is very broken.
This commit is contained in:
1 parent
3d765067cf
commit
034cdf2860
73 files changed
+606
-759
No files matched your search
@@ -25,7 +25,7 @@ import forestry.core.interfaces.ILiquidTankContainer;
|
||||
import forestry.core.network.EntityNetData;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.utils.EnumTankLevel;
|
||||
import forestry.core.utils.InventoryAdapter;
|
||||
import forestry.core.inventory.InventoryAdapter;
|
||||
import forestry.core.utils.LiquidHelper;
|
||||
import forestry.core.utils.StackUtils;
|
||||
import forestry.core.utils.Utils;
|
||||
@@ -64,6 +64,7 @@ public class MachineBottler extends TilePowered implements ISidedInventory, ILiq
|
||||
|
||||
/* RECIPE MANAGMENT */
|
||||
public static class Recipe {
|
||||
|
||||
public final int cyclesPerUnit;
|
||||
public final FluidStack input;
|
||||
public final ItemStack can;
|
||||
@@ -86,7 +87,12 @@ public class MachineBottler extends TilePowered implements ISidedInventory, ILiq
|
||||
}
|
||||
|
||||
public static class RecipeManager implements ICraftingProvider {
|
||||
<<<<<<< Updated upstream
|
||||
public static final ArrayList<MachineBottler.Recipe> recipes = new ArrayList<MachineBottler.Recipe>();
|
||||
=======
|
||||
|
||||
public static ArrayList<MachineBottler.Recipe> recipes = new ArrayList<MachineBottler.Recipe>();
|
||||
>>>>>>> Stashed changes
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -105,9 +111,9 @@ public class MachineBottler extends TilePowered implements ISidedInventory, ILiq
|
||||
}
|
||||
|
||||
// No recipe matched. See if the liquid dictionary has anything.
|
||||
if(FluidContainerRegistry.isEmptyContainer(empty)) {
|
||||
if (FluidContainerRegistry.isEmptyContainer(empty)) {
|
||||
ItemStack filled = FluidContainerRegistry.fillFluidContainer(res, empty);
|
||||
if(filled != null) {
|
||||
if (filled != null) {
|
||||
FluidStack fluidStack = FluidContainerRegistry.getFluidForFilledItem(filled);
|
||||
Recipe recipe = new Recipe(CYCLES_FILLING_DEFAULT, fluidStack, empty, filled);
|
||||
recipes.add(recipe);
|
||||
@@ -133,8 +139,9 @@ public class MachineBottler extends TilePowered implements ISidedInventory, ILiq
|
||||
public Map<Object[], Object[]> getRecipes() {
|
||||
HashMap<Object[], Object[]> recipeList = new HashMap<Object[], Object[]>();
|
||||
|
||||
for (Recipe recipe : recipes)
|
||||
recipeList.put(new Object[] { recipe.input, recipe.can }, new Object[] { recipe.bottled });
|
||||
for (Recipe recipe : recipes) {
|
||||
recipeList.put(new Object[]{recipe.input, recipe.can}, new Object[]{recipe.bottled});
|
||||
}
|
||||
|
||||
return recipeList;
|
||||
}
|
||||
@@ -184,13 +191,14 @@ public class MachineBottler extends TilePowered implements ISidedInventory, ILiq
|
||||
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
ItemStack[] offspring = pendingProducts.toArray(new ItemStack[pendingProducts.size()]);
|
||||
for (int i = 0; i < offspring.length; i++)
|
||||
for (int i = 0; i < offspring.length; i++) {
|
||||
if (offspring[i] != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("Slot", (byte) i);
|
||||
offspring[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
nbttagcompound.setTag("PendingProducts", nbttaglist);
|
||||
}
|
||||
|
||||
@@ -379,14 +387,43 @@ public class MachineBottler extends TilePowered implements ISidedInventory, ILiq
|
||||
}
|
||||
|
||||
/* IINVENTORY */
|
||||
@Override public int getSizeInventory() { return inventory.getSizeInventory(); }
|
||||
@Override public ItemStack getStackInSlot(int i) { return inventory.getStackInSlot(i); }
|
||||
@Override public ItemStack decrStackSize(int i, int j) { return inventory.decrStackSize(i, j); }
|
||||
@Override public void setInventorySlotContents(int i, ItemStack itemstack) { inventory.setInventorySlotContents(i, itemstack); }
|
||||
@Override public ItemStack getStackInSlotOnClosing(int slot) { return inventory.getStackInSlotOnClosing(slot); }
|
||||
@Override public int getInventoryStackLimit() { return inventory.getInventoryStackLimit(); }
|
||||
@Override public void openInventory() {}
|
||||
@Override public void closeInventory() {}
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return inventory.getSizeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return inventory.getStackInSlot(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
return inventory.decrStackSize(i, j);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack) {
|
||||
inventory.setInventorySlotContents(i, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int slot) {
|
||||
return inventory.getStackInSlotOnClosing(slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return inventory.getInventoryStackLimit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: just a specialsource workaround
|
||||
@@ -404,36 +441,38 @@ public class MachineBottler extends TilePowered implements ISidedInventory, ILiq
|
||||
return super.hasCustomInventoryName();
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: just a specialsource workaround
|
||||
*/
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slotIndex, ItemStack itemstack) {
|
||||
return super.isItemValidForSlot(slotIndex, itemstack);
|
||||
if (!getInternalInventory().isItemValidForSlot(slotIndex, itemstack))
|
||||
return false;
|
||||
|
||||
if (slotIndex == SLOT_RESOURCE)
|
||||
return FluidContainerRegistry.isEmptyContainer(itemstack);
|
||||
|
||||
if (slotIndex == SLOT_CAN) {
|
||||
FluidContainerData container = LiquidHelper.getLiquidContainer(itemstack);
|
||||
return container != null && RecipeManager.isInput(container.fluid);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: just a specialsource workaround
|
||||
*/
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemstack, int j) {
|
||||
return super.canInsertItem(i, itemstack, j);
|
||||
public boolean canInsertItem(int slotIndex, ItemStack itemstack, int side) {
|
||||
return isItemValidForSlot(slotIndex, itemstack);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: just a specialsource workaround
|
||||
*/
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemstack, int j) {
|
||||
return super.canExtractItem(i, itemstack, j);
|
||||
public boolean canExtractItem(int slotIndex, ItemStack itemstack, int side) {
|
||||
return getInternalInventory().canExtractItem(side, itemstack, side) && slotIndex == SLOT_PRODUCT;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: just a specialsource workaround
|
||||
*/
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return super.getAccessibleSlotsFromSide(side);
|
||||
return getInternalInventory().getAccessibleSlotsFromSide(side);
|
||||
}
|
||||
|
||||
/* ISIDEDINVENTORY */
|
||||
@@ -445,7 +484,7 @@ public class MachineBottler extends TilePowered implements ISidedInventory, ILiq
|
||||
@Override
|
||||
protected boolean canTakeStackFromSide(int slotIndex, ItemStack itemstack, int side) {
|
||||
|
||||
if(!super.canTakeStackFromSide(slotIndex, itemstack, side))
|
||||
if (!super.canTakeStackFromSide(slotIndex, itemstack, side))
|
||||
return false;
|
||||
|
||||
return slotIndex == SLOT_PRODUCT;
|
||||
@@ -454,18 +493,6 @@ public class MachineBottler extends TilePowered implements ISidedInventory, ILiq
|
||||
@Override
|
||||
protected boolean canPutStackFromSide(int slotIndex, ItemStack itemstack, int side) {
|
||||
|
||||
if(!super.canPutStackFromSide(slotIndex, itemstack, side))
|
||||
return false;
|
||||
|
||||
if(slotIndex == SLOT_RESOURCE)
|
||||
return FluidContainerRegistry.isEmptyContainer(itemstack);
|
||||
|
||||
if(slotIndex == SLOT_CAN) {
|
||||
FluidContainerData container = LiquidHelper.getLiquidContainer(itemstack);
|
||||
return container != null && RecipeManager.isInput(container.fluid);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* ILIQUIDCONTAINER */
|
||||
|
||||
@@ -25,11 +25,11 @@ import forestry.core.network.EntityNetData;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.EnumTankLevel;
|
||||
import forestry.core.utils.InventoryAdapter;
|
||||
import forestry.core.inventory.InventoryAdapter;
|
||||
import forestry.core.utils.LiquidHelper;
|
||||
import forestry.core.utils.ShapedRecipeCustom;
|
||||
import forestry.core.utils.StackUtils;
|
||||
import forestry.core.utils.TileInventoryAdapter;
|
||||
import forestry.core.inventory.TileInventoryAdapter;
|
||||
import forestry.core.utils.Utils;
|
||||
import forestry.factory.gui.ContainerCarpenter;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -21,7 +21,7 @@ import forestry.core.config.Defaults;
|
||||
import forestry.core.gadgets.TileBase;
|
||||
import forestry.core.gadgets.TilePowered;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.utils.InventoryAdapter;
|
||||
import forestry.core.inventory.InventoryAdapter;
|
||||
import forestry.core.utils.StackUtils;
|
||||
import forestry.factory.triggers.FactoryTriggers;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -42,7 +42,7 @@ import forestry.core.proxy.Proxies;
|
||||
import forestry.core.fluids.tanks.StandardTank;
|
||||
import forestry.core.fluids.TankManager;
|
||||
import forestry.core.fluids.tanks.FilteredTank;
|
||||
import forestry.core.utils.InventoryAdapter;
|
||||
import forestry.core.inventory.InventoryAdapter;
|
||||
import forestry.core.utils.ShapedRecipeCustom;
|
||||
import forestry.core.utils.StackUtils;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
@@ -28,7 +28,7 @@ import forestry.core.interfaces.ILiquidTankContainer;
|
||||
import forestry.core.network.EntityNetData;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.utils.EnumTankLevel;
|
||||
import forestry.core.utils.InventoryAdapter;
|
||||
import forestry.core.inventory.InventoryAdapter;
|
||||
import forestry.core.utils.LiquidHelper;
|
||||
import forestry.core.utils.StackUtils;
|
||||
import forestry.core.utils.Utils;
|
||||
|
||||
@@ -26,7 +26,7 @@ import forestry.core.interfaces.IRenderableMachine;
|
||||
import forestry.core.network.EntityNetData;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.utils.EnumTankLevel;
|
||||
import forestry.core.utils.InventoryAdapter;
|
||||
import forestry.core.inventory.InventoryAdapter;
|
||||
import forestry.core.utils.LiquidHelper;
|
||||
import forestry.core.utils.StackUtils;
|
||||
import forestry.core.utils.Utils;
|
||||
|
||||
@@ -21,7 +21,7 @@ import forestry.core.gadgets.TileBase;
|
||||
import forestry.core.interfaces.ILiquidTankContainer;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.utils.Fluids;
|
||||
import forestry.core.utils.InventoryAdapter;
|
||||
import forestry.core.inventory.InventoryAdapter;
|
||||
import forestry.core.utils.LiquidHelper;
|
||||
import forestry.core.utils.StackUtils;
|
||||
import forestry.core.utils.Utils;
|
||||
|
||||
@@ -26,7 +26,7 @@ import forestry.core.network.EntityNetData;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.EnumTankLevel;
|
||||
import forestry.core.utils.InventoryAdapter;
|
||||
import forestry.core.inventory.InventoryAdapter;
|
||||
import forestry.core.utils.LiquidHelper;
|
||||
import forestry.core.utils.StackUtils;
|
||||
import forestry.core.utils.Utils;
|
||||
|
||||
@@ -25,7 +25,7 @@ import forestry.core.interfaces.ILiquidTankContainer;
|
||||
import forestry.core.network.EntityNetData;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.utils.EnumTankLevel;
|
||||
import forestry.core.utils.InventoryAdapter;
|
||||
import forestry.core.inventory.InventoryAdapter;
|
||||
import forestry.core.utils.LiquidHelper;
|
||||
import forestry.core.utils.StackUtils;
|
||||
import forestry.core.utils.Utils;
|
||||
|
||||
@@ -34,10 +34,10 @@ import forestry.core.network.PacketIds;
|
||||
import forestry.core.network.PacketTileNBT;
|
||||
import forestry.core.network.PacketTileUpdate;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.InventoryAdapter;
|
||||
import forestry.core.inventory.InventoryAdapter;
|
||||
import forestry.core.utils.PlainInventory;
|
||||
import forestry.core.utils.StackUtils;
|
||||
import forestry.core.utils.TileInventoryAdapter;
|
||||
import forestry.core.inventory.TileInventoryAdapter;
|
||||
|
||||
public class TileWorktable extends TileBase implements ICrafter {
|
||||
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
******************************************************************************/
|
||||
package forestry.factory.gui;
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotClosed;
|
||||
import forestry.core.gui.slots.SlotLiquidContainer;
|
||||
@@ -31,17 +37,16 @@ public class ContainerBottler extends ContainerLiquidTanks {
|
||||
this.addSlot(new SlotLiquidContainer(tile, MachineBottler.SLOT_CAN, 26, 38));
|
||||
|
||||
int var3;
|
||||
for (var3 = 0; var3 < 3; ++var3)
|
||||
for (int var4 = 0; var4 < 9; ++var4)
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
for (var3 = 0; var3 < 9; ++var3)
|
||||
for (var3 = 0; var3 < 9; ++var3) {
|
||||
this.addSlot(new Slot(player, var3, 8 + var3 * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer) {
|
||||
return tile.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,12 @@
|
||||
******************************************************************************/
|
||||
package forestry.factory.gui;
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotCustom;
|
||||
import forestry.core.gui.slots.SlotLiquidContainer;
|
||||
@@ -20,7 +26,12 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
public class ContainerFermenter extends ContainerLiquidTanks {
|
||||
<<<<<<< Updated upstream
|
||||
protected final MachineFermenter fermenter;
|
||||
=======
|
||||
|
||||
protected MachineFermenter fermenter;
|
||||
>>>>>>> Stashed changes
|
||||
|
||||
public ContainerFermenter(InventoryPlayer player, MachineFermenter fermenter) {
|
||||
super(fermenter, fermenter);
|
||||
@@ -32,17 +43,16 @@ public class ContainerFermenter extends ContainerLiquidTanks {
|
||||
this.addSlot(new SlotLiquidContainer(fermenter, MachineFermenter.SLOT_CAN_INPUT, 150, 22, true));
|
||||
this.addSlot(new SlotLiquidContainer(fermenter, MachineFermenter.SLOT_INPUT, 10, 40));
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
for (int var4 = 0; var4 < 9; ++var4)
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i)
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlot(new Slot(player, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer) {
|
||||
return fermenter.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.factory.gui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
@@ -30,12 +29,15 @@ public class ContainerMoistener extends ContainerLiquidTanks implements IContain
|
||||
|
||||
this.tile = tile;
|
||||
// Stash
|
||||
for (int l = 0; l < 2; l++)
|
||||
for (int k1 = 0; k1 < 3; k1++)
|
||||
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));
|
||||
}
|
||||
}
|
||||
// Reservoir
|
||||
for (int k1 = 0; k1 < 3; k1++)
|
||||
for (int k1 = 0; k1 < 3; k1++) {
|
||||
addSlot(new Slot(tile, k1 + 6, 39 + k1 * 18, 22 + 36));
|
||||
}
|
||||
|
||||
// Working slot
|
||||
this.addSlot(new SlotWorking(tile, 9, 105, 37));
|
||||
@@ -47,12 +49,15 @@ public class ContainerMoistener extends ContainerLiquidTanks implements IContain
|
||||
|
||||
// Player inventory
|
||||
int var3;
|
||||
for (var3 = 0; var3 < 3; ++var3)
|
||||
for (int var4 = 0; var4 < 9; ++var4)
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
for (var3 = 0; var3 < 9; ++var3)
|
||||
for (var3 = 0; var3 < 9; ++var3) {
|
||||
this.addSlot(new Slot(player, var3, 8 + var3 * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -62,9 +67,4 @@ public class ContainerMoistener extends ContainerLiquidTanks implements IContain
|
||||
tile.checkRecipe();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return this.tile.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,9 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.factory.gui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
@@ -31,17 +29,16 @@ public class ContainerRaintank extends ContainerLiquidTanks {
|
||||
this.addSlot(new SlotLiquidContainer(tile, MachineRaintank.SLOT_RESOURCE, 116, 19, true));
|
||||
this.addSlot(new SlotClosed(tile, MachineRaintank.SLOT_PRODUCT, 116, 55));
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
for (int j = 0; j < 9; ++j)
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i)
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlot(new Slot(player, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer) {
|
||||
return tile.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.factory.gui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
@@ -20,6 +18,7 @@ import forestry.core.gui.slots.SlotLiquidContainer;
|
||||
import forestry.factory.gadgets.MachineStill;
|
||||
|
||||
public class ContainerStill extends ContainerLiquidTanks {
|
||||
|
||||
protected MachineStill processor;
|
||||
|
||||
public ContainerStill(InventoryPlayer player, MachineStill tile) {
|
||||
@@ -30,17 +29,16 @@ public class ContainerStill extends ContainerLiquidTanks {
|
||||
this.addSlot(new SlotLiquidContainer(tile, MachineStill.SLOT_RESOURCE, 150, 18, true));
|
||||
this.addSlot(new SlotLiquidContainer(tile, MachineStill.SLOT_CAN, 10, 36));
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
for (int j = 0; j < 9; ++j)
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i)
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlot(new Slot(player, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer) {
|
||||
return processor.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user