From e9c038cd246fa8af926fb9c68f3d17ee5cd52784 Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Fri, 25 Oct 2013 09:51:13 -0400 Subject: [PATCH] More progress on Logistical Sorter --- .../TileEntityLogisticalSorter.java | 27 ++++++++++++++ .../TileEntityLogisticalTransporter.java | 11 ++---- .../common/transporter/ItemStackFilter.java | 37 +++++++++++++++---- .../common/transporter/OreDictFilter.java | 23 ++++++++++++ .../common/transporter/TransporterFilter.java | 29 +++++++++++++++ .../common/transporter/TransporterStack.java | 14 +++++-- 6 files changed, 123 insertions(+), 18 deletions(-) diff --git a/common/mekanism/common/tileentity/TileEntityLogisticalSorter.java b/common/mekanism/common/tileentity/TileEntityLogisticalSorter.java index ac2bb027a..98d3ca779 100644 --- a/common/mekanism/common/tileentity/TileEntityLogisticalSorter.java +++ b/common/mekanism/common/tileentity/TileEntityLogisticalSorter.java @@ -31,6 +31,14 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen public void onUpdate() { super.onUpdate(); + + if(!worldObj.isRemote) + { + if(MekanismUtils.canFunction(this)) + { + //TODO + } + } } @Override @@ -80,6 +88,13 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen controlType = RedstoneControl.values()[dataStream.readInt()]; + filters.clear(); + + for(int i = 0; i < dataStream.readInt(); i++) + { + filters.add(TransporterFilter.readFromPacket(dataStream)); + } + MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord); } @@ -89,6 +104,12 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen super.getNetworkedData(data); data.add(controlType.ordinal()); + data.add(filters.size()); + + for(TransporterFilter filter : filters) + { + filter.write(data); + } return data; } @@ -104,6 +125,12 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen { return false; } + + @Override + public int getInventoryStackLimit() + { + return 1; + } @Override public RedstoneControl getControlType() diff --git a/common/mekanism/common/tileentity/TileEntityLogisticalTransporter.java b/common/mekanism/common/tileentity/TileEntityLogisticalTransporter.java index d523d4fa5..6205a0a70 100644 --- a/common/mekanism/common/tileentity/TileEntityLogisticalTransporter.java +++ b/common/mekanism/common/tileentity/TileEntityLogisticalTransporter.java @@ -335,14 +335,9 @@ public class TileEntityLogisticalTransporter extends TileEntityTransmitter