1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-18 05:11:32 +01:00

new command to print out all posible entities to be used with plugin

This commit is contained in:
Zrips 2017-01-10 16:36:20 +02:00
parent 14bfe9998a
commit 7edb06d6d6
3 changed files with 56 additions and 0 deletions

View File

@ -52,3 +52,4 @@
/fillprot$1.class
/bp$1.class
/bp.class
/entitylist.class

View File

@ -0,0 +1,52 @@
package com.gamingmesh.jobs.commands.list;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.EntityType;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.commands.Cmd;
import com.gamingmesh.jobs.commands.JobCommand;
import net.md_5.bungee.api.ChatColor;
public class entitylist implements Cmd {
@Override
@JobCommand(1450)
public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) {
if (args.length != 0) {
Jobs.getCommandManager().sendUsage(sender, "entitylist");
return true;
}
String msg = "";
String c1 = "&e";
String c2 = "&6";
int i = 0;
for (EntityType type : EntityType.values()) {
if (!type.isAlive())
continue;
if (!type.isSpawnable())
continue;
i++;
if (!msg.isEmpty())
msg += ", ";
if (i > 1) {
msg += c1;
i = 0;
} else {
msg += c2;
}
msg += type.name().toLowerCase();
}
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
return true;
}
}

View File

@ -165,6 +165,9 @@ public class LanguageManager {
c.get("command.blockinfo.output.id", " &eBlock id: &6%blockid%");
c.get("command.blockinfo.output.data", " &eBlock data: &6%blockdata%");
c.get("command.blockinfo.output.usage", " &eUsage: &6%first% &eor &6%second%");
c.get("command.entitylist.help.info", "Shows all possible entities can be used with plugin.");
c.get("command.entitylist.help.args", "");
c.get("command.stats.help.info", "Show the level you are in each job you are part of.");
c.get("command.stats.help.args", "[playername]");