From d58aab499cf65901c015269a360062ad51a3a02f Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 9 Jan 2018 20:28:18 -0500 Subject: [PATCH] Fixed #69 --- .../blocks/types/distribution/TunnelConveyor.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java index e0c10d26c6..e372c5efd1 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java @@ -26,10 +26,16 @@ public class TunnelConveyor extends Block{ Tile tunnel = getDestTunnel(tile, item); if(tunnel == null) return; Tile to = tunnel.getNearby()[tunnel.getRotation()]; + if(to == null) return; + Block before = to.block(); - Timers.run(25, ()->{ - if(to == null || to.entity == null) return; - to.block().handleItem(item, to, tunnel); + Timers.run(25, () -> { + if(to.block() != before) return; + try { + to.block().handleItem(item, to, tunnel); + }catch (NullPointerException e){ + e.printStackTrace(); + } }); }