Upload folder via GUI - src
This commit is contained in:
@@ -981,6 +981,13 @@ public class StatusAPI extends Plugin implements Runnable {
|
||||
}
|
||||
playerInfo.put("prefix", prefix);
|
||||
|
||||
// Aktueller Sub-Server des Spielers (z.B. "Lobby", "Survival")
|
||||
try {
|
||||
if (p.getServer() != null && p.getServer().getInfo() != null) {
|
||||
playerInfo.put("server", p.getServer().getInfo().getName());
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
|
||||
if (statsModule != null) {
|
||||
PlayerStats ps = statsModule.getManager().getIfPresent(p.getUniqueId());
|
||||
if (ps != null) {
|
||||
|
||||
@@ -312,11 +312,19 @@ public class NetworkInfoModule implements Module {
|
||||
out.put("features", buildFeatureSummary());
|
||||
|
||||
if (includePlayerNames) {
|
||||
List<String> names = new ArrayList<String>();
|
||||
List<Map<String, Object>> playerNames = new ArrayList<Map<String, Object>>();
|
||||
for (ProxiedPlayer p : ProxyServer.getInstance().getPlayers()) {
|
||||
names.add(p.getName());
|
||||
Map<String, Object> entry = new LinkedHashMap<String, Object>();
|
||||
entry.put("name", p.getName());
|
||||
try { entry.put("uuid", p.getUniqueId().toString()); } catch (Exception ignored) {}
|
||||
try {
|
||||
if (p.getServer() != null && p.getServer().getInfo() != null) {
|
||||
entry.put("server", p.getServer().getInfo().getName());
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
playerNames.add(entry);
|
||||
}
|
||||
out.put("player_names", names);
|
||||
out.put("player_names", playerNames);
|
||||
}
|
||||
|
||||
return out;
|
||||
|
||||
@@ -45,6 +45,7 @@ public class TablistModule implements Module, Listener {
|
||||
private static final int ROWS = 20;
|
||||
private int rows = ROWS, columns = 6, total = 120, tabSizeMax = 180;
|
||||
private int configuredTabSize = 180; // Default: 180 (9 Spalten möglich)
|
||||
private int configuredColumns = 0; // 0 = automatisch, >0 = direkt nutzen
|
||||
private UUID[] fakeUuids;
|
||||
|
||||
// Skin-Cache (pro Spieler)
|
||||
@@ -188,7 +189,11 @@ public class TablistModule implements Module, Listener {
|
||||
boolean hasInfo = !"compact".equalsIgnoreCase(layoutMode);
|
||||
int serverCount = getServerOrder().size();
|
||||
int needed = (hasInfo ? 1 : 0) + Math.max(1, serverCount);
|
||||
columns = Math.max(hasInfo ? 2 : 1, Math.min(needed, tabSize / ROWS));
|
||||
if (configuredColumns > 0) {
|
||||
columns = configuredColumns;
|
||||
} else {
|
||||
columns = Math.max(hasInfo ? 2 : 1, Math.min(needed, tabSize / ROWS));
|
||||
}
|
||||
total = ROWS * columns;
|
||||
if (needed > tabSize / ROWS) {
|
||||
plugin.getLogger().warning("[TablistModule] Nicht alle Server passen in die Tablist!");
|
||||
@@ -287,8 +292,12 @@ public class TablistModule implements Module, Listener {
|
||||
} else {
|
||||
int serverCount = getServerOrder().size();
|
||||
int needed = (hasInfo ? 1 : 0) + Math.max(1, serverCount);
|
||||
int effectiveTabMax = configuredTabSize > 0 ? configuredTabSize : tabSizeMax;
|
||||
newColumns = Math.max(hasInfo ? 2 : 1, Math.min(needed, effectiveTabMax / ROWS));
|
||||
if (configuredColumns > 0) {
|
||||
newColumns = configuredColumns;
|
||||
} else {
|
||||
int effectiveTabMax = configuredTabSize > 0 ? configuredTabSize : tabSizeMax;
|
||||
newColumns = Math.max(hasInfo ? 2 : 1, Math.min(needed, effectiveTabMax / ROWS));
|
||||
}
|
||||
}
|
||||
int newTotal = ROWS * newColumns;
|
||||
// Nur abbrechen wenn Grid identisch UND fakeUuids bereits korrekt initialisiert
|
||||
@@ -1196,6 +1205,7 @@ public class TablistModule implements Module, Listener {
|
||||
java.util.function.BiFunction<String,String,String> get = (k,d) -> map.getOrDefault(k,d);
|
||||
|
||||
configuredTabSize = parseInt(get.apply("tablist.tab_size", "0"), 0);
|
||||
configuredColumns = parseInt(get.apply("tablist.columns", "0"), 0);
|
||||
enabled = Boolean.parseBoolean(get.apply("tablist.enabled", "true"));
|
||||
updateInterval = parseInt(get.apply("tablist.update_interval", "5"), 5);
|
||||
layoutMode = get.apply("tablist.layout", "compact").trim().toLowerCase();
|
||||
@@ -1240,7 +1250,7 @@ public class TablistModule implements Module, Listener {
|
||||
|
||||
serverOrder.clear();
|
||||
String raw = get.apply("tablist.server_order", "").trim();
|
||||
if (!raw.isEmpty()) for (String s : raw.split(",")) { String t=s.trim(); if(!t.isEmpty()) serverOrder.add(t.toLowerCase()); }
|
||||
if (!raw.isEmpty()) for (String s : raw.split(",")) { String t=s.trim(); if(!t.isEmpty()) serverOrder.add(t); }
|
||||
|
||||
hiddenServers.clear();
|
||||
String hRaw = get.apply("tablist.hidden_servers", "").trim();
|
||||
|
||||
@@ -91,9 +91,12 @@ public class VanishModule implements Module, Listener {
|
||||
public void onLogin(PostLoginEvent e) {
|
||||
ProxiedPlayer player = e.getPlayer();
|
||||
if (persistentVanished.contains(player.getUniqueId())) {
|
||||
// Status SOFORT setzen – kein Delay, damit das ChatModule (2s-Task)
|
||||
// den Vanish-Status garantiert vorfindet und keine Join-Nachricht sendet.
|
||||
VanishProvider.setVanished(player.getUniqueId(), true);
|
||||
// Kurze Bestätigung an den Spieler selbst (nach kurzem Delay damit
|
||||
// der Client bereit ist)
|
||||
|
||||
// Nur die Bestätigungsnachricht an den Spieler wird verzögert,
|
||||
// damit der Client bereit ist.
|
||||
plugin.getProxy().getScheduler().schedule(plugin, () -> {
|
||||
if (player.isConnected()) {
|
||||
player.sendMessage(color("&8[&7Vanish&8] &7Du bist &cUnsichtbar&7."));
|
||||
|
||||
Reference in New Issue
Block a user