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