Fix injectItems

Closes #1064
This commit is contained in:
CovertJaguar 2013-07-27 23:00:04 -07:00
parent 87624d9572
commit fd3555a56a

View file

@ -334,16 +334,11 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, IFlui
public int injectItem(ItemStack payload, boolean doAdd, ForgeDirection from) { public int injectItem(ItemStack payload, boolean doAdd, ForgeDirection from) {
if (BlockGenericPipe.isValid(pipe) && pipe.transport instanceof PipeTransportItems && isPipeConnected(from)) { if (BlockGenericPipe.isValid(pipe) && pipe.transport instanceof PipeTransportItems && isPipeConnected(from)) {
if (doAdd) { if (doAdd) {
Position itemPos = new Position(xCoord, yCoord, zCoord, from.getOpposite()); Position itemPos = new Position(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, from.getOpposite());
itemPos.moveBackwards(1.0); itemPos.moveBackwards(0.4);
itemPos.x += 0.5;
itemPos.y += Utils.getPipeFloorOf(payload);
itemPos.z += 0.5;
itemPos.moveForwards(0.5);
TravelingItem pipedItem = new TravelingItem(itemPos.x, itemPos.y, itemPos.z, payload); TravelingItem pipedItem = new TravelingItem(itemPos.x, itemPos.y, itemPos.z, payload);
((PipeTransportItems) pipe.transport).injectItem(pipedItem, from.getOpposite()); ((PipeTransportItems) pipe.transport).injectItem(pipedItem, itemPos.orientation);
} }
return payload.stackSize; return payload.stackSize;
} }