mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-02-16 02:20:44 +00:00
Fix jigsaw editor bricking when opening a piece a missing object
This commit is contained in:
@@ -61,14 +61,14 @@ public class JigsawEditor implements Listener {
|
|||||||
private Location target;
|
private Location target;
|
||||||
|
|
||||||
public JigsawEditor(Player player, IrisJigsawPiece piece, IrisObject object, File saveLocation) {
|
public JigsawEditor(Player player, IrisJigsawPiece piece, IrisObject object, File saveLocation) {
|
||||||
if (editors.containsKey(player)) {
|
if (object == null) throw new RuntimeException("Object is null! " + piece.getObject());
|
||||||
editors.get(player).close();
|
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.object = object;
|
||||||
this.player = player;
|
this.player = player;
|
||||||
origin = player.getLocation().clone().add(0, 7, 0);
|
origin = player.getLocation().clone().add(0, 7, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user