Adding bauinfo command
Dieser Commit ist enthalten in:
Ursprung
1c4d6d65d1
Commit
2090cfbd62
@ -74,6 +74,7 @@ public class BauSystem extends JavaPlugin implements Listener {
|
||||
getCommand("fire").setExecutor(new CommandFire());
|
||||
getCommand("testblock").setExecutor(new CommandTestblock());
|
||||
getCommand("bau").setExecutor(new CommandBau());
|
||||
getCommand("bauinfo").setExecutor(new CommandInfo());
|
||||
|
||||
Bukkit.getPluginManager().registerEvents(this, this);
|
||||
Bukkit.getPluginManager().registerEvents(new RegionListener(), this);
|
||||
|
34
src/de/steamwar/bausystem/commands/CommandInfo.java
Normale Datei
34
src/de/steamwar/bausystem/commands/CommandInfo.java
Normale Datei
@ -0,0 +1,34 @@
|
||||
package de.steamwar.bausystem.commands;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.sql.Bauwelt;
|
||||
import de.steamwar.bausystem.sql.BauweltMember;
|
||||
import de.warking.hunjy.MySQL.WarkingUser;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CommandInfo implements CommandExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
Bauwelt welt = BauSystem.getWelt();
|
||||
sender.sendMessage(BauSystem.PREFIX + "Besitzer: §e" + WarkingUser.get(welt.getUserID()).getUserName());
|
||||
sender.sendMessage(BauSystem.PREFIX + "TNT-Schaden: " + (welt.isTNTDmg() ? "§aAN" : "§cAUS"));
|
||||
sender.sendMessage(BauSystem.PREFIX + "Feuerschaden: " + (welt.isFireDmg() ? "§aAN" : "§cAUS"));
|
||||
|
||||
List<BauweltMember> members = BauweltMember.getMembers(welt.getUserID());
|
||||
StringBuilder membermessage = new StringBuilder().append(BauSystem.PREFIX).append("Mitglieder: ");
|
||||
|
||||
for (BauweltMember member : members) {
|
||||
membermessage.append("§e").append(WarkingUser.get(member.getMemberID()).getUserName()).append("§8[");
|
||||
membermessage.append(member.isBuild() ? "§a" : "§c").append("B").append("§8,");
|
||||
membermessage.append(member.isWorldEdit() ? "§a" : "§c").append("WE").append("§8,");
|
||||
membermessage.append(member.isWorld() ? "§a" : "§c").append("W").append("§8]").append(" ");
|
||||
}
|
||||
sender.sendMessage(membermessage.toString());
|
||||
return false;
|
||||
}
|
||||
}
|
@ -11,6 +11,7 @@ commands:
|
||||
testblock:
|
||||
reset:
|
||||
bau:
|
||||
bauinfo:
|
||||
speed:
|
||||
nightvision:
|
||||
aliases: nv
|
In neuem Issue referenzieren
Einen Benutzer sperren