SteamWar/BauSystem
Archiviert
13
0

Update CommandInfo to new SWCommand system

Dieser Commit ist enthalten in:
yoyosource 2021-04-01 20:54:01 +02:00
Ursprung 87ed69478f
Commit d2c23a1b47
3 geänderte Dateien mit 13 neuen und 19 gelöschten Zeilen

Datei anzeigen

@ -85,7 +85,7 @@ public class BauSystem extends JavaPlugin implements Listener {
getCommand("fire").setExecutor(new CommandFire());
getCommand("freeze").setExecutor(new CommandFreeze());
new CommandTestblock();
getCommand("bauinfo").setExecutor(new CommandInfo());
new CommandInfo();
new CommandProtect();
new CommandSkull();
new CommandLoader();

Datei anzeigen

@ -22,30 +22,27 @@ package de.steamwar.bausystem.commands;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.world.Region;
import de.steamwar.bausystem.world.TPSUtils;
import de.steamwar.command.SWCommand;
import de.steamwar.core.TPSWatcher;
import de.steamwar.sql.BauweltMember;
import de.steamwar.sql.SteamwarUser;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.List;
import static de.steamwar.bausystem.world.TPSUtils.getTps;
public class CommandInfo implements CommandExecutor {
public class CommandInfo extends SWCommand {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) {
return false;
}
Player player = (Player) sender;
public CommandInfo() {
super("bauinfo", "info");
}
sender.sendMessage(BauSystem.PREFIX + "Besitzer: §e" + SteamwarUser.get(BauSystem.getOwnerID()).getUserName());
Region region = Region.getRegion(player.getLocation());
sender.sendMessage(BauSystem.PREFIX + "§eTNT§8: " + region.getTntMode().getName() + " §eFire§8: " + (region.isFire() ? "§aAUS" : "§cAN") + " §eFreeze§8: " + (region.isFreeze() ? "§aAN" : "§cAUS"));
@Register
public void genericCommand(Player p) {
p.sendMessage(BauSystem.PREFIX + "Besitzer: §e" + SteamwarUser.get(BauSystem.getOwnerID()).getUserName());
Region region = Region.getRegion(p.getLocation());
p.sendMessage(BauSystem.PREFIX + "§eTNT§8: " + region.getTntMode().getName() + " §eFire§8: " + (region.isFire() ? "§aAUS" : "§cAN") + " §eFreeze§8: " + (region.isFreeze() ? "§aAN" : "§cAUS"));
List<BauweltMember> members = BauweltMember.getMembers(BauSystem.getOwnerID());
StringBuilder membermessage = new StringBuilder().append(BauSystem.PREFIX).append("Mitglieder: ");
@ -56,7 +53,7 @@ public class CommandInfo implements CommandExecutor {
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());
p.sendMessage(membermessage.toString());
StringBuilder tpsMessage = new StringBuilder();
tpsMessage.append(BauSystem.PREFIX).append("TPS:§e");
@ -67,8 +64,6 @@ public class CommandInfo implements CommandExecutor {
tpsMessage.append(" ").append(TPSWatcher.getTPS(TPSWatcher.TPSType.FIVE_MINUTES));
tpsMessage.append(" ").append(TPSWatcher.getTPS(TPSWatcher.TPSType.TEN_MINUTES));
}
sender.sendMessage(tpsMessage.toString());
return false;
p.sendMessage(tpsMessage.toString());
}
}

Datei anzeigen

@ -10,7 +10,6 @@ description: "So unseriös wie wir sind: BauSystem nur besser."
commands:
fire:
bauinfo:
freeze:
aliases: stoplag
watervision: