SteamWar/BauSystem2.0
Archiviert
12
0

Update NightVisionCommand

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-12-27 15:53:26 +01:00
Ursprung 5d4495292e
Commit 5522fa24c9

Datei anzeigen

@ -20,10 +20,10 @@
package de.steamwar.bausystem.features.util;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.SWUtils;
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,20 +35,14 @@ public class NightVisionCommand extends SWCommand {
super("nightvision", "nv", "light");
}
@Register(help = true)
public void genericHelp(Player p, String... args) {
BauSystem.MESSAGE.sendPrefixless("COMMAND_HELP_HEAD", p, "DebugStick");
BauSystem.MESSAGE.sendPrefixless("NIGHT-VISION_COMMAND_HELP", p);
}
@Register
@Register(description = "VISION_COMMAND_HELP")
public void genericCommand(Player p) {
if (p.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
p.removePotionEffect(PotionEffectType.NIGHT_VISION);
SWUtils.sendToActionbar(p, BauSystem.MESSAGE.parse("NIGHT-VISION_OFF", p));
BauSystem.MESSAGE.sendPrefixless("NIGHT-VISION_OFF", p, ChatMessageType.ACTION_BAR);
return;
}
p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 1000000, 255, false, false));
SWUtils.sendToActionbar(p, BauSystem.MESSAGE.parse("NIGHT-VISION_ON", p));
BauSystem.MESSAGE.sendPrefixless("NIGHT-VISION_ON", p, ChatMessageType.ACTION_BAR);
}
}