Transporter fixes
This commit is contained in:
parent
2241e7e7b9
commit
aca4b461b7
1 changed files with 22 additions and 9 deletions
|
@ -416,6 +416,11 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack insert(Coord4D original, ItemStack itemStack, EnumColor color, boolean doEmit, int min)
|
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();
|
ForgeDirection from = Coord4D.get(tile()).sideDifference(original).getOpposite();
|
||||||
|
|
||||||
|
@ -425,7 +430,7 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
|
||||||
stack.homeLocation = original;
|
stack.homeLocation = original;
|
||||||
stack.color = color;
|
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;
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
@ -436,10 +441,14 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
|
||||||
{
|
{
|
||||||
stack.itemStack = TransporterManager.getToUse(stack.itemStack, rejected);
|
stack.itemStack = TransporterManager.getToUse(stack.itemStack, rejected);
|
||||||
|
|
||||||
transit.add(stack);
|
if(doEmit)
|
||||||
TransporterManager.add(stack);
|
{
|
||||||
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D);
|
transit.add(stack);
|
||||||
MekanismUtils.saveChunk(tile());
|
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;
|
return rejected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,10 +477,14 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
|
||||||
{
|
{
|
||||||
stack.itemStack = TransporterManager.getToUse(stack.itemStack, rejected);
|
stack.itemStack = TransporterManager.getToUse(stack.itemStack, rejected);
|
||||||
|
|
||||||
transit.add(stack);
|
if(doEmit)
|
||||||
TransporterManager.add(stack);
|
{
|
||||||
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D);
|
transit.add(stack);
|
||||||
MekanismUtils.saveChunk(tile());
|
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;
|
return rejected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue