Potential fix for tubes not obeying filters
This commit is contained in:
parent
d0131218d8
commit
788b325312
3 changed files with 21 additions and 3 deletions
|
@ -40,10 +40,13 @@ public class RenderCrate extends RenderImprintable
|
||||||
if (itemStack == null)
|
if (itemStack == null)
|
||||||
{
|
{
|
||||||
if (tileEntity.getFilter() != null)
|
if (tileEntity.getFilter() != null)
|
||||||
|
{
|
||||||
|
if (ItemImprinter.getFilters(tileEntity.getFilter()).size() > 0)
|
||||||
{
|
{
|
||||||
itemStack = ItemImprinter.getFilters(tileEntity.getFilter()).get(0).splitStack(0); // see if it has a filter instead
|
itemStack = ItemImprinter.getFilters(tileEntity.getFilter()).get(0).splitStack(0); // see if it has a filter instead
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (itemStack != null)
|
if (itemStack != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -204,9 +204,12 @@ public class BlockCrate extends BlockMachine
|
||||||
{
|
{
|
||||||
boolean filterValid = true;
|
boolean filterValid = true;
|
||||||
if (tileEntity.getFilter() != null)
|
if (tileEntity.getFilter() != null)
|
||||||
|
{
|
||||||
|
if (ItemImprinter.getFilters(tileEntity.getFilter()).size() > 0)
|
||||||
{
|
{
|
||||||
filterValid = itemStack.isItemEqual(ItemImprinter.getFilters(tileEntity.getFilter()).get(0));
|
filterValid = itemStack.isItemEqual(ItemImprinter.getFilters(tileEntity.getFilter()).get(0));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (containingStack.isStackable() && containingStack.isItemEqual(itemStack) && filterValid)
|
if (containingStack.isStackable() && containingStack.isItemEqual(itemStack) && filterValid)
|
||||||
{
|
{
|
||||||
int newStackSize = containingStack.stackSize + itemStack.stackSize;
|
int newStackSize = containingStack.stackSize + itemStack.stackSize;
|
||||||
|
@ -229,9 +232,12 @@ public class BlockCrate extends BlockMachine
|
||||||
{
|
{
|
||||||
boolean filterValid = true;
|
boolean filterValid = true;
|
||||||
if (tileEntity.getFilter() != null)
|
if (tileEntity.getFilter() != null)
|
||||||
|
{
|
||||||
|
if (ItemImprinter.getFilters(tileEntity.getFilter()).size() > 0)
|
||||||
{
|
{
|
||||||
filterValid = itemStack.isItemEqual(ItemImprinter.getFilters(tileEntity.getFilter()).get(0));
|
filterValid = itemStack.isItemEqual(ItemImprinter.getFilters(tileEntity.getFilter()).get(0));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (filterValid)
|
if (filterValid)
|
||||||
{
|
{
|
||||||
tileEntity.setInventorySlotContents(0, itemStack.copy());
|
tileEntity.setInventorySlotContents(0, itemStack.copy());
|
||||||
|
|
|
@ -8,6 +8,7 @@ import net.minecraftforge.common.ForgeDirection;
|
||||||
import net.minecraftforge.common.ISidedInventory;
|
import net.minecraftforge.common.ISidedInventory;
|
||||||
import universalelectricity.prefab.network.IPacketReceiver;
|
import universalelectricity.prefab.network.IPacketReceiver;
|
||||||
import universalelectricity.prefab.network.PacketManager;
|
import universalelectricity.prefab.network.PacketManager;
|
||||||
|
import assemblyline.common.machine.imprinter.ItemImprinter;
|
||||||
import assemblyline.common.machine.imprinter.TileEntityImprintable;
|
import assemblyline.common.machine.imprinter.TileEntityImprintable;
|
||||||
|
|
||||||
public class TileEntityCrate extends TileEntityImprintable implements ISidedInventory, IPacketReceiver
|
public class TileEntityCrate extends TileEntityImprintable implements ISidedInventory, IPacketReceiver
|
||||||
|
@ -122,6 +123,14 @@ public class TileEntityCrate extends TileEntityImprintable implements ISidedInve
|
||||||
{
|
{
|
||||||
if (stack != null)
|
if (stack != null)
|
||||||
{
|
{
|
||||||
|
boolean filterValid = true;
|
||||||
|
if (getFilter() != null)
|
||||||
|
{
|
||||||
|
if (ItemImprinter.getFilters(getFilter()).size() > 0)
|
||||||
|
{
|
||||||
|
filterValid = stack.isItemEqual(ItemImprinter.getFilters(getFilter()).get(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
if (stack.isStackable())
|
if (stack.isStackable())
|
||||||
{
|
{
|
||||||
this.containingItems[slot] = stack;
|
this.containingItems[slot] = stack;
|
||||||
|
|
Loading…
Reference in a new issue