|
|
|
@ -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());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|