TotalFreedomMod/src/main/java/me/totalfreedom/totalfreedommod/command/Command_attributelist.java

31 lines
1,017 B
Java
Raw Normal View History

2018-02-23 06:49:12 +00:00
package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.rank.Rank;
import org.bukkit.attribute.Attribute;
2018-02-23 06:49:12 +00:00
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
2019-01-29 04:57:41 +00:00
@CommandParameters(description = "Lists all possible attributes.", usage = "/<command>")
2018-02-23 06:49:12 +00:00
public class Command_attributelist extends FreedomCommand
{
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
StringBuilder list = new StringBuilder("All possible attributes: ");
2018-02-23 06:49:12 +00:00
for (Attribute attribute : Attribute.values())
{
list.append(attribute.name()).append(", ");
2018-02-23 06:49:12 +00:00
}
// Remove extra comma at the end of the list
list = new StringBuilder(list.substring(0, list.length() - 2));
2018-02-23 06:49:12 +00:00
msg(list.toString());
2018-02-23 06:49:12 +00:00
return true;
}
}