From 5784cdc446c7e583c648a5be670317471d344577 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 29 Jul 2022 23:12:58 +0200 Subject: [PATCH] Update TechHiderCommand Signed-off-by: yoyosource --- BauSystem_Main/src/BauSystem.properties | 6 ++++++ BauSystem_Main/src/BauSystem_de.properties | 6 ++++++ .../bausystem/features/techhider/TechHiderCommand.java | 7 ++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index c5c1c613..c558fe10 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -1266,3 +1266,9 @@ STOP_HELP = §8/§estop §8- §7Stops the server STOP_NO_PERMS = §cYou do not have the permission to stop the server STOP_MESSAGE = §eServer is stopping WORLD_EDIT_NO_PERMS = §cYou do not have the permission to use WorldEdit + +# Techhider +TECHHIDER_HELP = §8/§etechhider §8- §7Toggle Techhider +TECHHIDER_GLOBAL = §cNo techhider in global region +TECHHIDER_ON = §aTechhider activated +TECHHIDER_OFF = §aTechhider deactivated diff --git a/BauSystem_Main/src/BauSystem_de.properties b/BauSystem_Main/src/BauSystem_de.properties index a2b671bc..e7dba5e6 100644 --- a/BauSystem_Main/src/BauSystem_de.properties +++ b/BauSystem_Main/src/BauSystem_de.properties @@ -1246,3 +1246,9 @@ STOP_HELP = §8/§estop §8- §7Stoppt den Server STOP_NO_PERMS = §cDu hast keine Rechte den Server zu stoppen STOP_MESSAGE = §eDer Server wird gestoppt WORLD_EDIT_NO_PERMS = §cDu darfst hier kein WorldEdit benutzen + +# Techhider +TECHHIDER_HELP = §8/§etechhider §8- §7Techhider umschalten +TECHHIDER_GLOBAL = §cKein Techhider in der globalen region +TECHHIDER_ON = §aTechhider aktiviert +TECHHIDER_OFF = §aTechHider deaktiviert diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/techhider/TechHiderCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/techhider/TechHiderCommand.java index b9d857b4..46e3c33d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/techhider/TechHiderCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/techhider/TechHiderCommand.java @@ -19,12 +19,14 @@ package de.steamwar.bausystem.features.techhider; +import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.region.Region; import de.steamwar.command.SWCommand; import de.steamwar.core.CraftbukkitWrapper; import de.steamwar.techhider.TechHider; +import net.md_5.bungee.api.ChatMessageType; import org.bukkit.Material; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; @@ -48,10 +50,11 @@ public class TechHiderCommand extends SWCommand implements Listener { private Map> techHiders = new HashMap<>(); private Map> hidden = new HashMap<>(); - @Register + @Register(description = "TECHHIDER_HELP") public void toggleHider(Player player) { Region region = Region.getRegion(player.getLocation()); if (region.isGlobal()) { + BauSystem.MESSAGE.send("TECHHIDER_GLOBAL", player); return; } @@ -83,8 +86,10 @@ public class TechHiderCommand extends SWCommand implements Listener { if (hidden.get(region).contains(player)) { hidden.get(region).remove(player); + BauSystem.MESSAGE.send("TECHHIDER_OFF", player, ChatMessageType.ACTION_BAR); } else { hidden.get(region).add(player); + BauSystem.MESSAGE.send("TECHHIDER_ON", player, ChatMessageType.ACTION_BAR); } region.forEachChunk((x, z) -> { CraftbukkitWrapper.impl.sendChunk(player, x, z);