Upload folder via GUI - src

This commit is contained in:
Git Manager GUI
2026-04-29 16:55:46 +02:00
parent c25050b88a
commit d1618d45c8
2 changed files with 123 additions and 0 deletions

View File

@@ -199,6 +199,7 @@ public class IngameShopSpigot extends JavaPlugin implements Listener {
getCommand("plotabocancel").setExecutor(new PlotAboCancelCommand());
getCommand("plotabogive").setExecutor(new PlotAboGiveCommand());
getCommand("plotslotsgive").setExecutor(new PlotSlotsGiveCommand());
getCommand("abo").setExecutor(new AboOverviewCommand());
getCommand("sell").setExecutor(new SellCommand());
getCommand("wpis").setExecutor(new ReloadCommand());
@@ -1364,6 +1365,121 @@ public class IngameShopSpigot extends JavaPlugin implements Listener {
// ===========================================================
/** /flyabo Abo-Status anzeigen */
// ===========================================================
// /abo ÜBERSICHT ALLER LAUFENDEN ABOS
// ===========================================================
private class AboOverviewCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if (!(sender instanceof Player)) { sender.sendMessage("Nur für Spieler."); return true; }
Player p = (Player) sender;
new BukkitRunnable() {
@Override public void run() {
// Alle Daten async laden
FlyAboManager.AboEntry flyAbo = flyAboManager.getActiveAbo(p.getName());
PlotSlotManager.PlotAboEntry plotAbo = plotSlotManager.getActiveAbo(p.getName());
int flyUsedSec = flyAboManager.getUsedTodaySec(p.getName());
int plotBase = plotSlotManager.getRankBaseByName(p.getName());
int plotExtra = plotSlotManager.getExtraSlots(p.getName());
int plotAboSlots= plotSlotManager.getAboSlots(p.getName());
int plotTotal = plotBase + plotExtra + plotAboSlots;
Bukkit.getScheduler().runTask(IngameShopSpigot.this, () -> {
String line = ChatColor.GOLD + "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━";
p.sendMessage("");
p.sendMessage(line);
p.sendMessage(ChatColor.YELLOW + "" + ChatColor.BOLD + " 📋 Meine Abonnements");
p.sendMessage(line);
boolean hasAny = false;
// ── Fly-Abo ──────────────────────────────────────────
if (flyAbo != null) {
hasAny = true;
boolean cancelled = flyAbo.cancelled;
boolean payFail = "payment_failed".equals(flyAbo.cancellationReason);
p.sendMessage("");
p.sendMessage(ChatColor.AQUA + "" + ChatColor.BOLD + " ✈ Fly-Abo");
p.sendMessage(ChatColor.GRAY + " ┌ Paket: " + ChatColor.WHITE + flyAbo.label);
p.sendMessage(ChatColor.GRAY + " ├ Preis: " + ChatColor.WHITE + flyAbo.monthlyPrice + " " + currency + " / Monat");
if (cancelled) {
p.sendMessage(ChatColor.GRAY + " ├ Status: " + ChatColor.RED
+ "⚠ Gekündigt" + (payFail ? " (Zahlung fehlgeschlagen)" : " (durch dich)"));
p.sendMessage(ChatColor.GRAY + " ├ Endet am: " + ChatColor.YELLOW + flyAbo.periodEnd);
} else {
p.sendMessage(ChatColor.GRAY + " ├ Status: " + ChatColor.GREEN + "✔ Aktiv");
p.sendMessage(ChatColor.GRAY + " ├ Aktiv bis: " + ChatColor.WHITE + flyAbo.periodEnd);
p.sendMessage(ChatColor.GRAY + " ├ Nächste Abbuchung: " + ChatColor.WHITE + flyAbo.nextBillingDate);
}
int remSec = Math.max(0, flyAboMaxDailySec - flyUsedSec);
p.sendMessage(ChatColor.GRAY + " ├ Heute: "
+ ChatColor.WHITE + flyManager.formatTime(flyUsedSec)
+ ChatColor.GRAY + " / " + ChatColor.WHITE + flyManager.formatTime(flyAboMaxDailySec)
+ ChatColor.GRAY + " (noch: "
+ (remSec > 0 ? ChatColor.GREEN : ChatColor.RED) + flyManager.formatTime(remSec) + ChatColor.GRAY + ")");
if (!cancelled)
p.sendMessage(ChatColor.GRAY + " └ Kündigen: " + ChatColor.WHITE + "/flyabocancel confirm");
else
p.sendMessage(ChatColor.GRAY + " └ Erneuern: " + ChatColor.AQUA + "viper-network.de");
}
// ── Plot-Abo ──────────────────────────────────────────
if (plotAbo != null) {
hasAny = true;
boolean cancelled = plotAbo.cancelled;
boolean payFail = "payment_failed".equals(plotAbo.cancellationReason);
p.sendMessage("");
p.sendMessage(ChatColor.AQUA + "" + ChatColor.BOLD + " 📦 Plot-Abo");
p.sendMessage(ChatColor.GRAY + " ┌ Paket: " + ChatColor.WHITE + plotAbo.label);
p.sendMessage(ChatColor.GRAY + " ├ Slots: " + ChatColor.WHITE + "+" + plotAbo.aboSlots + " Plot-Slots");
p.sendMessage(ChatColor.GRAY + " ├ Preis: " + ChatColor.WHITE + plotAbo.monthlyPrice + " " + currency + " / Monat");
if (cancelled) {
p.sendMessage(ChatColor.GRAY + " ├ Status: " + ChatColor.RED
+ "⚠ Gekündigt" + (payFail ? " (Zahlung fehlgeschlagen)" : " (durch dich)"));
p.sendMessage(ChatColor.GRAY + " └ Endet am: " + ChatColor.YELLOW + plotAbo.periodEnd);
} else {
p.sendMessage(ChatColor.GRAY + " ├ Status: " + ChatColor.GREEN + "✔ Aktiv");
p.sendMessage(ChatColor.GRAY + " ├ Aktiv bis: " + ChatColor.WHITE + plotAbo.periodEnd);
p.sendMessage(ChatColor.GRAY + " ├ Nächste Abbuchung: " + ChatColor.WHITE + plotAbo.nextBillingDate);
p.sendMessage(ChatColor.GRAY + " └ Kündigen: " + ChatColor.WHITE + "/plotabocancel confirm");
}
}
// ── Plot-Slots Übersicht (immer anzeigen) ─────────────
p.sendMessage("");
p.sendMessage(ChatColor.AQUA + "" + ChatColor.BOLD + " 📦 Plot-Slots");
p.sendMessage(ChatColor.GRAY + " ┌ Rang-Basis: " + ChatColor.WHITE + plotBase);
p.sendMessage(ChatColor.GRAY + " ├ Einmalig: " + ChatColor.WHITE + (plotExtra > 0 ? "+" + plotExtra : "0"));
p.sendMessage(ChatColor.GRAY + " ├ Abo: " + ChatColor.WHITE + (plotAboSlots > 0 ? "+" + plotAboSlots : "0"));
p.sendMessage(ChatColor.GRAY + " └ Gesamt: " + ChatColor.GREEN + "" + ChatColor.BOLD + plotTotal + " Slots");
// ── Kein Abo ──────────────────────────────────────────
if (!hasAny) {
p.sendMessage("");
p.sendMessage(ChatColor.GRAY + " Du hast derzeit keine aktiven Abonnements.");
p.sendMessage(ChatColor.GRAY + " Im Shop erhältlich: " + ChatColor.AQUA + "viper-network.de");
}
p.sendMessage("");
p.sendMessage(line);
p.sendMessage("");
});
}
}.runTaskAsynchronously(IngameShopSpigot.this);
return true;
}
}
private class FlyAboCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command,

View File

@@ -43,6 +43,10 @@ commands:
description: IngameShop Admin-Befehle
usage: /wpis <reload>
permission: ingameshop.reload
abo:
description: Zeigt eine Übersicht aller deiner laufenden Abonnements
usage: /abo
permission: ingameshop.abo
flyabo:
description: Zeigt deinen Fly-Abo Status und heutiges Tageslimit
usage: /flyabo
@@ -104,6 +108,9 @@ permissions:
ingameshop.reload:
description: Kann die IngameShop-Config live neu laden
default: op
ingameshop.abo:
description: Kann eigene Abo-Übersicht einsehen
default: true
ingameshop.flyabo:
description: Kann eigenen Fly-Abo-Status einsehen
default: true