Fix Filler pipe interaction
This commit is contained in:
parent
2b0588fe5f
commit
b34c96cc06
1 changed files with 32 additions and 37 deletions
|
@ -1,19 +1,16 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (c) SpaceToad, 2011
|
* Copyright (c) SpaceToad, 2011 http://www.mod-buildcraft.com
|
||||||
* http://www.mod-buildcraft.com
|
|
||||||
*
|
*
|
||||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
* BuildCraft is distributed under the terms of the Minecraft Mod Public License
|
||||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
* 1.0, or MMPL. Please check the contents of the license located in
|
||||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package buildcraft.builders;
|
package buildcraft.builders;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraftforge.common.ForgeDirection;
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
import net.minecraftforge.common.ISidedInventory;
|
|
||||||
import buildcraft.BuildCraftCore;
|
import buildcraft.BuildCraftCore;
|
||||||
import buildcraft.api.core.IAreaProvider;
|
import buildcraft.api.core.IAreaProvider;
|
||||||
import buildcraft.api.core.LaserKind;
|
import buildcraft.api.core.LaserKind;
|
||||||
|
@ -33,22 +30,25 @@ import buildcraft.core.proxy.CoreProxy;
|
||||||
import buildcraft.core.triggers.ActionMachineControl;
|
import buildcraft.core.triggers.ActionMachineControl;
|
||||||
import buildcraft.core.triggers.ActionMachineControl.Mode;
|
import buildcraft.core.triggers.ActionMachineControl.Mode;
|
||||||
import buildcraft.core.utils.Utils;
|
import buildcraft.core.utils.Utils;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
public class TileFiller extends TileBuildCraft implements ISidedInventory, IPowerReceptor, IMachine, IActionReceptor {
|
public class TileFiller extends TileBuildCraft implements ISidedInventory, IPowerReceptor, IMachine, IActionReceptor {
|
||||||
|
|
||||||
|
private static int[] SLOTS_GRID = Utils.createSlotArray(0, 9);
|
||||||
|
private static int[] SLOTS_INPUT = Utils.createSlotArray(9, 27);
|
||||||
public @TileNetworkData
|
public @TileNetworkData
|
||||||
Box box = new Box();
|
Box box = new Box();
|
||||||
public @TileNetworkData
|
public @TileNetworkData
|
||||||
int currentPatternId = 0;
|
int currentPatternId = 0;
|
||||||
public @TileNetworkData
|
public @TileNetworkData
|
||||||
boolean done = true;
|
boolean done = true;
|
||||||
|
|
||||||
public IFillerPattern currentPattern;
|
public IFillerPattern currentPattern;
|
||||||
|
|
||||||
boolean forceDone = false;
|
boolean forceDone = false;
|
||||||
private ItemStack contents[];
|
private ItemStack contents[];
|
||||||
IPowerProvider powerProvider;
|
IPowerProvider powerProvider;
|
||||||
|
|
||||||
private ActionMachineControl.Mode lastMode = ActionMachineControl.Mode.Unknown;
|
private ActionMachineControl.Mode lastMode = ActionMachineControl.Mode.Unknown;
|
||||||
|
|
||||||
public TileFiller() {
|
public TileFiller() {
|
||||||
|
@ -141,7 +141,7 @@ public class TileFiller extends TileBuildCraft implements ISidedInventory, IPowe
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSizeInventory() {
|
public final int getSizeInventory() {
|
||||||
return 36;
|
return 36;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,11 +234,6 @@ public class TileFiller extends TileBuildCraft implements ISidedInventory, IPowe
|
||||||
public String getInvName() {
|
public String getInvName() {
|
||||||
return "Filler";
|
return "Filler";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isStackValidForSlot(int i, ItemStack itemstack) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
|
@ -352,12 +347,10 @@ public class TileFiller extends TileBuildCraft implements ISidedInventory, IPowe
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openChest() {
|
public void openChest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeChest() {
|
public void closeChest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -384,28 +377,30 @@ public class TileFiller extends TileBuildCraft implements ISidedInventory, IPowe
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Get the start of the side inventory.
|
public boolean isStackValidForSlot(int slot, ItemStack stack) {
|
||||||
*
|
if (slot < 9) {
|
||||||
* @param side
|
if(getStackInSlot(slot) != null) return false;
|
||||||
* The global side to get the start of range.
|
return stack.itemID == Block.brick.blockID || stack.itemID == Block.glass.blockID;
|
||||||
*/
|
}
|
||||||
public int getStartInventorySide(ForgeDirection side) {
|
return true;
|
||||||
if (side == ForgeDirection.UP)
|
|
||||||
return 0;
|
|
||||||
return 9;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Get the size of the side inventory.
|
public int[] getAccessibleSlotsFromSide(int side) {
|
||||||
*
|
if (ForgeDirection.UP.ordinal() == side) {
|
||||||
* @param side
|
return SLOTS_GRID;
|
||||||
* The global side.
|
}
|
||||||
*/
|
return SLOTS_INPUT;
|
||||||
public int getSizeInventorySide(ForgeDirection side) {
|
}
|
||||||
if (side == ForgeDirection.UP)
|
|
||||||
return 9;
|
|
||||||
return getSizeInventory() - 9;
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInsertItem(int slot, ItemStack stack, int side) {
|
||||||
|
return isStackValidForSlot(slot, stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canExtractItem(int slot, ItemStack stack, int side) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue