From d0d4a858e103e5cba73070824a19732be8e7d625 Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Wed, 25 Dec 2013 17:57:27 -0500 Subject: [PATCH] Fixed a small bug --- .../multipart/PartLogisticalTransporter.java | 16 ++++++++++------ .../common/tileentity/TileEntityBasicBlock.java | 8 +------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/common/mekanism/common/multipart/PartLogisticalTransporter.java b/common/mekanism/common/multipart/PartLogisticalTransporter.java index 636c09660..79c58e018 100644 --- a/common/mekanism/common/multipart/PartLogisticalTransporter.java +++ b/common/mekanism/common/multipart/PartLogisticalTransporter.java @@ -411,19 +411,21 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti @Override public ItemStack insert(Coord4D original, ItemStack itemStack, EnumColor color, boolean doEmit, int min) { + ForgeDirection from = Coord4D.get(tile()).sideDifference(original).getOpposite(); + TransporterStack stack = new TransporterStack(); stack.itemStack = itemStack; stack.originalLocation = original; stack.homeLocation = original; stack.color = color; - ItemStack rejected = stack.recalculatePath(this, min); - - if(!canReceiveFrom(original.getTileEntity(world()), ForgeDirection.getOrientation(stack.getSide(this))) || !stack.canInsertToTransporter(tile(), ForgeDirection.getOrientation(stack.getSide(this)))) + if(!canReceiveFrom(original.getTileEntity(world()), from) || !stack.canInsertToTransporter(tile(), from)) { return itemStack; } + ItemStack rejected = stack.recalculatePath(this, min); + if(TransporterManager.didEmit(stack.itemStack, rejected)) { stack.itemStack = TransporterManager.getToUse(stack.itemStack, rejected); @@ -441,19 +443,21 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti @Override public ItemStack insertRR(TileEntityLogisticalSorter outputter, ItemStack itemStack, EnumColor color, boolean doEmit, int min) { + ForgeDirection from = Coord4D.get(tile()).sideDifference(Coord4D.get(outputter)).getOpposite(); + TransporterStack stack = new TransporterStack(); stack.itemStack = itemStack; stack.originalLocation = Coord4D.get(outputter); stack.homeLocation = Coord4D.get(outputter); stack.color = color; - ItemStack rejected = stack.recalculateRRPath(outputter, this, min); - - if(!canReceiveFrom(outputter, ForgeDirection.getOrientation(stack.getSide(this))) || !stack.canInsertToTransporter(tile(), ForgeDirection.getOrientation(stack.getSide(this)))) + if(!canReceiveFrom(outputter, from) || !stack.canInsertToTransporter(tile(), from)) { return itemStack; } + ItemStack rejected = stack.recalculateRRPath(outputter, this, min); + if(TransporterManager.didEmit(stack.itemStack, rejected)) { stack.itemStack = TransporterManager.getToUse(stack.itemStack, rejected); diff --git a/common/mekanism/common/tileentity/TileEntityBasicBlock.java b/common/mekanism/common/tileentity/TileEntityBasicBlock.java index 2135392c4..43752ba98 100644 --- a/common/mekanism/common/tileentity/TileEntityBasicBlock.java +++ b/common/mekanism/common/tileentity/TileEntityBasicBlock.java @@ -71,18 +71,12 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench public void open(EntityPlayer player) { - openedThisTick.add(player); playersUsing.add(player); } public void close(EntityPlayer player) { - if(!openedThisTick.contains(player)) - { - playersUsing.remove(player); - } - - openedThisTick.remove(player); + playersUsing.remove(player); } @Override