added command to get current totem mode

master
Benjamin Kraft 3 years ago
parent cbc506d720
commit 1b720ac932
  1. 8
      src/main/java/com/benjocraeft/sharehealth/Commands.java

@ -55,6 +55,9 @@ public class Commands implements TabExecutor {
putTotemCommand.apply("getfraction").apply((sender, arg) -> commandGetTotemFraction(sender)).accept(
"Totem of Undying: Get amount for mode: fraction."
);
putTotemCommand.apply("get").apply((sender, arg) -> commandGetTotemMode(sender)).accept(
"Totem of Undying: Get current mode."
);
commands.put(
Arrays.asList("log", "on"),
Pair.pair((sender, arg) -> commandSetLogging(sender, true), "Enables Logging.")
@ -182,6 +185,11 @@ public class Commands implements TabExecutor {
sender.sendMessage("Set Totem mode to " + mode.name());
}
private void commandGetTotemMode(CommandSender sender){
TotemManager.Mode mode = Sharehealth.Instance.getTotemManager().getMode();
sender.sendMessage("Current Totem mode: " + mode.name());
}
private void commandSetTotemFraction(CommandSender sender, String amountStr){
if (!sender.hasPermission("sharehealth.totem")){
sender.sendMessage("You don't have permissions for this command!");

Loading…
Cancel
Save