diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 88a46ddc..bb60156f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -31,7 +31,6 @@ import de.steamwar.bausystem.worlddata.WorldData; import de.steamwar.message.Message; import lombok.Getter; import org.bukkit.Bukkit; -import org.bukkit.World; import org.bukkit.event.Listener; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; @@ -53,12 +52,8 @@ public class BauSystem extends JavaPlugin implements Listener { @Getter private static BauSystem instance; - private World world; - @Override public void onEnable() { - world = Bukkit.getWorlds().get(0); - // LOGGER fixLogging(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator2/gui/base/SimulatorBaseGui.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator2/gui/base/SimulatorBaseGui.java index 5d1b667e..00ef9c24 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator2/gui/base/SimulatorBaseGui.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator2/gui/base/SimulatorBaseGui.java @@ -45,14 +45,19 @@ public abstract class SimulatorBaseGui { } public final void open() { - if (inv != null && Core.getVersion() > 19) { + String newTitle = title(); + String originalTitle = player.getOpenInventory().getTitle(); + + if (inv != null && (newTitle.equals(originalTitle) || Core.getVersion() > 19)) { inv.clear(); setup(); if (player.getOpenInventory().getTopInventory() != inv) { inventory.open(); SimulatorWatcher.watch(player, simulator, this::open); } - player.getOpenInventory().setTitle(title()); + if (Core.getVersion() > 19) { + player.getOpenInventory().setTitle(title()); + } populate(); return; }