diff --git a/BauSystem_Main/src/de/steamwar/bausystem/Permission.java b/BauSystem_Main/src/de/steamwar/bausystem/Permission.java index 519bb7f1..8617b535 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/Permission.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/Permission.java @@ -46,8 +46,7 @@ public enum Permission { OWNER(bauweltMember -> false); private final Predicate permissionPredicate; - private final BiConsumer permissionChange = (player, bauweltMember) -> { - }; + private BiConsumer permissionChange = (player, bauweltMember) -> {}; public boolean hasPermission(Player member) { if (member.getUniqueId().equals(BauServer.getInstance().getOwner())) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/AutoShutdownListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/AutoShutdownListener.java index 1baf6323..8ca28941 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/AutoShutdownListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/AutoShutdownListener.java @@ -69,6 +69,9 @@ public class AutoShutdownListener implements Listener { return; } count++; + if (count <= 120) { + return; + } try { if (RamUsage.getUsage() > 0.8) { Bukkit.shutdown(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauScoreboard.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauScoreboard.java index 5c5651e4..2e9fe6c3 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauScoreboard.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauScoreboard.java @@ -56,12 +56,12 @@ public class BauScoreboard implements Listener { strings.add("§eTNT§8: " + region.get(Flag.TNT).getChatValue()); strings.add("§eFreeze§8: " + region.get(Flag.FREEZE).getChatValue()); strings.add("§eFire§8: " + region.get(Flag.FIRE).getChatValue()); - strings.add("§eTrace§8: " + RecordStateMachine.getRecordStatus().getName()); - Loader loader = Loader.getLoader(p); - strings.add("§eLoader§8: " + (loader != null ? ("§a" + loader.getStage().getChatValue()) : "§caus")); if (region.getFloorLevel() != 0) { strings.add("§eProtect§8: " + region.get(Flag.PROTECT).getChatValue()); } + strings.add("§eTrace§8: " + RecordStateMachine.getRecordStatus().getName()); + Loader loader = Loader.getLoader(p); + strings.add("§eLoader§8: " + (loader != null ? ("§a" + loader.getStage().getChatValue()) : "§caus")); if (RecordStateMachine.getRecordStatus().isTracing()) { strings.add("§3"); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/RegionUtils.java b/BauSystem_Main/src/de/steamwar/bausystem/region/RegionUtils.java index 0309cdf9..2a409002 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/RegionUtils.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/RegionUtils.java @@ -29,7 +29,9 @@ public class RegionUtils { } static void save(Region region) { - region.regionData.add("prototype", region.getPrototype().getName()); + if (region.getPrototype() != null) { + region.regionData.add("prototype", region.getPrototype().getName()); + } region.regionData.add("flagStorage", FlagStorage.toYAPION(region.getFlagStorage())); RegionLoader.save(); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/utils/.gitkeep b/BauSystem_Main/src/de/steamwar/bausystem/utils/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/BauSystem_Main/src/de/steamwar/bausystem/utils/ChatMessageBuilder.java b/BauSystem_Main/src/de/steamwar/bausystem/utils/ChatMessageBuilder.java deleted file mode 100644 index f8c819f4..00000000 --- a/BauSystem_Main/src/de/steamwar/bausystem/utils/ChatMessageBuilder.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * This file is a part of the SteamWar software. - * - * Copyright (C) 2021 SteamWar.de-Serverteam - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package de.steamwar.bausystem.utils; - -import de.steamwar.bausystem.config.ColorConfig; -import org.bukkit.entity.Player; - -import java.util.ArrayList; -import java.util.List; - -public class ChatMessageBuilder { - - private List messages = new ArrayList<>(); - private String[] strings = new String[0]; - - public ChatMessageBuilder() { - messages.add(new StringBuilder()); - } - - public ChatMessageBuilder highlight(String s) { - messages.get(messages.size() - 1).append(ColorConfig.HIGHLIGHT).append(s); - return this; - } - - public ChatMessageBuilder base(String s) { - messages.get(messages.size() - 1).append(ColorConfig.BASE).append(s); - return this; - } - - public ChatMessageBuilder other(String s) { - messages.get(messages.size() - 1).append(ColorConfig.OTHER).append(s); - return this; - } - - public ChatMessageBuilder enable(String s) { - messages.get(messages.size() - 1).append(ColorConfig.ENABLE).append(s); - return this; - } - - public ChatMessageBuilder disable(String s) { - messages.get(messages.size() - 1).append(ColorConfig.DISABLE).append(s); - return this; - } - - public ChatMessageBuilder error(String s) { - messages.get(messages.size() - 1).append(ColorConfig.ERROR).append(s); - return this; - } - - public ChatMessageBuilder append(String s) { - messages.get(messages.size() - 1).append(s); - return this; - } - - public ChatMessageBuilder newLine() { - messages.add(new StringBuilder()); - return this; - } - - public ChatMessageBuilder finish() { - strings = messages.stream().map(StringBuilder::toString).toArray(String[]::new); - return this; - } - - public void send(Player player) { - for (String message : strings) { - player.sendMessage(message); - } - } - -}