From 1e927da66ad8d944ff89c23e6a8342ba1bdde89a Mon Sep 17 00:00:00 2001 From: Prototik Date: Sat, 3 May 2014 01:04:22 +0800 Subject: [PATCH] Fix direction for dropped items --- common/buildcraft/transport/PipeTransportItems.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/buildcraft/transport/PipeTransportItems.java b/common/buildcraft/transport/PipeTransportItems.java index 097ebb07..f87fb28e 100644 --- a/common/buildcraft/transport/PipeTransportItems.java +++ b/common/buildcraft/transport/PipeTransportItems.java @@ -14,6 +14,7 @@ import java.util.LinkedList; import java.util.List; import java.util.logging.Level; +import net.minecraft.entity.item.EntityItem; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; @@ -366,7 +367,14 @@ public class PipeTransportItems extends PipeTransport { return; } - container.getWorldObj().spawnEntityInWorld(event.entity); + final EntityItem entity = event.entity; + ForgeDirection direction = item.input; + entity.setPosition(entity.posX + direction.offsetX * 0.5d, + entity.posY + direction.offsetY * 0.5d, + entity.posZ + direction.offsetZ * 0.5d); + entity.setVelocity(direction.offsetX * 0.5d, direction.offsetY * 0.5d, direction.offsetZ * 0.5d); + + container.getWorldObj().spawnEntityInWorld(entity); } protected boolean middleReached(TravelingItem item) {