Fixed a small bug

This commit is contained in:
Aidan C. Brady 2013-12-25 17:57:27 -05:00
parent 047ead8d09
commit d0d4a858e1
2 changed files with 11 additions and 13 deletions

View file

@ -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);

View file

@ -71,20 +71,14 @@ 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);
}
@Override
public void handlePacketData(ByteArrayDataInput dataStream)
{