From a2324190bbadb944799589433d0bf58544ffc195 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 10 Aug 2017 17:18:35 +1000 Subject: [PATCH] Fixes #1619 --- .../plot/util/SchematicHandler.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java b/Core/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java index e5540d6ed..45bc34577 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java @@ -328,11 +328,19 @@ public abstract class SchematicHandler { if (!chunks.isEmpty()) { this.run(); } else { - for (Map.Entry entry : schematic.getTiles().entrySet()) { - BlockLoc loc = entry.getKey(); - restoreTile(queue, entry.getValue(), p1x + xOffset + loc.x, loc.y + y_offset_actual, p1z + zOffset + loc.z); - } queue.flush(); + HashMap tiles = schematic.getTiles(); + if (!tiles.isEmpty()) { + TaskManager.IMP.sync(new RunnableVal() { + @Override + public void run(Object value) { + for (Map.Entry entry : schematic.getTiles().entrySet()) { + BlockLoc loc = entry.getKey(); + restoreTile(queue, entry.getValue(), p1x + xOffset + loc.x, loc.y + y_offset_actual, p1z + zOffset + loc.z); + } + } + }); + } if (whenDone != null) { whenDone.value = true; whenDone.run();