From 40ee3209a2171350563372fa0818ec67f1a88995 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 4 Jan 2022 14:07:17 +0100 Subject: [PATCH] Fixes for SchematicSelector Signed-off-by: Chaoscaot --- .../src/de/steamwar/inventory/SchematicSelector.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SpigotCore_Main/src/de/steamwar/inventory/SchematicSelector.java b/SpigotCore_Main/src/de/steamwar/inventory/SchematicSelector.java index 6a98371..1c21ff3 100644 --- a/SpigotCore_Main/src/de/steamwar/inventory/SchematicSelector.java +++ b/SpigotCore_Main/src/de/steamwar/inventory/SchematicSelector.java @@ -270,7 +270,9 @@ public class SchematicSelector { SWAnvilInv swAnvilInv = new SWAnvilInv(player, Core.MESSAGE.parse("SCHEM_SELECTOR_FILTER_ENTER_OWNER", player)); swAnvilInv.setItem(Material.PLAYER_HEAD); swAnvilInv.setCallback(s -> { - filter.setOwner(SteamwarUser.get(s).getId()); + if(SteamwarUser.get(s) != null) { + filter.setOwner(SteamwarUser.get(s).getId()); + } openFilter(); }); swAnvilInv.open(); @@ -335,11 +337,13 @@ public class SchematicSelector { inv.setItem(7, SWItem.getDye(1), Core.MESSAGE.parse("SCHEM_SELECTOR_CANCEL", player), clickType -> { filter.reset(); + depth = 0; openList(null); }); inv.setItem(8, SWItem.getDye(10), Core.MESSAGE.parse("SCHEM_SELECTOR_GO", player), clickType -> { filter.setFilter(true); injectable.onFilterApply(this); + depth = 0; openList(null); });