From aca4b461b7b14ed2b45953e73287f255fd550581 Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Fri, 27 Dec 2013 18:21:17 -0500 Subject: [PATCH] Transporter fixes --- .../multipart/PartLogisticalTransporter.java | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/common/mekanism/common/multipart/PartLogisticalTransporter.java b/common/mekanism/common/multipart/PartLogisticalTransporter.java index b9adce224..64fa01480 100644 --- a/common/mekanism/common/multipart/PartLogisticalTransporter.java +++ b/common/mekanism/common/multipart/PartLogisticalTransporter.java @@ -416,6 +416,11 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti @Override public ItemStack insert(Coord4D original, ItemStack itemStack, EnumColor color, boolean doEmit, int min) + { + return insert_do(original, itemStack, color, doEmit, min, false); + } + + private ItemStack insert_do(Coord4D original, ItemStack itemStack, EnumColor color, boolean doEmit, int min, boolean force) { ForgeDirection from = Coord4D.get(tile()).sideDifference(original).getOpposite(); @@ -425,7 +430,7 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti stack.homeLocation = original; stack.color = color; - if(!canReceiveFrom(original.getTileEntity(world()), from) || !stack.canInsertToTransporter(tile(), from)) + if((force && !canReceiveFrom(original.getTileEntity(world()), from)) || !stack.canInsertToTransporter(tile(), from)) { return itemStack; } @@ -436,10 +441,14 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti { stack.itemStack = TransporterManager.getToUse(stack.itemStack, rejected); - transit.add(stack); - TransporterManager.add(stack); - PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D); - MekanismUtils.saveChunk(tile()); + if(doEmit) + { + transit.add(stack); + TransporterManager.add(stack); + PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D); + MekanismUtils.saveChunk(tile()); + } + return rejected; } @@ -468,10 +477,14 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti { stack.itemStack = TransporterManager.getToUse(stack.itemStack, rejected); - transit.add(stack); - TransporterManager.add(stack); - PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D); - MekanismUtils.saveChunk(tile()); + if(doEmit) + { + transit.add(stack); + TransporterManager.add(stack); + PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D); + MekanismUtils.saveChunk(tile()); + } + return rejected; }