diff --git a/core/src/main/java/com/volmit/iris/core/edit/JigsawEditor.java b/core/src/main/java/com/volmit/iris/core/edit/JigsawEditor.java index 2b20693be..17655e1c5 100644 --- a/core/src/main/java/com/volmit/iris/core/edit/JigsawEditor.java +++ b/core/src/main/java/com/volmit/iris/core/edit/JigsawEditor.java @@ -61,14 +61,14 @@ public class JigsawEditor implements Listener { private Location target; public JigsawEditor(Player player, IrisJigsawPiece piece, IrisObject object, File saveLocation) { - if (editors.containsKey(player)) { - editors.get(player).close(); - } + if (object == null) throw new RuntimeException("Object is null! " + piece.getObject()); + editors.compute(player, ($, current) -> { + if (current != null) { + current.exit(); + } + return this; + }); - editors.put(player, this); - if (object == null) { - throw new RuntimeException("Object is null! " + piece.getObject()); - } this.object = object; this.player = player; origin = player.getLocation().clone().add(0, 7, 0);