Fix useless reopening in old versions
Dieser Commit ist enthalten in:
Ursprung
647ef97bfb
Commit
9ceb8b40ae
@ -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();
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren