From 3a0d50f0bbc9b4b8854547800549745adc746bf9 Mon Sep 17 00:00:00 2001 From: davboecki Date: Fri, 11 Jan 2013 00:18:59 +0100 Subject: [PATCH] Fix Item drops on worldLoad. --- common/buildcraft/transport/PipeTransportItems.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/common/buildcraft/transport/PipeTransportItems.java b/common/buildcraft/transport/PipeTransportItems.java index 1292ca7a..9af7dcb8 100644 --- a/common/buildcraft/transport/PipeTransportItems.java +++ b/common/buildcraft/transport/PipeTransportItems.java @@ -47,6 +47,9 @@ public class PipeTransportItems extends PipeTransport { public Map travelingEntities = new HashMap(); private final List entitiesToLoad = new LinkedList(); + private final List delayedEntitiesToLoad = new LinkedList(); + private int delay = -1; + // TODO: generalize the use of this hook in particular for obsidian pipe public IItemTravelingHook travelHook; @@ -238,6 +241,14 @@ public class PipeTransportItems extends PipeTransport { } private void moveSolids() { + if(delay > 0) { + delay--; + if(delay == 0) { + entitiesToLoad.addAll(delayedEntitiesToLoad); + delayedEntitiesToLoad.clear(); + delay = -1; + } + } if (!entitiesToLoad.isEmpty()) { for (EntityData data : entitiesToLoad) { data.item.setWorld(worldObj); @@ -385,7 +396,7 @@ public class PipeTransportItems extends PipeTransport { data.output = ForgeDirection.getOrientation(dataTag.getInteger("output")); data.toCenter = dataTag.getBoolean("toCenter"); - entitiesToLoad.add(data); + delayedEntitiesToLoad.add(data); } catch (Throwable t) { t.printStackTrace(); // It may be the case that entities cannot be reloaded between