diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/base/SimulatorBaseGui.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/base/SimulatorBaseGui.java index 4e70c08c..e3ddd797 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/base/SimulatorBaseGui.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/base/SimulatorBaseGui.java @@ -55,7 +55,7 @@ public abstract class SimulatorBaseGui { inv.setItem(i, null); } setup(); - if (TrickyTrialsWrapper.impl.getTopInventory(player.getOpenInventory()) != inv) { + if (player.getOpenInventory().getTopInventory() != inv) { inventory.open(); SimulatorWatcher.watch(player, simulator, this::open); } @@ -63,7 +63,7 @@ public abstract class SimulatorBaseGui { player.getOpenInventory().setTitle(title()); } populate(); - if (TrickyTrialsWrapper.impl.getTopInventory(player.getOpenInventory()) == inv) { + if (player.getOpenInventory().getTopInventory() == inv) { inventory.open(); SimulatorWatcher.watch(player, simulator, this::open); } diff --git a/SpigotCore/SpigotCore_21/src/de/steamwar/core/TrickyTrialsWrapper21.java b/SpigotCore/SpigotCore_21/src/de/steamwar/core/TrickyTrialsWrapper21.java index 096fc5c4..fe3bc55f 100644 --- a/SpigotCore/SpigotCore_21/src/de/steamwar/core/TrickyTrialsWrapper21.java +++ b/SpigotCore/SpigotCore_21/src/de/steamwar/core/TrickyTrialsWrapper21.java @@ -40,14 +40,4 @@ public class TrickyTrialsWrapper21 implements TrickyTrialsWrapper { public Material getTurtleScute() { return Material.TURTLE_SCUTE; } - - @Override - public String getInventoryTitle(InventoryView view) { - return view.getTitle(); - } - - @Override - public Inventory getTopInventory(InventoryView view) { - return view.getTopInventory(); - } } diff --git a/SpigotCore/SpigotCore_8/src/de/steamwar/core/TrickyTrialsWrapper8.java b/SpigotCore/SpigotCore_8/src/de/steamwar/core/TrickyTrialsWrapper8.java index 6e3ed151..5bb66d2d 100644 --- a/SpigotCore/SpigotCore_8/src/de/steamwar/core/TrickyTrialsWrapper8.java +++ b/SpigotCore/SpigotCore_8/src/de/steamwar/core/TrickyTrialsWrapper8.java @@ -40,14 +40,4 @@ public class TrickyTrialsWrapper8 implements TrickyTrialsWrapper { public Material getTurtleScute() { return Material.STONE; } - - @Override - public String getInventoryTitle(InventoryView view) { - return view.getTitle(); - } - - @Override - public Inventory getTopInventory(InventoryView view) { - return view.getTopInventory(); - } } diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/TrickyTrialsWrapper.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/TrickyTrialsWrapper.java index 5ce7ec2e..9a3d51dd 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/TrickyTrialsWrapper.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/TrickyTrialsWrapper.java @@ -33,8 +33,4 @@ public interface TrickyTrialsWrapper { Enchantment getUnbreakingEnchantment(); Material getTurtleScute(); - - String getInventoryTitle(InventoryView view); - - Inventory getTopInventory(InventoryView view); } diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/inventory/SWInventory.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/inventory/SWInventory.java index 11fe1ec6..001fae9f 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/inventory/SWInventory.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/inventory/SWInventory.java @@ -139,7 +139,7 @@ public class SWInventory implements Listener { public void open() { InventoryView view = player.openInventory(inventory); - title = TrickyTrialsWrapper.impl.getInventoryTitle(view); + title = view.getTitle(); Core.getInstance().getLogger().info("[SWINV] Opened " + title + " for " + player.getName()); if(!open) { Bukkit.getPluginManager().registerEvents(this, Core.getInstance()); @@ -154,7 +154,7 @@ public class SWInventory implements Listener { if (callbacks.containsKey(e.getRawSlot()) && callbacks.get(e.getRawSlot()) != null) { e.setCancelled(true); - Core.getInstance().getLogger().info("[SWINV] " + e.getWhoClicked().getName() + " " + e.getClick().name() + " clicked " + e.getRawSlot() + " on " + (e.getCurrentItem() != null ? e.getCurrentItem().getItemMeta().getDisplayName() : "[EMPTY]") + " in " + TrickyTrialsWrapper.impl.getInventoryTitle(e.getView())); + Core.getInstance().getLogger().info("[SWINV] " + e.getWhoClicked().getName() + " " + e.getClick().name() + " clicked " + e.getRawSlot() + " on " + (e.getCurrentItem() != null ? e.getCurrentItem().getItemMeta().getDisplayName() : "[EMPTY]") + " in " + e.getView().getTitle()); callbacks.get(e.getRawSlot()).accept(e); } }