9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-31 21:06:29 +00:00

Fix jigsaw editor bricking when opening a piece a missing object

This commit is contained in:
Julian Krings
2025-12-18 11:13:43 +01:00
parent 298365f588
commit 98cc82cc3d

View File

@@ -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);