From f95fb01eb12cdaa4c671f107b67585ebb79259ff Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 9 Apr 2021 18:43:53 +0200 Subject: [PATCH] Update CommandProtect message sending Add CommandInfo protect status --- .../de/steamwar/bausystem/commands/CommandInfo.java | 12 +++++++++--- .../steamwar/bausystem/commands/CommandProtect.java | 6 ++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandInfo.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandInfo.java index c6b245d..f3c9b31 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandInfo.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandInfo.java @@ -20,8 +20,8 @@ package de.steamwar.bausystem.commands; import de.steamwar.bausystem.BauSystem; -import de.steamwar.bausystem.world.regions.Region; import de.steamwar.bausystem.world.TPSUtils; +import de.steamwar.bausystem.world.regions.Region; import de.steamwar.command.SWCommand; import de.steamwar.core.TPSWatcher; import de.steamwar.sql.BauweltMember; @@ -52,11 +52,15 @@ public class CommandInfo extends SWCommand { p.sendMessage(BauSystem.PREFIX + "Besitzer: §e" + SteamwarUser.get(BauSystem.getOwnerID()).getUserName()); Region region = Region.getRegion(p.getLocation()); p.sendMessage(BauSystem.PREFIX + "§eTNT§8: " + region.getTntMode().getName() + " §eFire§8: " + (region.isFire() ? "§aAUS" : "§cAN") + " §eFreeze§8: " + (region.isFreeze() ? "§aAN" : "§cAUS")); + if (region.hasProtection()) { + p.sendMessage(BauSystem.PREFIX + "§eProtect§8: " + (region.isProtect() ? "§aAN" : "§cAUS")); + } List members = BauweltMember.getMembers(BauSystem.getOwnerID()); StringBuilder membermessage = new StringBuilder().append(BauSystem.PREFIX).append("Mitglieder: "); - for (BauweltMember member : members) { + for ( + BauweltMember member : members) { membermessage.append("§e").append(SteamwarUser.get(member.getMemberID()).getUserName()).append("§8["); membermessage.append(member.isWorldEdit() ? "§a" : "§c").append("WE").append("§8,"); membermessage.append(member.isWorld() ? "§a" : "§c").append("W").append("§8]").append(" "); @@ -64,7 +68,9 @@ public class CommandInfo extends SWCommand { p.sendMessage(membermessage.toString()); StringBuilder tpsMessage = new StringBuilder(); - tpsMessage.append(BauSystem.PREFIX).append("TPS:§e"); + tpsMessage.append(BauSystem.PREFIX). + + append("TPS:§e"); tpsMessage.append(" ").append(getTps(TPSWatcher.TPSType.ONE_SECOND)); tpsMessage.append(" ").append(getTps(TPSWatcher.TPSType.TEN_SECONDS)); if (!TPSUtils.isWarping()) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java index 117e8d7..249d512 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java @@ -23,8 +23,6 @@ import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.world.Welt; import de.steamwar.bausystem.world.regions.Region; -import de.steamwar.bausystem.world.regions.RegionExtensionType; -import de.steamwar.bausystem.world.regions.RegionType; import de.steamwar.command.SWCommand; import de.steamwar.sql.Schematic; import org.bukkit.Bukkit; @@ -59,9 +57,9 @@ public class CommandProtect extends SWCommand implements Listener { if (Region.buildAreaEnabled()) { region.setProtect(!region.isProtect()); if (region.isProtect()) { - p.sendMessage(BauSystem.PREFIX + "§7Boden geschützt"); + RegionUtils.actionBar(region, "§aBoden geschützt"); } else { - p.sendMessage(BauSystem.PREFIX + "§7Boden Schutz aufgehoben"); + RegionUtils.actionBar(region, "§cBoden Schutz aufgehoben"); } return; }