From f2f204ca7874e1dafdd08c0e6da7837d50cb30d1 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 27 Dec 2021 13:59:50 +0100 Subject: [PATCH] Update WaterVisionCommand Signed-off-by: yoyosource --- BauSystem_Main/src/BauSystem.properties | 4 +++ .../features/util/WaterVisionCommand.java | 27 ++++++++----------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 13b735f2..642d42c5 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -1061,6 +1061,10 @@ TNT_CLICK_VELOCITY_X = §7Velocity §eX§8: §e{0} TNT_CLICK_VELOCITY_Y = §7Velocity §eY§8: §e{0} TNT_CLICK_VELOCITY_Z = §7Velocity §eZ§8: §e{0} +WATER_VISION_HELP = §8/§ewatervision §8- §7Schalte Watervision an oder aus. +WATER_VISION_DISABLE = §eWassersicht deaktiviert +WATER_VISION_ENABLE = §eWassersicht aktiviert + #Select Util SELECT_GUI_CHOOSE_EXTENSION = Extension auswählen SELECT_GUI_CHOOSE_SELECTION = Auswahl auswählen diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/WaterVisionCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/WaterVisionCommand.java index ce1ac4bf..bef8e245 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/WaterVisionCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/WaterVisionCommand.java @@ -19,11 +19,11 @@ package de.steamwar.bausystem.features.util; -import de.steamwar.bausystem.SWUtils; -import de.steamwar.bausystem.config.ColorConfig; +import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.command.SWCommand; +import net.md_5.bungee.api.ChatMessageType; import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; @@ -35,19 +35,14 @@ public class WaterVisionCommand extends SWCommand { super("watervision", "wv"); } - @Register(help = true) - public void help(final Player p, final String... args) { - p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "watervision " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Schalte Watervision an oder aus."); - } - - @Register + @Register(description = "WATER_VISION_HELP") public void genericCommand(Player p) { - if (p.hasPotionEffect(PotionEffectType.WATER_BREATHING)) { - p.removePotionEffect(PotionEffectType.WATER_BREATHING); - SWUtils.sendToActionbar(p, ColorConfig.HIGHLIGHT + "Wassersicht deaktiviert"); - return; - } - p.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 1000000, 255, false, false)); - SWUtils.sendToActionbar(p, ColorConfig.HIGHLIGHT + "Wassersicht aktiviert"); - } + if (p.hasPotionEffect(PotionEffectType.WATER_BREATHING)) { + p.removePotionEffect(PotionEffectType.WATER_BREATHING); + BauSystem.MESSAGE.sendPrefixless("WATER_VISION_DISABLE", p, ChatMessageType.ACTION_BAR); + return; + } + p.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 1000000, 255, false, false)); + BauSystem.MESSAGE.sendPrefixless("WATER_VISION_ENABLE", p, ChatMessageType.ACTION_BAR); + } } \ No newline at end of file