From 98cc82cc3d7801720b8a71f63e806a313678dcd4 Mon Sep 17 00:00:00 2001 From: Julian Krings Date: Thu, 18 Dec 2025 11:13:43 +0100 Subject: [PATCH] Fix jigsaw editor bricking when opening a piece a missing object --- .../com/volmit/iris/core/edit/JigsawEditor.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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);