Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ec1d905dc | ||
|
|
3a8fe5cf66 | ||
|
|
1a75a7db33 | ||
|
|
be78c34222 | ||
|
|
2460691df2 | ||
|
|
46dc0cbe05 | ||
|
|
79fed93d20 | ||
|
|
c3a8f15f6d | ||
|
|
b46af01475 | ||
|
|
8fe8f2b1af | ||
|
|
ce6847e58e | ||
|
|
95b0e2f971 | ||
|
|
045a5f2b1b | ||
|
|
8a2c3b4277 | ||
|
|
38bbba4c8b | ||
|
|
d92d0d5328 | ||
|
|
a27c174daa | ||
|
|
0dddc0dfb5 | ||
|
|
7fe5bd62c7 | ||
|
|
f7f0a0d532 | ||
|
|
35dded973b | ||
|
|
43dac083d4 | ||
|
|
9c1b980388 | ||
|
|
983ca72aaa | ||
|
|
eed33a4bd7 | ||
|
|
0ede50287f | ||
|
|
6b0d6fa460 |
@@ -1,25 +1,3 @@
|
|||||||
## 🌐 Mehrsprachigkeit & Texte
|
|
||||||
|
|
||||||
Alle Nachrichten, Hilfetexte und Fehler werden zentral über die Datei `lang.yml` im Ordner `src/main/resources` verwaltet. Dort kannst du für jede Sprache (z.B. Deutsch und Englisch) die Texte pflegen und beliebig erweitern.
|
|
||||||
|
|
||||||
**Beispiel für lang.yml:**
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
welcome:
|
|
||||||
de: "Willkommen auf dem Server!"
|
|
||||||
en: "Welcome to the server!"
|
|
||||||
no_permission:
|
|
||||||
de: "§cKeine Berechtigung."
|
|
||||||
en: "§cNo permission."
|
|
||||||
```
|
|
||||||
|
|
||||||
**Sprache umstellen:**
|
|
||||||
Im Code kann die Sprache mit `LangManager.setLanguage("en")` gewechselt werden. Standard ist Deutsch (`de`).
|
|
||||||
|
|
||||||
**Texte ingame nutzen:**
|
|
||||||
Alle Texte werden im Plugin mit `LangManager.get("key")` abgerufen und sind direkt ingame sichtbar. Änderungen in der lang.yml wirken nach einem Reload sofort.
|
|
||||||
|
|
||||||
---
|
|
||||||
# NexusLobby
|
# NexusLobby
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@@ -264,6 +242,29 @@ bossbar:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 🌐 Mehrsprachigkeit & Texte
|
||||||
|
|
||||||
|
Alle Nachrichten, Hilfetexte und Fehler werden zentral über die Datei `lang.yml` im Ordner `src/main/resources` verwaltet. Dort kannst du für jede Sprache (z.B. Deutsch und Englisch) die Texte pflegen und beliebig erweitern.
|
||||||
|
|
||||||
|
**Beispiel für lang.yml:**
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
welcome:
|
||||||
|
de: "Willkommen auf dem Server!"
|
||||||
|
en: "Welcome to the server!"
|
||||||
|
no_permission:
|
||||||
|
de: "§cKeine Berechtigung."
|
||||||
|
en: "§cNo permission."
|
||||||
|
```
|
||||||
|
|
||||||
|
**Sprache umstellen:**
|
||||||
|
Im Code kann die Sprache mit `LangManager.setLanguage("en")` gewechselt werden. Standard ist Deutsch (`de`).
|
||||||
|
|
||||||
|
**Texte ingame nutzen:**
|
||||||
|
Alle Texte werden im Plugin mit `LangManager.get("key")` abgerufen und sind direkt ingame sichtbar. Änderungen in der lang.yml wirken nach einem Reload sofort.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## 🔐 Berechtigungen
|
## 🔐 Berechtigungen
|
||||||
|
|
||||||
### Admin-Berechtigungen
|
### Admin-Berechtigungen
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>de.nexuslobby</groupId>
|
<groupId>de.nexuslobby</groupId>
|
||||||
<artifactId>NexusLobby</artifactId>
|
<artifactId>NexusLobby</artifactId>
|
||||||
<version>1.1.1</version>
|
<version>2.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>NexusLobby</name>
|
<name>NexusLobby</name>
|
||||||
|
|||||||
@@ -0,0 +1,400 @@
|
|||||||
|
## 🌐 Mehrsprachigkeit & Texte
|
||||||
|
|
||||||
|
Alle Nachrichten, Hilfetexte und Fehler werden zentral über die Datei `lang.yml` im Ordner `src/main/resources` verwaltet. Dort kannst du für jede Sprache (z.B. Deutsch und Englisch) die Texte pflegen und beliebig erweitern.
|
||||||
|
|
||||||
|
**Beispiel für lang.yml:**
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
welcome:
|
||||||
|
de: "Willkommen auf dem Server!"
|
||||||
|
en: "Welcome to the server!"
|
||||||
|
no_permission:
|
||||||
|
de: "§cKeine Berechtigung."
|
||||||
|
en: "§cNo permission."
|
||||||
|
```
|
||||||
|
|
||||||
|
**Sprache umstellen:**
|
||||||
|
Im Code kann die Sprache mit `LangManager.setLanguage("en")` gewechselt werden. Standard ist Deutsch (`de`).
|
||||||
|
|
||||||
|
**Texte ingame nutzen:**
|
||||||
|
Alle Texte werden im Plugin mit `LangManager.get("key")` abgerufen und sind direkt ingame sichtbar. Änderungen in der lang.yml wirken nach einem Reload sofort.
|
||||||
|
|
||||||
|
**Chat-Prefix anpassen:**
|
||||||
|
Der Prefix vor Plugin-Nachrichten wird in der Server-`config.yml` über `prefix` festgelegt. Farben können mit `&`-Codes angegeben werden:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
prefix: "&8[&6Nexus&8] "
|
||||||
|
```
|
||||||
|
|
||||||
|
Ändere den Text und die Farben nach Wunsch und lade das Plugin anschließend neu.
|
||||||
|
|
||||||
|
---
|
||||||
|
# NexusLobby
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="https://m-viper.de/img/NexusLobby.png" width="500" alt="NexusLobby">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
Ein umfassendes, modulares Lobby-Plugin für Minecraft Server (Paper/Spigot 1.21+) mit High-End NPC-System, umfangreichen Sicherheitsfunktionen, Soccer-Modul, Parkour-System und voller Konfigurierbarkeit.
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎯 Lizenz und Nutzungsbedingungen
|
||||||
|
|
||||||
|
**ALLE RECHTE VORBEHALTEN**
|
||||||
|
|
||||||
|
Dieses Plugin ist urheberrechtlich geschützt. Es gelten folgende Bedingungen:
|
||||||
|
|
||||||
|
# Scoreboard ausblenden (Opt-out)
|
||||||
|
|
||||||
|
Spieler können das Scoreboard per Befehl ein-/ausblenden. Standardmäßig wird das Scoreboard beim Join angezeigt. Über die Option
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
scoreboard-default-visible: true
|
||||||
|
```
|
||||||
|
|
||||||
|
in der `config.yml` kann festgelegt werden, ob das Scoreboard für neue Spieler standardmäßig sichtbar ist. Bei `false` ist es für alle Spieler nach dem Join ausgeblendet, bis sie es selbst aktivieren.
|
||||||
|
|
||||||
|
- Die Weitergabe, Verbreitung oder Veröffentlichung des Plugins ist **strengstens untersagt**.
|
||||||
|
- Jegliche Änderung, Modifikation oder Dekompilierung des Codes ist **verboten**.
|
||||||
|
- Das Plugin darf nicht verkauft, vermietet oder anderweitig kommerziell genutzt werden.
|
||||||
|
- Eine Weitergabe an Dritte ist ohne ausdrückliche schriftliche Genehmigung nicht gestattet.
|
||||||
|
|
||||||
|
Bei Verstoß gegen diese Bedingungen behalten wir uns rechtliche Schritte vor.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✨ Features
|
||||||
|
|
||||||
|
### 🤖 High-End NPC & ArmorStand System
|
||||||
|
- **Conversation Manager** - Komplexe Dialoge zwischen NPCs mit Sprechblasen und Sound-Effekten
|
||||||
|
- **Dynamic KI** - NPCs reagieren auf Tageszeit (Fackel nachts) und ziehen bei Annäherung von Spielern das Schwert
|
||||||
|
- **LookAt-Logik** - NPCs verfolgen flüssig die Kopfbewegungen von Spielern in der Nähe
|
||||||
|
- **Command Binding** - Binde Spieler-, Konsolen- oder Bungee-Befehle an NPC-Slots (0-9)
|
||||||
|
- **Status-Backup** - Automatisches Speichern von NPC-Namen via PersistentDataContainer & Tags
|
||||||
|
|
||||||
|
### ⚽ Soccer/Fußball-System
|
||||||
|
- **Interaktiver Soccer-Ball** - Physics-basierter Ball mit realistischer Physik
|
||||||
|
- **Dribbling** - Ball folgt Spielern automatisch in der Nähe
|
||||||
|
- **Kick-Mechanik** - Schieße den Ball durch Schlagen oder Angriff
|
||||||
|
- **Wall-Bounce** - Realistische Wand-Abpraller mit Sound-Effekten
|
||||||
|
- **Partikel-System** - Geschwindigkeits-abhängige Partikel (SONIC_BOOM, CRIT, SMOKE)
|
||||||
|
- **Auto-Respawn** - Automatischer Respawn bei Inaktivität oder Void-Fall
|
||||||
|
- **Anti-Duplikat-System** - Verhindert mehrfache Ball-Instanzen
|
||||||
|
|
||||||
|
### 🏃 Parkour-System
|
||||||
|
- **Unsichtbare Checkpoints** - Partikel-basierte Checkpoint-Markierungen
|
||||||
|
- **Timer-System** - Präzise Zeitmessung mit ActionBar-Anzeige
|
||||||
|
- **Bestenliste** - Persistente Top-10 Bestzeiten-Speicherung
|
||||||
|
- **NPC-Trainer** - Interaktive NPCs zum Starten des Parkours
|
||||||
|
- **Fail-Safe** - Teleport zum letzten Checkpoint bei Fehler
|
||||||
|
|
||||||
|
### 🌍 Lobby-Management
|
||||||
|
- **Spawn-System** - Automatischer Teleport zum Spawn bei Join/Respawn
|
||||||
|
- **Portal-System** - BungeeCord-Portale für nahtlose Server-Wechsel mit Partikel-Effekten
|
||||||
|
- **Build-Modus** - Schnelles Umschalten zwischen Bau- und Spielmodus
|
||||||
|
- **Double-Jump** - Konfigurierbarer Doppelsprung mit Cooldown und Partikeln
|
||||||
|
- **Worldborder** - Unsichtbare Lobby-Begrenzung (Circle/Square)
|
||||||
|
- **Intro-Tour** - Cinematic Kamera-Tour für neue Spieler
|
||||||
|
|
||||||
|
### 🛡️ Sicherheit & Protection
|
||||||
|
- **VPN-Blocker** - Blockiert VPN/Proxy-Verbindungen via proxycheck.io API
|
||||||
|
- **Country-Blocker** - Geo-IP Filter (Whitelist/Blacklist für Länder)
|
||||||
|
- **Maintenance-Modus** - Vollständiger Wartungsmodus mit Whitelist-Funktion
|
||||||
|
- **World-Protection** - Schutz vor Griefing, Hunger, Fallschaden und PvP
|
||||||
|
- **Anti-Grief** - Verhindert Block-Break, Item-Drop und Explosionen
|
||||||
|
- **Security-Module** - Umfassende Sicherheitsprüfungen beim Join
|
||||||
|
|
||||||
|
### 📊 Visuelle Elemente
|
||||||
|
- **Scoreboard** - Vollständig animiert mit PlaceholderAPI-Support
|
||||||
|
- **Tablist** - Dynamische Header/Footer mit Permissions-Anzeige
|
||||||
|
- **BossBar** - Rotierende Nachrichten mit Farb-Effekten
|
||||||
|
- **ActionBar** - Typewriter-Effekt für permanente Status-Anzeigen
|
||||||
|
- **Hologramme** - Text-Displays mit flexibler Positionierung
|
||||||
|
- **MapArt** - Bild-Generator für Item-Frames aus URLs
|
||||||
|
|
||||||
|
### 🎮 Item-System
|
||||||
|
- **Compass** - Server-Switcher GUI
|
||||||
|
- **Player-Hider** - Sichtbarkeits-Toggle für andere Spieler
|
||||||
|
- **Gadgets** - Konfigurierbares Item-System mit Custom-Slots
|
||||||
|
- **Player-Inspector** - Detaillierte Spieler-Informationen per Click
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Befehle
|
||||||
|
|
||||||
|
### Haupt-Commands
|
||||||
|
|
||||||
|
| Befehl | Beschreibung | Berechtigung |
|
||||||
|
|--------|--------------|--------------|
|
||||||
|
| `/nexuslobby reload` | Lädt das Plugin neu | `nexuslobby.admin` |
|
||||||
|
| `/nexuslobby setspawn` | Setzt den Lobby-Spawn | `nexuslobby.admin` |
|
||||||
|
| `/nexuslobby silentjoin <on\|off>` | Versteckter Join/Quit | `nexuslobby.admin` |
|
||||||
|
| `/nexuslobby sb <on\|off\|admin\|spieler>` | Scoreboard-Kontrolle | `nexuslobby.admin` |
|
||||||
|
| `/spawn` | Teleport zum Spawn | `nexuslobby.spawn` |
|
||||||
|
|
||||||
|
### NPC & ArmorStand
|
||||||
|
|
||||||
|
| Befehl | Beschreibung | Berechtigung |
|
||||||
|
|--------|--------------|--------------|
|
||||||
|
| `/nexustools` | NPC Editor GUI (Rotation, KI) | `nexuslobby.armorstand.use` |
|
||||||
|
| `/nexuscmd add <slot> <prio> <type> [cmd]` | Bindet Command an NPC | `nexuslobby.armorstand.cmd` |
|
||||||
|
| `/nexuscmd remove <slot\|all>` | Entfernt Commands | `nexuslobby.armorstand.cmd` |
|
||||||
|
| `/nexuscmd conv select1-4` | Wählt NPCs für Dialog | `nexuslobby.armorstand.cmd` |
|
||||||
|
| `/nexuscmd conv link <id>` | Verknüpft Dialog | `nexuslobby.armorstand.cmd` |
|
||||||
|
| `/nexuscmd say <text>` | NPC-Sprechblase | `nexuslobby.armorstand.cmd` |
|
||||||
|
|
||||||
|
### Parkour
|
||||||
|
|
||||||
|
| Befehl | Beschreibung | Berechtigung |
|
||||||
|
|--------|--------------|--------------|
|
||||||
|
| `/nexuslobby parkour setstart` | Markiert Start-NPC | `nexuslobby.admin` |
|
||||||
|
| `/nexuslobby parkour setcheckpoint <n>` | Setzt Checkpoint | `nexuslobby.admin` |
|
||||||
|
| `/nexuslobby parkour setfinish` | Setzt Ziel | `nexuslobby.admin` |
|
||||||
|
| `/nexuslobby parkour reset` | Löscht eigene Zeit | `nexuslobby.admin` |
|
||||||
|
| `/nexuslobby parkour clear` | Löscht alle Zeiten | `nexuslobby.admin` |
|
||||||
|
| `/setstart` | Alias für setstart | `nexuslobby.admin` |
|
||||||
|
| `/setcheckpoint` | Alias für setcheckpoint | `nexuslobby.admin` |
|
||||||
|
| `/setfinish` | Alias für setfinish | `nexuslobby.admin` |
|
||||||
|
|
||||||
|
### Soccer/Fußball
|
||||||
|
|
||||||
|
| Befehl | Beschreibung | Berechtigung |
|
||||||
|
|--------|--------------|--------------|
|
||||||
|
| `/nexuslobby ball setspawn` | Setzt Ball-Spawn | `nexuslobby.admin` |
|
||||||
|
| `/nexuslobby ball respawn` | Spawnt Ball neu | `nexuslobby.admin` |
|
||||||
|
| `/nexuslobby ball remove` | Entfernt Ball | `nexuslobby.admin` |
|
||||||
|
|
||||||
|
### Portal & Server
|
||||||
|
|
||||||
|
| Befehl | Beschreibung | Berechtigung |
|
||||||
|
|--------|--------------|--------------|
|
||||||
|
| `/portal create <name> <type>` | Erstellt Portal | `nexuslobby.portal` |
|
||||||
|
| `/portal delete <name>` | Löscht Portal | `nexuslobby.portal` |
|
||||||
|
| `/portal list` | Zeigt alle Portale | `nexuslobby.portal` |
|
||||||
|
| `/giveportalwand` | Portal-Werkzeug | `nexuslobby.portal.give` |
|
||||||
|
| `/serverswitcher` | Öffnet Server-GUI | `nexuslobby.serverswitcher` |
|
||||||
|
|
||||||
|
### Sonstiges
|
||||||
|
|
||||||
|
| Befehl | Beschreibung | Berechtigung |
|
||||||
|
|--------|--------------|--------------|
|
||||||
|
| `/build` | Build-Modus toggle | `nexuslobby.build` |
|
||||||
|
| `/maintenance <on\|off>` | Wartungsmodus | `nexuslobby.maintenance` |
|
||||||
|
| `/settings` | Lobby-Einstellungen (Gamerules) | `nexuslobby.admin` |
|
||||||
|
| `/holo create <id> [text]` | Erstellt Hologramm | `nexuslobby.hologram` |
|
||||||
|
| `/holo delete <id>` | Löscht Hologramm | `nexuslobby.hologram` |
|
||||||
|
| `/mapart <URL> <BxH>` | Erstellt MapArt | `nexuslobby.mapart` |
|
||||||
|
| `/intro <add\|clear\|start>` | Intro-Tour-Verwaltung | `nexuslobby.admin` |
|
||||||
|
| `/border <circle\|square\|disable>` | Worldborder-Setup | `nexuslobby.admin` |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚙️ Konfiguration
|
||||||
|
|
||||||
|
### config.yml (Auszug)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Spawn-Einstellungen
|
||||||
|
spawn:
|
||||||
|
world: "world"
|
||||||
|
x: 0.5
|
||||||
|
y: 64.0
|
||||||
|
z: 0.5
|
||||||
|
yaw: 0.0
|
||||||
|
pitch: 0.0
|
||||||
|
|
||||||
|
# Lobby-Einstellungen
|
||||||
|
lobby:
|
||||||
|
allow-fly: false
|
||||||
|
pvp-enabled: false
|
||||||
|
build-enabled: false
|
||||||
|
default-gamemode: Adventure
|
||||||
|
clear-inventory-on-join: true
|
||||||
|
|
||||||
|
# Server-Mapping (für Status-Check)
|
||||||
|
servers:
|
||||||
|
survival:
|
||||||
|
ip: "127.0.0.1"
|
||||||
|
port: 25566
|
||||||
|
skyblock:
|
||||||
|
ip: "127.0.0.1"
|
||||||
|
port: 25567
|
||||||
|
|
||||||
|
# Ball/Soccer-Einstellungen
|
||||||
|
ball:
|
||||||
|
respawn_delay: 60 # Sekunden bis Auto-Respawn
|
||||||
|
|
||||||
|
# Worldborder
|
||||||
|
worldborder:
|
||||||
|
enabled: true
|
||||||
|
type: "SQUARE" # SQUARE oder CIRCLE
|
||||||
|
radius: 50.0
|
||||||
|
```
|
||||||
|
|
||||||
|
### conversations.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
conversations:
|
||||||
|
willkommen:
|
||||||
|
dialogue:
|
||||||
|
- "&eWächter: &7Willkommen auf dem Server!"
|
||||||
|
- "&aBürger: &7Schön, dass du da bist!"
|
||||||
|
- "&eWächter: &7Viel Spaß beim Erkunden!"
|
||||||
|
|
||||||
|
quest_dialog:
|
||||||
|
dialogue:
|
||||||
|
- "&6Quest-Geber: &7Hast du meine Quest erledigt?"
|
||||||
|
- "&aHeld: &7Ja, ich habe alle Monster besiegt!"
|
||||||
|
|
||||||
|
links:
|
||||||
|
# UUID des ersten NPCs
|
||||||
|
"550e8400-e29b-41d4-a716-446655440000":
|
||||||
|
partner: "550e8400-e29b-41d4-a716-446655440001" # UUID des zweiten NPCs
|
||||||
|
dialog: willkommen
|
||||||
|
automated: true # Startet automatisch
|
||||||
|
```
|
||||||
|
|
||||||
|
### visuals.yml (Auszug)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# ActionBar-Nachrichten
|
||||||
|
actionbar:
|
||||||
|
enabled: true
|
||||||
|
speed: 3
|
||||||
|
messages:
|
||||||
|
- "&6&lWillkommen &8» &eauf unserem Server!"
|
||||||
|
- "&b&lViel Spaß &8» &7in der Lobby!"
|
||||||
|
|
||||||
|
# BossBar
|
||||||
|
bossbar:
|
||||||
|
enabled: true
|
||||||
|
interval: 40
|
||||||
|
messages:
|
||||||
|
- text: "&6&lNexusLobby &8» &eVersion 1.1.0"
|
||||||
|
color: "YELLOW"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔐 Berechtigungen
|
||||||
|
|
||||||
|
### Admin-Berechtigungen
|
||||||
|
|
||||||
|
| Berechtigung | Beschreibung |
|
||||||
|
|--------------|--------------|
|
||||||
|
| `nexuslobby.admin` | Voller Zugriff auf alle System-Einstellungen |
|
||||||
|
| `nexuslobby.armorstand.cmd` | NPCs konfigurieren und Dialoge verknüpfen |
|
||||||
|
| `nexuslobby.armorstand.use` | Zugriff auf die ArmorStand-Editor GUI |
|
||||||
|
| `nexuslobby.build` | Berechtigung für den Baumodus |
|
||||||
|
| `nexuslobby.portal` | Portale erstellen und löschen |
|
||||||
|
| `nexuslobby.portal.give` | Portal-Werkzeug erhalten |
|
||||||
|
| `nexuslobby.hologram` | Hologramme verwalten |
|
||||||
|
| `nexuslobby.mapart` | MapArt erstellen |
|
||||||
|
| `nexuslobby.maintenance` | Wartungsmodus togglen |
|
||||||
|
|
||||||
|
### Spieler-Berechtigungen
|
||||||
|
|
||||||
|
| Berechtigung | Beschreibung |
|
||||||
|
|--------------|--------------|
|
||||||
|
| `nexuslobby.spawn` | Spawn-Command nutzen |
|
||||||
|
| `nexuslobby.serverswitcher` | Server-Switcher GUI öffnen |
|
||||||
|
| `nexuslobby.scoreboard.admin` | Admin-Scoreboard sehen |
|
||||||
|
|
||||||
|
### Bypass-Berechtigungen
|
||||||
|
|
||||||
|
| Berechtigung | Beschreibung |
|
||||||
|
|--------------|--------------|
|
||||||
|
| `nexuslobby.bypass.maintenance` | Server trotz Wartungsmodus betreten |
|
||||||
|
| `nexuslobby.bypass.vpn` | VPN-Check überspringen |
|
||||||
|
| `nexuslobby.bypass.country` | Country-Check überspringen |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔧 Technische Details
|
||||||
|
|
||||||
|
### Systemanforderungen
|
||||||
|
- **Minecraft**: Paper/Spigot 1.21+ (Spigot-kompatibel, Paper empfohlen)
|
||||||
|
- **Java**: Java 21 oder höher
|
||||||
|
- **Dependencies**: LuckPerms, PlaceholderAPI (optional)
|
||||||
|
|
||||||
|
### Verwendete Technologien
|
||||||
|
- **Build-Tool**: Maven 3.9+
|
||||||
|
- **JSON-Library**: Gson 2.10.1 (gegenüber json-simple 1.1.1 aktualisiert)
|
||||||
|
- **BungeeCord API**: Für Server-Wechsel und Messaging
|
||||||
|
- **PlaceholderAPI**: Für dynamische Platzhalter
|
||||||
|
|
||||||
|
### Code-Qualität
|
||||||
|
- ✅ Moderne Java 21 Features (Switch-Expressions, Pattern Matching)
|
||||||
|
- ✅ Proper Error-Handling (Logger statt printStackTrace)
|
||||||
|
- ✅ Memory-Management (Tasks & Listeners werden sauber disposed)
|
||||||
|
- ✅ Config-Validierung mit Default-Werten
|
||||||
|
- ✅ Optimiertes JSON-Parsing mit Gson
|
||||||
|
- ✅ Spigot-kompatible BungeeCord Chat API
|
||||||
|
|
||||||
|
### Performance-Optimierungen
|
||||||
|
- **Async-Processing** für API-Calls (Update-Check, VPN-Check)
|
||||||
|
- **Caching** für Spieler-Daten und Config-Werte
|
||||||
|
- **Optimierte Entity-Queries** (nur relevante Welten)
|
||||||
|
- **Effiziente Scheduler-Nutzung** (Tasks werden gecancelt)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📦 Installation
|
||||||
|
|
||||||
|
1. **Download** der neuesten `NexusLobby-1.1.0.jar` aus den [Releases](../../releases)
|
||||||
|
2. **Upload** der JAR-Datei in den `/plugins/` Ordner
|
||||||
|
3. **Server-Neustart** durchführen
|
||||||
|
4. **Konfiguration** anpassen (`config.yml`, `visuals.yml`, etc.)
|
||||||
|
5. **Permissions** mit LuckPerms oder einem anderen Permissions-Plugin setzen
|
||||||
|
6. **(Optional)** PlaceholderAPI installieren für erweiterte Platzhalter
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🐛 Bekannte Issues & Lösungen
|
||||||
|
|
||||||
|
### Ball spawnt mehrfach
|
||||||
|
- **Lösung**: Nutze `/nexuslobby ball remove` gefolgt von `/nexuslobby ball setspawn`
|
||||||
|
- Das Anti-Duplikat-System sollte dies automatisch verhindern
|
||||||
|
|
||||||
|
### NPCs schauen nicht zu Spielern
|
||||||
|
- **Lösung**: Stelle sicher, dass der NPC mit `/nexustools` das LookAt-Feature aktiviert hat
|
||||||
|
- Prüfe, ob `ArmorStandLookAtModule` in den Logs geladen wird
|
||||||
|
|
||||||
|
### Server-Checker zeigt falsche Status
|
||||||
|
- **Lösung**: Überprüfe die IP/Port-Einstellungen in `config.yml` unter `servers:`
|
||||||
|
- Stelle sicher, dass die Server erreichbar sind (Firewall, Ports)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📚 Support & Dokumentation
|
||||||
|
|
||||||
|
- **Wiki**: Ausführliche Dokumentation im [Wiki](../../wiki)
|
||||||
|
- **Bug-Reports**: Erstelle ein [Issue](../../issues) bei technischen Problemen
|
||||||
|
- **Feature-Requests**: Vorschläge über [Issues](../../issues) mit Label "enhancement"
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📝 Changelog
|
||||||
|
|
||||||
|
### Version 1.1.0 (Februar 2026)
|
||||||
|
- ✨ Soccer/Fußball-System mit realistischer Physik
|
||||||
|
- ✨ Parkour-System mit Bestenliste und Checkpoints
|
||||||
|
- ✨ Player-Inspector Modul
|
||||||
|
- ✨ Config-Validierung mit Auto-Defaults
|
||||||
|
- 🔧 JSON-Library auf Gson 2.10.1 aktualisiert
|
||||||
|
- 🔧 Alle printStackTrace() durch Logger ersetzt
|
||||||
|
- 🔧 Memory-Management verbessert (Tasks & Listeners)
|
||||||
|
- 🔧 UpdateChecker mit proper JSON-Parsing
|
||||||
|
- 🐛 Diverse Bug-Fixes und Performance-Optimierungen
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Copyright © 2026 - M_Viper - Alle Rechte vorbehalten**
|
||||||
|
|
||||||
|
Die unbefugte Vervielfältigung, Verbreitung oder Weitergabe dieses Plugins ist strafbar und wird rechtlich verfolgt.
|
||||||
@@ -23,7 +23,7 @@ import de.nexuslobby.modules.border.BorderModule;
|
|||||||
import de.nexuslobby.modules.parkour.ParkourManager;
|
import de.nexuslobby.modules.parkour.ParkourManager;
|
||||||
import de.nexuslobby.modules.parkour.ParkourListener;
|
import de.nexuslobby.modules.parkour.ParkourListener;
|
||||||
import de.nexuslobby.modules.player.PlayerInspectModule;
|
import de.nexuslobby.modules.player.PlayerInspectModule;
|
||||||
import de.nexuslobby.modules.ball.SoccerModule; // NEU
|
import de.nexuslobby.modules.ball.SoccerModule;
|
||||||
import de.nexuslobby.utils.*;
|
import de.nexuslobby.utils.*;
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
@@ -68,7 +68,8 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
private IntroModule introModule;
|
private IntroModule introModule;
|
||||||
private BorderModule borderModule;
|
private BorderModule borderModule;
|
||||||
private ParkourManager parkourManager;
|
private ParkourManager parkourManager;
|
||||||
private SoccerModule soccerModule; // NEU
|
private SoccerModule soccerModule;
|
||||||
|
private ArmorStandLookAtModule armorStandLookAtModule;
|
||||||
|
|
||||||
private ConversationManager conversationManager;
|
private ConversationManager conversationManager;
|
||||||
|
|
||||||
@@ -96,12 +97,22 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
return parkourManager;
|
return parkourManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SoccerModule getSoccerModule() { // NEU
|
public SoccerModule getSoccerModule() {
|
||||||
return soccerModule;
|
return soccerModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
getLogger().info("");
|
||||||
|
getLogger().info("[NexusLobby] _ __ __ __ __ ");
|
||||||
|
getLogger().info("[NexusLobby] / | / /__ _ ____ _______/ / ____ / /_ / /_ __ __");
|
||||||
|
getLogger().info("[NexusLobby] / |/ / _ \\| |/_/ / / / ___/ / / __ \\ / __ \\/ __ \\/ / / /");
|
||||||
|
getLogger().info("[NexusLobby] / /| / __/> </ /_/ (__ ) /___/ /_/ / /_/ / /_/ / /_/ / ");
|
||||||
|
getLogger().info("[NexusLobby] /_/ |_/\\___/_/|_|\\__,_/____/_____/\\____/_.___/_.___/\\__, / ");
|
||||||
|
getLogger().info("[NexusLobby] /____/ ");
|
||||||
|
getLogger().info("[NexusLobby] ");
|
||||||
|
getLogger().info("[NexusLobby] NexusLobby Plugin aktiviert! Version: " + getDescription().getVersion());
|
||||||
|
|
||||||
instance = this;
|
instance = this;
|
||||||
initCustomConfigs();
|
initCustomConfigs();
|
||||||
validateConfig();
|
validateConfig();
|
||||||
@@ -125,7 +136,7 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
ServerChecker.startGlobalChecker();
|
ServerChecker.startGlobalChecker();
|
||||||
|
|
||||||
new ArmorStandLookAtModule();
|
armorStandLookAtModule = new ArmorStandLookAtModule();
|
||||||
|
|
||||||
startAutoConversationTimer();
|
startAutoConversationTimer();
|
||||||
|
|
||||||
@@ -136,8 +147,6 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
registerCommands();
|
registerCommands();
|
||||||
checkUpdates();
|
checkUpdates();
|
||||||
|
|
||||||
getLogger().info("NexusLobby v" + getDescription().getVersion() + " wurde erfolgreich gestartet.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startAutoConversationTimer() {
|
private void startAutoConversationTimer() {
|
||||||
@@ -184,7 +193,10 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ServerChecker.startGlobalChecker();
|
ServerChecker.startGlobalChecker();
|
||||||
new ArmorStandLookAtModule();
|
// FIX: ArmorStandLookAtModule als Feld tracken. Bukkit.getScheduler().cancelTasks()
|
||||||
|
// am Anfang von reloadPlugin() cancelt den alten Task bereits – hier nur
|
||||||
|
// neu starten und Referenz aktualisieren, damit kein doppelter Task läuft.
|
||||||
|
armorStandLookAtModule = new ArmorStandLookAtModule();
|
||||||
startAutoConversationTimer();
|
startAutoConversationTimer();
|
||||||
|
|
||||||
getLogger().info("Plugin Reload abgeschlossen. Änderungen wurden übernommen.");
|
getLogger().info("Plugin Reload abgeschlossen. Änderungen wurden übernommen.");
|
||||||
@@ -192,18 +204,55 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
private void checkUpdates() {
|
private void checkUpdates() {
|
||||||
new UpdateChecker(this).getVersion(version -> {
|
new UpdateChecker(this).getVersion(version -> {
|
||||||
if (!this.getDescription().getVersion().equalsIgnoreCase(version)) {
|
String currentVersion = this.getDescription().getVersion();
|
||||||
|
if (isRemoteVersionNewer(currentVersion, version)) {
|
||||||
this.updateAvailable = true;
|
this.updateAvailable = true;
|
||||||
this.latestVersion = version;
|
this.latestVersion = version;
|
||||||
getLogger().warning("====================================================");
|
getLogger().warning("====================================================");
|
||||||
getLogger().warning("Update gefunden! v" + getDescription().getVersion() + " -> v" + version);
|
getLogger().warning("Update gefunden! v" + currentVersion + " -> v" + version);
|
||||||
getLogger().warning("====================================================");
|
getLogger().warning("====================================================");
|
||||||
} else {
|
} else {
|
||||||
getLogger().info("NexusLobby ist aktuell (v" + version + ").");
|
this.updateAvailable = false;
|
||||||
|
this.latestVersion = "";
|
||||||
|
getLogger().info("NexusLobby ist aktuell/neu genug (lokal v" + currentVersion + ", remote v" + version + ").");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isRemoteVersionNewer(String localVersion, String remoteVersion) {
|
||||||
|
int[] local = extractVersionNumbers(localVersion);
|
||||||
|
int[] remote = extractVersionNumbers(remoteVersion);
|
||||||
|
|
||||||
|
int max = Math.max(local.length, remote.length);
|
||||||
|
for (int i = 0; i < max; i++) {
|
||||||
|
int l = i < local.length ? local[i] : 0;
|
||||||
|
int r = i < remote.length ? remote[i] : 0;
|
||||||
|
if (r > l) return true;
|
||||||
|
if (r < l) return false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int[] extractVersionNumbers(String version) {
|
||||||
|
if (version == null || version.isBlank()) return new int[0];
|
||||||
|
|
||||||
|
java.util.regex.Matcher matcher = java.util.regex.Pattern.compile("\\\\d+").matcher(version);
|
||||||
|
java.util.List<Integer> parts = new java.util.ArrayList<>();
|
||||||
|
while (matcher.find()) {
|
||||||
|
try {
|
||||||
|
parts.add(Integer.parseInt(matcher.group()));
|
||||||
|
} catch (NumberFormatException ignored) {
|
||||||
|
parts.add(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int[] result = new int[parts.size()];
|
||||||
|
for (int i = 0; i < parts.size(); i++) {
|
||||||
|
result[i] = parts.get(i);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private void registerModules() {
|
private void registerModules() {
|
||||||
moduleManager.registerModule(new ProtectionModule());
|
moduleManager.registerModule(new ProtectionModule());
|
||||||
moduleManager.registerModule(new ScoreboardModule());
|
moduleManager.registerModule(new ScoreboardModule());
|
||||||
@@ -245,8 +294,8 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
moduleManager.registerModule(new PlayerInspectModule());
|
moduleManager.registerModule(new PlayerInspectModule());
|
||||||
|
|
||||||
// Soccer Modul registrieren
|
// Soccer Modul registrieren
|
||||||
this.soccerModule = new SoccerModule(); // NEU
|
this.soccerModule = new SoccerModule();
|
||||||
moduleManager.registerModule(this.soccerModule); // NEU
|
moduleManager.registerModule(this.soccerModule);
|
||||||
|
|
||||||
this.portalManager = new PortalManager(this);
|
this.portalManager = new PortalManager(this);
|
||||||
moduleManager.registerModule(portalManager);
|
moduleManager.registerModule(portalManager);
|
||||||
@@ -311,7 +360,7 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("update_available"));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("update_available"));
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("update_version").replace("{old}", getDescription().getVersion()).replace("{new}", latestVersion));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("update_version").replace("{old}", getDescription().getVersion()).replace("{new}", latestVersion));
|
||||||
TextComponent link = new TextComponent(de.nexuslobby.utils.LangManager.get("update_download_link"));
|
TextComponent link = new TextComponent(de.nexuslobby.utils.LangManager.get("update_download_link"));
|
||||||
link.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://git.viper.ipv64.net/M_Viper/NexusLobby/releases"));
|
link.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://www.spigotmc.org/resources/132388/"));
|
||||||
link.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
|
link.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
|
||||||
new ComponentBuilder(de.nexuslobby.utils.LangManager.get("update_download_hover")).create()));
|
new ComponentBuilder(de.nexuslobby.utils.LangManager.get("update_download_hover")).create()));
|
||||||
player.spigot().sendMessage(link);
|
player.spigot().sendMessage(link);
|
||||||
@@ -352,6 +401,10 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
visualsFile = new File(getDataFolder(), "visuals.yml");
|
visualsFile = new File(getDataFolder(), "visuals.yml");
|
||||||
if (!visualsFile.exists()) saveResource("visuals.yml", false);
|
if (!visualsFile.exists()) saveResource("visuals.yml", false);
|
||||||
|
|
||||||
|
// lang.yml automatisch erstellen, falls nicht vorhanden
|
||||||
|
File langFile = new File(getDataFolder(), "lang.yml");
|
||||||
|
if (!langFile.exists()) saveResource("lang.yml", false);
|
||||||
|
|
||||||
reloadVisualsConfig();
|
reloadVisualsConfig();
|
||||||
Config.load();
|
Config.load();
|
||||||
}
|
}
|
||||||
@@ -476,6 +529,12 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
if (params.equalsIgnoreCase("parkour_top")) {
|
if (params.equalsIgnoreCase("parkour_top")) {
|
||||||
return parkourManager != null ? parkourManager.getTopTen() : "N/A";
|
return parkourManager != null ? parkourManager.getTopTen() : "N/A";
|
||||||
}
|
}
|
||||||
|
if (params.equalsIgnoreCase("parkour_top_1")) {
|
||||||
|
return parkourManager != null ? parkourManager.getTopTen(1) : "N/A";
|
||||||
|
}
|
||||||
|
if (params.equalsIgnoreCase("parkour_top_2")) {
|
||||||
|
return parkourManager != null ? parkourManager.getTopTen(2) : "N/A";
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ public class ModuleManager {
|
|||||||
*/
|
*/
|
||||||
public void enableAll() {
|
public void enableAll() {
|
||||||
for (Module module : modules) {
|
for (Module module : modules) {
|
||||||
plugin.getLogger().info("[NexusLobby] Enabling module: " + module.getName());
|
|
||||||
module.onEnable();
|
module.onEnable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class LobbyTabCompleter implements TabCompleter {
|
|||||||
private final HologramModule hologramModule;
|
private final HologramModule hologramModule;
|
||||||
|
|
||||||
public LobbyTabCompleter(PortalManager portalManager, HologramModule hologramModule) {
|
public LobbyTabCompleter(PortalManager portalManager, HologramModule hologramModule) {
|
||||||
this.portalManager = portalManager;
|
this.portalManager = portalManager;
|
||||||
this.hologramModule = hologramModule;
|
this.hologramModule = hologramModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,65 +28,117 @@ public class LobbyTabCompleter implements TabCompleter {
|
|||||||
List<String> suggestions = new ArrayList<>();
|
List<String> suggestions = new ArrayList<>();
|
||||||
String cmdName = command.getName().toLowerCase();
|
String cmdName = command.getName().toLowerCase();
|
||||||
|
|
||||||
// --- NexusLobby Hauptbefehl (/nexus) ---
|
// ── NexusLobby Hauptbefehl (/nexus oder /nexuslobby) ──────────────────
|
||||||
if (cmdName.equals("nexuslobby") || cmdName.equals("nexus")) {
|
if (cmdName.equals("nexuslobby") || cmdName.equals("nexus")) {
|
||||||
|
|
||||||
|
// /nexuslobby <?>
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
if (sender.hasPermission("nexuslobby.admin")) {
|
if (sender.hasPermission("nexuslobby.admin")) {
|
||||||
suggestions.addAll(Arrays.asList("reload", "setspawn", "silentjoin", "parkour", "ball")); // NEU: ball
|
suggestions.addAll(Arrays.asList(
|
||||||
|
"reload", "setspawn", "silentjoin", "parkour", "ball", "cleanbubbles", "gadgetshield"
|
||||||
|
));
|
||||||
}
|
}
|
||||||
suggestions.add("sb");
|
suggestions.add("sb");
|
||||||
|
|
||||||
|
// /nexuslobby <sub> <?>
|
||||||
} else if (args.length == 2) {
|
} else if (args.length == 2) {
|
||||||
if (args[0].equalsIgnoreCase("sb")) {
|
switch (args[0].toLowerCase()) {
|
||||||
suggestions.addAll(Arrays.asList("on", "off"));
|
case "sb" -> {
|
||||||
if (sender.hasPermission("nexuslobby.scoreboard.admin")) {
|
suggestions.addAll(Arrays.asList("on", "off"));
|
||||||
suggestions.addAll(Arrays.asList("admin", "spieler"));
|
if (sender.hasPermission("nexuslobby.scoreboard.admin"))
|
||||||
|
suggestions.addAll(Arrays.asList("admin", "spieler"));
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("silentjoin")) {
|
case "silentjoin" -> suggestions.addAll(Arrays.asList("on", "off"));
|
||||||
suggestions.addAll(Arrays.asList("on", "off"));
|
case "parkour" -> {
|
||||||
} else if (args[0].equalsIgnoreCase("parkour")) {
|
if (sender.hasPermission("nexuslobby.admin")) {
|
||||||
suggestions.addAll(Arrays.asList("setstart", "setfinish", "setcheckpoint", "reset", "clear", "removeall"));
|
suggestions.addAll(Arrays.asList(
|
||||||
} else if (args[0].equalsIgnoreCase("ball")) {
|
"setstart", "setfinish", "setcheckpoint",
|
||||||
if (sender.hasPermission("nexuslobby.admin")) {
|
"holo", "reset", "clear", "removeall", "info"
|
||||||
suggestions.addAll(Arrays.asList("setspawn", "respawn", "remove"));
|
));
|
||||||
|
} else {
|
||||||
|
// Normale Spieler können nur ihren Run abbrechen
|
||||||
|
suggestions.add("reset");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "ball" -> {
|
||||||
|
if (sender.hasPermission("nexuslobby.admin")) {
|
||||||
|
suggestions.addAll(Arrays.asList(
|
||||||
|
"setspawn", "respawn", "remove", "goal", "score"
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /nexuslobby <sub> <sub2> <?>
|
||||||
} else if (args.length == 3) {
|
} else if (args.length == 3) {
|
||||||
if (args[0].equalsIgnoreCase("parkour") && args[1].equalsIgnoreCase("setcheckpoint")) {
|
switch (args[0].toLowerCase()) {
|
||||||
suggestions.addAll(Arrays.asList("1", "2", "3", "4", "5", "6", "7", "8", "9"));
|
// Für setstart / setfinish / setcheckpoint → Strecken-Nummer 1 oder 2
|
||||||
|
case "parkour" -> {
|
||||||
|
String parkSub = args[1].toLowerCase();
|
||||||
|
if (parkSub.equals("setstart")
|
||||||
|
|| parkSub.equals("setfinish")
|
||||||
|
|| parkSub.equals("setcheckpoint")
|
||||||
|
|| parkSub.equals("holo")) {
|
||||||
|
suggestions.addAll(Arrays.asList("1", "2"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "ball" -> {
|
||||||
|
switch (args[1].toLowerCase()) {
|
||||||
|
case "goal" -> suggestions.addAll(Arrays.asList(
|
||||||
|
"pos1", "pos2", "save", "delete", "list", "show", "debug"
|
||||||
|
));
|
||||||
|
case "score" -> suggestions.add("reset");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// /nexuslobby <sub> <sub2> <sub3> <?>
|
||||||
|
} else if (args.length == 4) {
|
||||||
|
if (args[0].equalsIgnoreCase("ball") && args[1].equalsIgnoreCase("goal")) {
|
||||||
|
switch (args[2].toLowerCase()) {
|
||||||
|
case "save" -> suggestions.add("<TorName>");
|
||||||
|
case "delete" -> {
|
||||||
|
var section = NexusLobby.getInstance().getConfig()
|
||||||
|
.getConfigurationSection("ball.goals");
|
||||||
|
if (section != null) suggestions.addAll(section.getKeys(false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// /nexuslobby ball goal save <Name> <?> → Team 1 oder 2
|
||||||
|
} else if (args.length == 5) {
|
||||||
|
if (args[0].equalsIgnoreCase("ball")
|
||||||
|
&& args[1].equalsIgnoreCase("goal")
|
||||||
|
&& args[2].equalsIgnoreCase("save")) {
|
||||||
|
suggestions.addAll(Arrays.asList("1", "2"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Hologram Befehl ---
|
// ── Hologram Befehl ───────────────────────────────────────────────────
|
||||||
else if (cmdName.equals("holo")) {
|
else if (cmdName.equals("holo")) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
suggestions.addAll(Arrays.asList("create", "delete"));
|
suggestions.addAll(Arrays.asList("create", "delete"));
|
||||||
} else if (args.length == 2 && args[0].equalsIgnoreCase("delete")) {
|
} else if (args.length == 2 && args[0].equalsIgnoreCase("delete")) {
|
||||||
if (hologramModule != null) {
|
if (hologramModule != null) suggestions.addAll(hologramModule.getHologramIds());
|
||||||
suggestions.addAll(hologramModule.getHologramIds());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Wartungsmodus ---
|
// ── Wartungsmodus ─────────────────────────────────────────────────────
|
||||||
else if (cmdName.equals("maintenance")) {
|
else if (cmdName.equals("maintenance")) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) suggestions.addAll(Arrays.asList("on", "off"));
|
||||||
suggestions.addAll(Arrays.asList("on", "off"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Portalsystem ---
|
// ── Portalsystem ──────────────────────────────────────────────────────
|
||||||
else if (cmdName.equals("portal")) {
|
else if (cmdName.equals("portal")) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
suggestions.addAll(Arrays.asList("create", "delete", "list"));
|
suggestions.addAll(Arrays.asList("create", "delete", "list"));
|
||||||
} else if (args.length == 2 && args[0].equalsIgnoreCase("delete")) {
|
} else if (args.length == 2 && args[0].equalsIgnoreCase("delete")) {
|
||||||
if (portalManager != null) {
|
if (portalManager != null) suggestions.addAll(portalManager.getPortalNames());
|
||||||
suggestions.addAll(portalManager.getPortalNames());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- MapArt ---
|
// ── MapArt ────────────────────────────────────────────────────────────
|
||||||
else if (cmdName.equals("mapart")) {
|
else if (cmdName.equals("mapart")) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
suggestions.add("https://");
|
suggestions.add("https://");
|
||||||
@@ -95,14 +147,12 @@ public class LobbyTabCompleter implements TabCompleter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Intro System ---
|
// ── Intro System ──────────────────────────────────────────────────────
|
||||||
else if (cmdName.equals("intro")) {
|
else if (cmdName.equals("intro")) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) suggestions.addAll(Arrays.asList("add", "clear", "start"));
|
||||||
suggestions.addAll(Arrays.asList("add", "clear", "start"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- WorldBorder ---
|
// ── WorldBorder ───────────────────────────────────────────────────────
|
||||||
else if (cmdName.equals("border")) {
|
else if (cmdName.equals("border")) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
suggestions.addAll(Arrays.asList("circle", "square", "disable"));
|
suggestions.addAll(Arrays.asList("circle", "square", "disable"));
|
||||||
@@ -111,62 +161,51 @@ public class LobbyTabCompleter implements TabCompleter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- NexusCmd / ArmorStandTools ---
|
// ── NexusCmd / ArmorStandTools ────────────────────────────────────────
|
||||||
else if (cmdName.equals("nexuscmd") || cmdName.equals("ncmd") || cmdName.equals("ascmd") || cmdName.equals("conv")) {
|
else if (cmdName.equals("nexuscmd") || cmdName.equals("ncmd")
|
||||||
|
|| cmdName.equals("ascmd") || cmdName.equals("conv")) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
suggestions.addAll(Arrays.asList("add", "remove", "list", "name", "lookat", "conv", "say"));
|
suggestions.addAll(Arrays.asList("add", "remove", "list", "name", "lookat", "conv", "say", "clearbubbles"));
|
||||||
}
|
} else if (args.length == 2) {
|
||||||
else if (args.length == 2) {
|
switch (args[0].toLowerCase()) {
|
||||||
if (args[0].equalsIgnoreCase("add")) {
|
case "add" -> suggestions.addAll(Arrays.asList("0","1","2","3","4","5","6","7","8","9"));
|
||||||
suggestions.addAll(Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
|
case "name" -> suggestions.addAll(Arrays.asList("<Anzeigename>", "none"));
|
||||||
} else if (args[0].equalsIgnoreCase("name")) {
|
case "conv" -> suggestions.addAll(Arrays.asList("select1","select2","select3","select4","link","unlink","start"));
|
||||||
suggestions.addAll(Arrays.asList("<Anzeigename>", "none"));
|
case "remove" -> suggestions.addAll(Arrays.asList("0","1","2","3","4","5","6","7","8","9","all"));
|
||||||
} else if (args[0].equalsIgnoreCase("conv")) {
|
case "say" -> suggestions.add("<Nachricht>");
|
||||||
suggestions.addAll(Arrays.asList("select1", "select2", "select3", "select4", "link", "unlink", "start"));
|
|
||||||
} else if (args[0].equalsIgnoreCase("remove")) {
|
|
||||||
suggestions.addAll(Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "all"));
|
|
||||||
} else if (args[0].equalsIgnoreCase("say")) {
|
|
||||||
suggestions.add("<Nachricht>");
|
|
||||||
}
|
}
|
||||||
}
|
} else if (args.length == 3) {
|
||||||
else if (args.length == 3) {
|
|
||||||
if (args[0].equalsIgnoreCase("add")) {
|
if (args[0].equalsIgnoreCase("add")) {
|
||||||
suggestions.addAll(Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
|
suggestions.addAll(Arrays.asList("0","1","2","3","4","5","6","7","8","9"));
|
||||||
} else if (args[0].equalsIgnoreCase("conv")) {
|
} else if (args[0].equalsIgnoreCase("conv")
|
||||||
if (args[1].equalsIgnoreCase("start") || args[1].equalsIgnoreCase("link")) {
|
&& (args[1].equalsIgnoreCase("start") || args[1].equalsIgnoreCase("link"))) {
|
||||||
if (NexusLobby.getInstance().getConversationManager() != null) {
|
if (NexusLobby.getInstance().getConversationManager() != null)
|
||||||
suggestions.addAll(NexusLobby.getInstance().getConversationManager().getConversationIds());
|
suggestions.addAll(NexusLobby.getInstance().getConversationManager().getConversationIds());
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
} else if (args.length == 4 && args[0].equalsIgnoreCase("add")) {
|
||||||
else if (args.length == 4 && args[0].equalsIgnoreCase("add")) {
|
|
||||||
suggestions.addAll(Arrays.asList("bungee", "console", "player"));
|
suggestions.addAll(Arrays.asList("bungee", "console", "player"));
|
||||||
}
|
} else if (args.length == 5 && args[0].equalsIgnoreCase("add")
|
||||||
else if (args.length == 5 && args[0].equalsIgnoreCase("add") && args[3].equalsIgnoreCase("bungee")) {
|
&& args[3].equalsIgnoreCase("bungee")) {
|
||||||
if (NexusLobby.getInstance().getConfig().getConfigurationSection("servers") != null) {
|
var section = NexusLobby.getInstance().getConfig().getConfigurationSection("servers");
|
||||||
suggestions.addAll(NexusLobby.getInstance().getConfig().getConfigurationSection("servers").getKeys(false));
|
if (section != null) suggestions.addAll(section.getKeys(false));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- ArmorStandTools Alternate ---
|
// ── ArmorStandTools Alternate ─────────────────────────────────────────
|
||||||
else if (cmdName.equals("astools") || cmdName.equals("nt") || cmdName.equals("ntools")) {
|
else if (cmdName.equals("astools") || cmdName.equals("nt") || cmdName.equals("ntools")) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
suggestions.addAll(Arrays.asList("dynamic", "lookat", "addplayer", "addconsole", "remove", "reload", "say"));
|
suggestions.addAll(Arrays.asList("dynamic","lookat","addplayer","addconsole","remove","reload","say"));
|
||||||
}
|
} else if (args.length == 2) {
|
||||||
else if (args.length == 2 && args[0].equalsIgnoreCase("say")) {
|
if (args[0].equalsIgnoreCase("say"))
|
||||||
suggestions.add("<Nachricht>");
|
suggestions.add("<Nachricht>");
|
||||||
}
|
else if (args[0].equalsIgnoreCase("addplayer") || args[0].equalsIgnoreCase("addconsole"))
|
||||||
else if (args.length == 2 && (args[0].equalsIgnoreCase("addplayer") || args[0].equalsIgnoreCase("addconsole"))) {
|
suggestions.addAll(Arrays.asList("0","1","2","3","4","5","6","7","8","9"));
|
||||||
suggestions.addAll(Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
|
} else if (args.length == 3) {
|
||||||
}
|
if (args[0].equalsIgnoreCase("addplayer") || args[0].equalsIgnoreCase("addconsole"))
|
||||||
else if (args.length == 3 && (args[0].equalsIgnoreCase("addplayer") || args[0].equalsIgnoreCase("addconsole"))) {
|
suggestions.addAll(Arrays.asList("0","1","2","3","4","5","6","7","8","9"));
|
||||||
suggestions.addAll(Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filtert die Liste basierend auf der bisherigen Eingabe
|
|
||||||
return suggestions.stream()
|
return suggestions.stream()
|
||||||
.filter(s -> s.toLowerCase().startsWith(args[args.length - 1].toLowerCase()))
|
.filter(s -> s.toLowerCase().startsWith(args[args.length - 1].toLowerCase()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package de.nexuslobby.commands;
|
|||||||
|
|
||||||
import de.nexuslobby.NexusLobby;
|
import de.nexuslobby.NexusLobby;
|
||||||
import de.nexuslobby.modules.ScoreboardModule;
|
import de.nexuslobby.modules.ScoreboardModule;
|
||||||
|
import de.nexuslobby.modules.hologram.HologramModule;
|
||||||
import de.nexuslobby.modules.parkour.ParkourManager;
|
import de.nexuslobby.modules.parkour.ParkourManager;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@@ -34,19 +35,18 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
// --- DIREKTE KURZ-BEFEHLE ---
|
// --- DIREKTE KURZ-BEFEHLE ---
|
||||||
if (cmdName.equalsIgnoreCase("setstart")) {
|
if (cmdName.equalsIgnoreCase("setstart")) {
|
||||||
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
||||||
handleSetStart(player, pm);
|
// Standard: Strecke 1 setzen
|
||||||
|
pm.setStartLocation(player, 1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (cmdName.equalsIgnoreCase("setcheckpoint")) {
|
if (cmdName.equalsIgnoreCase("setcheckpoint")) {
|
||||||
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
||||||
pm.setCheckpoint(player, player.getLocation());
|
pm.setCheckpoint(player, 1);
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_checkpoint_set"));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (cmdName.equalsIgnoreCase("setfinish")) {
|
if (cmdName.equalsIgnoreCase("setfinish")) {
|
||||||
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
||||||
pm.setFinishLocation(player.getLocation());
|
pm.setFinishLocation(player, 1);
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_finish_set"));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,6 +75,7 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (args[0].toLowerCase()) {
|
switch (args[0].toLowerCase()) {
|
||||||
|
|
||||||
case "reload":
|
case "reload":
|
||||||
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
||||||
NexusLobby.getInstance().reloadPlugin();
|
NexusLobby.getInstance().reloadPlugin();
|
||||||
@@ -82,6 +83,11 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1f, 1.5f);
|
player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1f, 1.5f);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "cleanbubbles":
|
||||||
|
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
||||||
|
handleCleanBubbles(player);
|
||||||
|
break;
|
||||||
|
|
||||||
case "setspawn":
|
case "setspawn":
|
||||||
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
||||||
Location loc = player.getLocation();
|
Location loc = player.getLocation();
|
||||||
@@ -90,7 +96,7 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
config.set("spawn.x", loc.getX());
|
config.set("spawn.x", loc.getX());
|
||||||
config.set("spawn.y", loc.getY());
|
config.set("spawn.y", loc.getY());
|
||||||
config.set("spawn.z", loc.getZ());
|
config.set("spawn.z", loc.getZ());
|
||||||
config.set("spawn.yaw", (double) loc.getYaw());
|
config.set("spawn.yaw", (double) loc.getYaw());
|
||||||
config.set("spawn.pitch", (double) loc.getPitch());
|
config.set("spawn.pitch", (double) loc.getPitch());
|
||||||
NexusLobby.getInstance().saveConfig();
|
NexusLobby.getInstance().saveConfig();
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("spawn_set"));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("spawn_set"));
|
||||||
@@ -111,7 +117,12 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
handleScoreboard(player, args);
|
handleScoreboard(player, args);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "ball": // NEU: Weiterleitung an das SoccerModule
|
case "gadgetshield":
|
||||||
|
if (!player.hasPermission("nexuslobby.admin") && !player.isOp()) return noPerm(player);
|
||||||
|
de.nexuslobby.modules.gadgets.GadgetShield.toggle(player);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "ball":
|
||||||
if (NexusLobby.getInstance().getSoccerModule() != null) {
|
if (NexusLobby.getInstance().getSoccerModule() != null) {
|
||||||
return NexusLobby.getInstance().getSoccerModule().onCommand(sender, command, label, args);
|
return NexusLobby.getInstance().getSoccerModule().onCommand(sender, command, label, args);
|
||||||
}
|
}
|
||||||
@@ -119,42 +130,7 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "parkour":
|
case "parkour":
|
||||||
if (args.length < 2) {
|
handleParkour(player, args, pm);
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_usage"));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
String sub = args[1].toLowerCase();
|
|
||||||
if (!player.hasPermission("nexuslobby.admin") && !sub.equals("reset")) return noPerm(player);
|
|
||||||
|
|
||||||
switch (sub) {
|
|
||||||
case "setstart":
|
|
||||||
handleSetStart(player, pm);
|
|
||||||
break;
|
|
||||||
case "setfinish":
|
|
||||||
pm.setFinishLocation(player.getLocation());
|
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_finish_set"));
|
|
||||||
break;
|
|
||||||
case "setcheckpoint":
|
|
||||||
pm.setCheckpoint(player, player.getLocation());
|
|
||||||
break;
|
|
||||||
case "reset":
|
|
||||||
pm.stopParkour(player);
|
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_run_aborted"));
|
|
||||||
break;
|
|
||||||
case "clear":
|
|
||||||
pm.clearStats();
|
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_besttimes_cleared"));
|
|
||||||
break;
|
|
||||||
case "removeall":
|
|
||||||
pm.removeAllPoints();
|
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_track_removed"));
|
|
||||||
player.playSound(player.getLocation(), Sound.ENTITY_ITEM_BREAK, 1f, 1f);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("unknown_subcommand"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -165,13 +141,128 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleSetStart(Player player, ParkourManager pm) {
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
// NPC Erkennung (Blickrichtung auf ArmorStand)
|
// Parkour-Handler
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
private void handleParkour(Player player, String[] args, ParkourManager pm) {
|
||||||
|
if (args.length < 2) {
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_usage"));
|
||||||
|
// Strecken-Info ausgeben
|
||||||
|
player.sendMessage(pm.getTrackInfo());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String sub = args[1].toLowerCase();
|
||||||
|
|
||||||
|
// Nur "reset" kann auch ohne Admin-Recht ausgeführt werden (eigenen Lauf abbrechen)
|
||||||
|
if (!player.hasPermission("nexuslobby.admin") && !sub.equals("reset")) {
|
||||||
|
noPerm(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (sub) {
|
||||||
|
|
||||||
|
// /nexus parkour setstart <1|2>
|
||||||
|
case "setstart": {
|
||||||
|
int track = parseTrack(args, 2, player);
|
||||||
|
if (track == -1) return;
|
||||||
|
handleSetStart(player, pm, track);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// /nexus parkour setfinish <1|2>
|
||||||
|
case "setfinish": {
|
||||||
|
int track = parseTrack(args, 2, player);
|
||||||
|
if (track == -1) return;
|
||||||
|
pm.setFinishLocation(player, track);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// /nexus parkour setcheckpoint <1|2>
|
||||||
|
case "setcheckpoint": {
|
||||||
|
int track = parseTrack(args, 2, player);
|
||||||
|
if (track == -1) return;
|
||||||
|
pm.setCheckpoint(player, track);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "reset":
|
||||||
|
pm.stopParkour(player);
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_run_aborted"));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "clear":
|
||||||
|
pm.clearStats();
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_besttimes_cleared"));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "removeall":
|
||||||
|
pm.removeAllPoints();
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_track_removed"));
|
||||||
|
player.playSound(player.getLocation(), Sound.ENTITY_ITEM_BREAK, 1f, 1f);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "info":
|
||||||
|
player.sendMessage(pm.getTrackInfo());
|
||||||
|
break;
|
||||||
|
|
||||||
|
// /nexus parkour holo <1|2> – Leaderboard-Hologramm an aktueller Position setzen
|
||||||
|
case "holo": {
|
||||||
|
int track = parseTrack(args, 2, player);
|
||||||
|
if (track == -1) return;
|
||||||
|
HologramModule hm = NexusLobby.getInstance().getHologramModule();
|
||||||
|
if (hm == null) {
|
||||||
|
player.sendMessage("§cHologram-Modul nicht verfügbar!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String holoId = "parkour_top_" + track;
|
||||||
|
List<String> pages = new java.util.ArrayList<>();
|
||||||
|
pages.add("%nexuslobby_parkour_top_" + track + "%");
|
||||||
|
hm.createHologram(holoId, player.getLocation(), pages);
|
||||||
|
player.sendMessage("§8[§6Parkour§8] §aLeaderboard-Hologramm für §eStrecke " + track
|
||||||
|
+ " §agesetzt! §8(ID: §7" + holoId + "§8)");
|
||||||
|
player.sendMessage("§8[§6Parkour§8] §7Das Hologramm aktualisiert sich automatisch via PlaceholderAPI.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("unknown_subcommand"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liest die Track-Nummer aus args[index].
|
||||||
|
* Gibt 1 oder 2 zurück; bei Fehler sendet er eine Nachricht und gibt -1 zurück.
|
||||||
|
*/
|
||||||
|
private int parseTrack(String[] args, int index, Player player) {
|
||||||
|
if (args.length <= index) {
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cBitte gib eine Strecken-Nummer an: §e1 §7oder §e2");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
int track;
|
||||||
|
try {
|
||||||
|
track = Integer.parseInt(args[index]);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cUngültige Strecken-Nummer. Bitte §e1 §7oder §e2 §7verwenden.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (track < 1 || track > 2) {
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cNur Strecke §e1 §7oder §e2 §7sind erlaubt.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return track;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleSetStart(Player player, ParkourManager pm, int track) {
|
||||||
|
// NPC-Erkennung: schaut der Spieler auf einen ArmorStand?
|
||||||
ArmorStand targetAs = null;
|
ArmorStand targetAs = null;
|
||||||
List<Entity> nearby = player.getNearbyEntities(4, 4, 4);
|
List<Entity> nearby = player.getNearbyEntities(4, 4, 4);
|
||||||
for (Entity e : nearby) {
|
for (Entity e : nearby) {
|
||||||
if (e instanceof ArmorStand as) {
|
if (e instanceof ArmorStand as) {
|
||||||
double dot = player.getLocation().getDirection().dot(as.getLocation().toVector().subtract(player.getLocation().toVector()).normalize());
|
double dot = player.getLocation().getDirection()
|
||||||
|
.dot(as.getLocation().toVector().subtract(player.getLocation().toVector()).normalize());
|
||||||
if (dot > 0.9) {
|
if (dot > 0.9) {
|
||||||
targetAs = as;
|
targetAs = as;
|
||||||
break;
|
break;
|
||||||
@@ -183,8 +274,23 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
targetAs.addScoreboardTag("parkour_npc");
|
targetAs.addScoreboardTag("parkour_npc");
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_npc_marked"));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_npc_marked"));
|
||||||
}
|
}
|
||||||
pm.setStartLocation(player.getLocation());
|
pm.setStartLocation(player, track);
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_start_set"));
|
}
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
// Sonstige Handler
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
private void handleCleanBubbles(Player player) {
|
||||||
|
de.nexuslobby.modules.armorstandtools.ConversationManager cm =
|
||||||
|
NexusLobby.getInstance().getConversationManager();
|
||||||
|
if (cm == null) {
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cConversationManager ist nicht aktiv.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cm.clearHangingBubbles();
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aAlle hängengebliebenen Sprechblasen wurden entfernt.");
|
||||||
|
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1f, 2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean noPerm(Player player) {
|
private boolean noPerm(Player player) {
|
||||||
@@ -202,18 +308,17 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("scoreboard_module_disabled"));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("scoreboard_module_disabled"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String sub = args[1].toLowerCase();
|
switch (args[1].toLowerCase()) {
|
||||||
switch (sub) {
|
case "on" -> sbModule.setVisibility(player, true);
|
||||||
case "on": sbModule.setVisibility(player, true); break;
|
case "off" -> sbModule.setVisibility(player, false);
|
||||||
case "off": sbModule.setVisibility(player, false); break;
|
case "admin" -> {
|
||||||
case "admin":
|
|
||||||
if (player.hasPermission("nexuslobby.scoreboard.admin")) sbModule.setAdminMode(player, true);
|
if (player.hasPermission("nexuslobby.scoreboard.admin")) sbModule.setAdminMode(player, true);
|
||||||
else player.sendMessage(de.nexuslobby.utils.LangManager.get("no_permission"));
|
else player.sendMessage(de.nexuslobby.utils.LangManager.get("no_permission"));
|
||||||
break;
|
}
|
||||||
case "spieler":
|
case "spieler" -> {
|
||||||
if (player.hasPermission("nexuslobby.scoreboard.admin")) sbModule.setAdminMode(player, false);
|
if (player.hasPermission("nexuslobby.scoreboard.admin")) sbModule.setAdminMode(player, false);
|
||||||
else player.sendMessage(de.nexuslobby.utils.LangManager.get("no_permission"));
|
else player.sendMessage(de.nexuslobby.utils.LangManager.get("no_permission"));
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,12 +335,20 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_title"));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_title"));
|
||||||
player.sendMessage("");
|
player.sendMessage("");
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_spawn"));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_spawn"));
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_parkour"));
|
player.sendMessage("§e/nexus parkour setstart <1|2> §7- Start setzen");
|
||||||
|
player.sendMessage("§e/nexus parkour setcheckpoint <1|2> §7- Checkpoint setzen");
|
||||||
|
player.sendMessage("§e/nexus parkour setfinish <1|2> §7- Ziel setzen");
|
||||||
|
player.sendMessage("§e/nexus parkour holo <1|2> §7- Top-10 Hologramm setzen");
|
||||||
|
player.sendMessage("§e/nexus parkour reset §7- Eigenen Run abbrechen");
|
||||||
|
player.sendMessage("§e/nexus parkour clear §7- §cTop-10 Liste löschen");
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_removeall"));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_removeall"));
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_ball"));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_ball"));
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_setspawn"));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_setspawn"));
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_scoreboard"));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_scoreboard"));
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_reload"));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_reload"));
|
||||||
|
player.sendMessage("§e/nexuslobby cleanbubbles §7- Hängende Sprechblasen entfernen");
|
||||||
|
if (player.hasPermission("nexuslobby.admin") || player.isOp())
|
||||||
|
player.sendMessage("§e/nexuslobby gadgetshield §7- Gadget-Schutz für Admins ein/ausschalten");
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_footer"));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_footer"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,11 +6,14 @@ import de.nexuslobby.commands.BuildCommand;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
|
import org.bukkit.event.block.BlockExplodeEvent;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.entity.EntityPickupItemEvent;
|
import org.bukkit.event.entity.EntityPickupItemEvent;
|
||||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
@@ -30,7 +33,11 @@ public class ProtectionModule implements Module, Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {}
|
public void onDisable() {
|
||||||
|
// FIX: Listener nach dem Deaktivieren abmelden, damit nach /reload
|
||||||
|
// keine doppelten Events ausgelöst werden.
|
||||||
|
HandlerList.unregisterAll(this);
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockBreak(BlockBreakEvent event) {
|
public void onBlockBreak(BlockBreakEvent event) {
|
||||||
@@ -91,4 +98,22 @@ public class ProtectionModule implements Module, Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIX: Fehlender Explosionsschutz - settings.yml hat allowExplosions: false,
|
||||||
|
// aber bisher gab es keinen Handler dafür.
|
||||||
|
@EventHandler
|
||||||
|
public void onEntityExplode(EntityExplodeEvent event) {
|
||||||
|
if (!getSettings().getBoolean("allowExplosions", false)) {
|
||||||
|
event.blockList().clear();
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onBlockExplode(BlockExplodeEvent event) {
|
||||||
|
if (!getSettings().getBoolean("allowExplosions", false)) {
|
||||||
|
event.blockList().clear();
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ package de.nexuslobby.modules;
|
|||||||
|
|
||||||
import de.nexuslobby.NexusLobby;
|
import de.nexuslobby.NexusLobby;
|
||||||
import de.nexuslobby.api.Module;
|
import de.nexuslobby.api.Module;
|
||||||
|
import io.papermc.paper.scoreboard.numbers.NumberFormat;
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@@ -9,21 +10,30 @@ import org.bukkit.configuration.file.FileConfiguration;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.scoreboard.*;
|
import org.bukkit.scoreboard.*;
|
||||||
|
import org.bukkit.scoreboard.Criteria;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class ScoreboardModule implements Module {
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
|
public class ScoreboardModule implements Module, Listener {
|
||||||
|
|
||||||
private final NexusLobby plugin = NexusLobby.getInstance();
|
private final NexusLobby plugin = NexusLobby.getInstance();
|
||||||
private boolean placeholderAPIEnabled;
|
private boolean placeholderAPIEnabled;
|
||||||
|
|
||||||
// Speicher für die aktuellen Spieler-Einstellungen (bis zum Restart/Reload)
|
|
||||||
private final Set<UUID> hiddenPlayers = new HashSet<>();
|
private final Set<UUID> hiddenPlayers = new HashSet<>();
|
||||||
private final Set<UUID> adminModePlayers = new HashSet<>();
|
private final Set<UUID> adminModePlayers = new HashSet<>();
|
||||||
|
|
||||||
|
// WICHTIG: Hier speichern wir die Scoreboards pro Spieler, um sie wiederzuverwenden
|
||||||
|
private final Map<UUID, Scoreboard> playerBoards = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "Scoreboard";
|
return "Scoreboard";
|
||||||
@@ -34,6 +44,8 @@ public class ScoreboardModule implements Module {
|
|||||||
FileConfiguration vConfig = plugin.getVisualsConfig();
|
FileConfiguration vConfig = plugin.getVisualsConfig();
|
||||||
if (!vConfig.getBoolean("scoreboard.enabled", true)) return;
|
if (!vConfig.getBoolean("scoreboard.enabled", true)) return;
|
||||||
|
|
||||||
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
|
|
||||||
placeholderAPIEnabled = Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null;
|
placeholderAPIEnabled = Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null;
|
||||||
|
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@@ -46,8 +58,26 @@ public class ScoreboardModule implements Module {
|
|||||||
}.runTaskTimer(plugin, 0L, vConfig.getLong("scoreboard.update_ticks", 20L));
|
}.runTaskTimer(plugin, 0L, vConfig.getLong("scoreboard.update_ticks", 20L));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
boolean defaultVisible = plugin.getConfig().getBoolean("scoreboard-default-visible", true);
|
||||||
|
if (!defaultVisible) {
|
||||||
|
hiddenPlayers.add(player.getUniqueId());
|
||||||
|
player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
|
||||||
|
// Sicherstellen, dass kein altes Board gespeichert ist
|
||||||
|
playerBoards.remove(player.getUniqueId());
|
||||||
|
} else {
|
||||||
|
hiddenPlayers.remove(player.getUniqueId());
|
||||||
|
// Beim Einloggen initialisieren, damit es nicht beim ersten Tick flackert
|
||||||
|
if (!playerBoards.containsKey(player.getUniqueId())) {
|
||||||
|
playerBoards.put(player.getUniqueId(), Bukkit.getScoreboardManager().getNewScoreboard());
|
||||||
|
player.setScoreboard(playerBoards.get(player.getUniqueId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void updateSidebar(Player player) {
|
private void updateSidebar(Player player) {
|
||||||
// 1. Prüfen, ob der Spieler das Scoreboard ausgeblendet hat
|
|
||||||
if (hiddenPlayers.contains(player.getUniqueId())) {
|
if (hiddenPlayers.contains(player.getUniqueId())) {
|
||||||
if (player.getScoreboard() != Bukkit.getScoreboardManager().getMainScoreboard()) {
|
if (player.getScoreboard() != Bukkit.getScoreboardManager().getMainScoreboard()) {
|
||||||
player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
|
player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
|
||||||
@@ -56,49 +86,81 @@ public class ScoreboardModule implements Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FileConfiguration vConfig = plugin.getVisualsConfig();
|
FileConfiguration vConfig = plugin.getVisualsConfig();
|
||||||
Scoreboard board = player.getScoreboard();
|
|
||||||
|
|
||||||
if (board == Bukkit.getScoreboardManager().getMainScoreboard()) {
|
String configPath = (adminModePlayers.contains(player.getUniqueId())
|
||||||
|
&& player.hasPermission("nexuslobby.scoreboard.admin"))
|
||||||
|
? "scoreboard.owner"
|
||||||
|
: "scoreboard.default";
|
||||||
|
|
||||||
|
String title = vConfig.getString(configPath + ".title", "&6&lNexusLobby");
|
||||||
|
List<String> lines = vConfig.getStringList(configPath + ".lines");
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// FIX: Statt getNewScoreboard() holen wir das gespeicherte Board
|
||||||
|
// oder erstellen es genau einmal beim ersten Mal.
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
Scoreboard board = playerBoards.get(player.getUniqueId());
|
||||||
|
|
||||||
|
if (board == null) {
|
||||||
board = Bukkit.getScoreboardManager().getNewScoreboard();
|
board = Bukkit.getScoreboardManager().getNewScoreboard();
|
||||||
|
playerBoards.put(player.getUniqueId(), board);
|
||||||
player.setScoreboard(board);
|
player.setScoreboard(board);
|
||||||
}
|
}
|
||||||
|
|
||||||
Objective obj = board.getObjective("lobby");
|
// Altes Objective entfernen
|
||||||
if (obj == null) {
|
Objective oldObj = board.getObjective("lobby");
|
||||||
obj = board.registerNewObjective("lobby", "dummy", "title");
|
if (oldObj != null) oldObj.unregister();
|
||||||
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
|
|
||||||
|
// Alle alten Zeilen-Teams sicher entfernen (großzügige Obergrenze)
|
||||||
|
for (int i = 0; i < Math.max(lines.size() + 5, 32); i++) {
|
||||||
|
Team old = board.getTeam("line_" + i);
|
||||||
|
if (old != null) old.unregister();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Pfad-Logik basierend auf dem Modus (/nexus sb admin/spieler)
|
// Paper 1.21: Objective mit Component-Titel registrieren
|
||||||
String configPath = "scoreboard.default";
|
String translatedTitle = translate(player, title);
|
||||||
|
Objective obj = board.registerNewObjective(
|
||||||
|
"lobby",
|
||||||
|
Criteria.DUMMY,
|
||||||
|
net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer
|
||||||
|
.legacySection()
|
||||||
|
.deserialize(translatedTitle)
|
||||||
|
);
|
||||||
|
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
|
||||||
|
|
||||||
// Wenn im Admin-Modus UND Rechte vorhanden -> owner Sektion
|
// Zahlen global für dieses Objective ausblenden (Paper 1.20.4+ API)
|
||||||
if (adminModePlayers.contains(player.getUniqueId()) && player.hasPermission("nexuslobby.scoreboard.admin")) {
|
obj.numberFormat(NumberFormat.blank());
|
||||||
configPath = "scoreboard.owner";
|
|
||||||
} else {
|
|
||||||
// Standardmäßig default nutzen
|
|
||||||
configPath = "scoreboard.default";
|
|
||||||
}
|
|
||||||
|
|
||||||
String title = vConfig.getString(configPath + ".title", "&6&lNexusLobby");
|
|
||||||
obj.setDisplayName(translate(player, title));
|
|
||||||
|
|
||||||
List<String> lines = vConfig.getStringList(configPath + ".lines");
|
|
||||||
|
|
||||||
// Scores zurücksetzen um Duplikate zu vermeiden
|
|
||||||
board.getEntries().forEach(board::resetScores);
|
|
||||||
|
|
||||||
for (int i = 0; i < lines.size(); i++) {
|
for (int i = 0; i < lines.size(); i++) {
|
||||||
String line = translate(player, lines.get(i));
|
String lineText = translate(player, lines.get(i));
|
||||||
|
|
||||||
// Verhindert das Verschwinden leerer Zeilen
|
// Eindeutiger unsichtbarer Entry pro Zeile via Farb-Code
|
||||||
if (line.isEmpty() || line.trim().isEmpty()) {
|
String entry = ChatColor.values()[i % ChatColor.values().length].toString()
|
||||||
line = "" + ChatColor.values()[i] + ChatColor.RESET;
|
+ ChatColor.RESET;
|
||||||
|
|
||||||
|
// getTeam statt registerNewTeam — verhindert "already in use" Fehler
|
||||||
|
Team team = board.getTeam("line_" + i);
|
||||||
|
if (team == null) team = board.registerNewTeam("line_" + i);
|
||||||
|
team.getEntries().forEach(team::removeEntry);
|
||||||
|
team.addEntry(entry);
|
||||||
|
|
||||||
|
// Text aufteilen falls länger als 64 Zeichen
|
||||||
|
if (lineText.length() > 64) {
|
||||||
|
team.setPrefix(lineText.substring(0, 64));
|
||||||
|
team.setSuffix(lineText.substring(64, Math.min(lineText.length(), 128)));
|
||||||
|
} else {
|
||||||
|
team.setPrefix(lineText);
|
||||||
|
team.setSuffix("");
|
||||||
}
|
}
|
||||||
|
|
||||||
Score score = obj.getScore(line);
|
// Score setzen + Zahl pro Eintrag zusätzlich ausblenden
|
||||||
|
org.bukkit.scoreboard.Score score = obj.getScore(entry);
|
||||||
score.setScore(lines.size() - i);
|
score.setScore(lines.size() - i);
|
||||||
|
score.numberFormat(NumberFormat.blank());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Kein player.setScoreboard(board) nötig, da wir das Objekt 'board'
|
||||||
|
// direkt verändert haben, das der Spieler bereits hat.
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Methoden für den /nexus sb Befehl ---
|
// --- Methoden für den /nexus sb Befehl ---
|
||||||
@@ -106,23 +168,28 @@ public class ScoreboardModule implements Module {
|
|||||||
public void setVisibility(Player player, boolean visible) {
|
public void setVisibility(Player player, boolean visible) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
hiddenPlayers.remove(player.getUniqueId());
|
hiddenPlayers.remove(player.getUniqueId());
|
||||||
player.sendMessage("§7[§6Nexus§7] §aScoreboard eingeschaltet.");
|
// Wenn wir es wieder einschalten, ggf. Board zurücksetzen oder neu holen
|
||||||
|
if (!playerBoards.containsKey(player.getUniqueId())) {
|
||||||
|
playerBoards.put(player.getUniqueId(), Bukkit.getScoreboardManager().getNewScoreboard());
|
||||||
|
}
|
||||||
|
player.setScoreboard(playerBoards.get(player.getUniqueId()));
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aScoreboard eingeschaltet.");
|
||||||
|
updateSidebar(player); // Sofort aktualisieren
|
||||||
} else {
|
} else {
|
||||||
hiddenPlayers.add(player.getUniqueId());
|
hiddenPlayers.add(player.getUniqueId());
|
||||||
player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
|
player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
|
||||||
player.sendMessage("§7[§6Nexus§7] §cScoreboard ausgeschaltet.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cScoreboard ausgeschaltet.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAdminMode(Player player, boolean admin) {
|
public void setAdminMode(Player player, boolean admin) {
|
||||||
if (admin) {
|
if (admin) {
|
||||||
adminModePlayers.add(player.getUniqueId());
|
adminModePlayers.add(player.getUniqueId());
|
||||||
player.sendMessage("§7[§6Nexus§7] §eModus: §cAdmin-Scoreboard §7(Owner-Sektion)");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§eModus: §cAdmin-Scoreboard §7(Owner-Sektion)");
|
||||||
} else {
|
} else {
|
||||||
adminModePlayers.remove(player.getUniqueId());
|
adminModePlayers.remove(player.getUniqueId());
|
||||||
player.sendMessage("§7[§6Nexus§7] §eModus: §6Spieler-Scoreboard §7(Default-Sektion)");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§eModus: §6Spieler-Scoreboard §7(Default-Sektion)");
|
||||||
}
|
}
|
||||||
// Sofortiges Update erzwingen
|
|
||||||
updateSidebar(player);
|
updateSidebar(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,19 +198,19 @@ public class ScoreboardModule implements Module {
|
|||||||
if (placeholderAPIEnabled) {
|
if (placeholderAPIEnabled) {
|
||||||
try {
|
try {
|
||||||
translated = PlaceholderAPI.setPlaceholders(player, text);
|
translated = PlaceholderAPI.setPlaceholders(player, text);
|
||||||
} catch (NoClassDefFoundError ignored) {
|
} catch (NoClassDefFoundError ignored) {}
|
||||||
// PlaceholderAPI fehlt zur Laufzeit
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return ChatColor.translateAlternateColorCodes('&', translated);
|
return ChatColor.translateAlternateColorCodes('&', translated);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
|
org.bukkit.event.HandlerList.unregisterAll(this);
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
|
player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
|
||||||
}
|
}
|
||||||
hiddenPlayers.clear();
|
hiddenPlayers.clear();
|
||||||
adminModePlayers.clear();
|
adminModePlayers.clear();
|
||||||
|
playerBoards.clear(); // Speicher freigeben
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,11 +6,15 @@ import de.nexuslobby.NexusLobby;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
import org.bukkit.event.player.PlayerArmorStandManipulateEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||||
import org.bukkit.inventory.EquipmentSlot;
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@@ -20,6 +24,41 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public class ASTListener implements Listener {
|
public class ASTListener implements Listener {
|
||||||
|
|
||||||
|
private boolean hasArmorStandBypass(Player player) {
|
||||||
|
return player.isOp() || player.hasPermission("nexuslobby.armorstand.editbypass");
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
|
public void onArmorStandManipulate(PlayerArmorStandManipulateEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
if (hasArmorStandBypass(player)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verhindert, dass Spieler Rüstung/Items aus ArmorStands nehmen oder austauschen.
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
|
public void onArmorStandDamage(EntityDamageByEntityEvent event) {
|
||||||
|
if (!(event.getEntity() instanceof ArmorStand)) return;
|
||||||
|
|
||||||
|
Player player = null;
|
||||||
|
Entity damager = event.getDamager();
|
||||||
|
if (damager instanceof Player p) {
|
||||||
|
player = p;
|
||||||
|
} else if (damager instanceof Projectile projectile && projectile.getShooter() instanceof Player p) {
|
||||||
|
player = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player != null && hasArmorStandBypass(player)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verhindert Abbauen/Beschädigen ohne Bypass, damit keine Equipment-Drops entnommen werden können.
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onInteract(PlayerInteractAtEntityEvent event) {
|
public void onInteract(PlayerInteractAtEntityEvent event) {
|
||||||
if (event.getHand() != EquipmentSlot.HAND) return;
|
if (event.getHand() != EquipmentSlot.HAND) return;
|
||||||
@@ -70,32 +109,34 @@ public class ASTListener implements Listener {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Prüft, ob der ArmorStand Dialog-Tags hat und startet das Gespräch über den Manager.
|
* Prüft, ob der ArmorStand Dialog-Tags hat und startet das Gespräch über den Manager.
|
||||||
* Nutzt nun die Gruppen-Logik (z.B. owner_suche).
|
* FIX: Liest jetzt alle Partner-Tags (conv_partner, conv_partner2, conv_partner3)
|
||||||
|
* und verwendet playConversationGroup statt nur die 2-NPC-Methode.
|
||||||
|
* Vorher wurden Gruppen-Gespräche mit 3-4 NPCs als 2-NPC-Gespräch ausgeführt.
|
||||||
*/
|
*/
|
||||||
private void checkAndTriggerDialog(ArmorStand as, Player p) {
|
private void checkAndTriggerDialog(ArmorStand as, Player p) {
|
||||||
String groupName = null;
|
String groupName = null;
|
||||||
String partnerUUIDString = null;
|
String partner1 = null, partner2 = null, partner3 = null;
|
||||||
|
|
||||||
for (String tag : as.getScoreboardTags()) {
|
for (String tag : as.getScoreboardTags()) {
|
||||||
// conv_id enthält jetzt den Gruppennamen aus der conversations.yml
|
if (tag.startsWith("conv_id:")) groupName = tag.split(":", 2)[1];
|
||||||
if (tag.startsWith("conv_id:")) groupName = tag.split(":")[1];
|
if (tag.startsWith("conv_partner:")) partner1 = tag.split(":", 2)[1];
|
||||||
if (tag.startsWith("conv_partner:")) partnerUUIDString = tag.split(":")[1];
|
if (tag.startsWith("conv_partner2:")) partner2 = tag.split(":", 2)[1];
|
||||||
|
if (tag.startsWith("conv_partner3:")) partner3 = tag.split(":", 2)[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (groupName != null && partnerUUIDString != null) {
|
if (groupName == null || partner1 == null) return;
|
||||||
try {
|
|
||||||
UUID partnerUUID = UUID.fromString(partnerUUIDString);
|
|
||||||
|
|
||||||
// Wir rufen playConversation auf. Der Manager entscheidet selbst
|
try {
|
||||||
// anhand der Uhrzeit, ob er morgens, mittags oder nachts abspielt.
|
java.util.List<UUID> participants = new java.util.ArrayList<>();
|
||||||
NexusLobby.getInstance().getConversationManager().playConversation(
|
participants.add(as.getUniqueId());
|
||||||
as.getUniqueId(),
|
participants.add(UUID.fromString(partner1));
|
||||||
partnerUUID,
|
if (partner2 != null) participants.add(UUID.fromString(partner2));
|
||||||
groupName
|
if (partner3 != null) participants.add(UUID.fromString(partner3));
|
||||||
);
|
|
||||||
} catch (Exception ignored) {
|
NexusLobby.getInstance().getConversationManager()
|
||||||
// Falls die UUID oder Gruppe ungültig ist
|
.playConversationGroup(participants, groupName);
|
||||||
}
|
} catch (Exception ignored) {
|
||||||
|
// Ungültige UUID oder fehlende Gruppe – still ignorieren
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +148,7 @@ public class ASTListener implements Listener {
|
|||||||
out.writeUTF("Connect");
|
out.writeUTF("Connect");
|
||||||
out.writeUTF(server);
|
out.writeUTF(server);
|
||||||
player.sendPluginMessage(NexusLobby.getInstance(), "BungeeCord", out.toByteArray());
|
player.sendPluginMessage(NexusLobby.getInstance(), "BungeeCord", out.toByteArray());
|
||||||
player.sendMessage("§8[§6Nexus§8] §7Du wirst mit §e" + server + " §7verbunden...");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§7Du wirst mit §e" + server + " §7verbunden...");
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW)
|
@EventHandler(priority = EventPriority.LOW)
|
||||||
@@ -118,6 +159,9 @@ public class ASTListener implements Listener {
|
|||||||
!title.equals("Pose: Körperteil wählen") &&
|
!title.equals("Pose: Körperteil wählen") &&
|
||||||
!title.startsWith("Achsen:")) return;
|
!title.startsWith("Achsen:")) return;
|
||||||
|
|
||||||
|
// Amboss-GUI wird von AnvilRenameGUI selbst verwaltet — hier nicht anfassen
|
||||||
|
if (title.equals("§6Name ändern")) return;
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
if (!(event.getWhoClicked() instanceof Player p)) return;
|
if (!(event.getWhoClicked() instanceof Player p)) return;
|
||||||
|
|
||||||
@@ -134,8 +178,11 @@ public class ASTListener implements Listener {
|
|||||||
ArmorStandTool tool = ArmorStandTool.get(item);
|
ArmorStandTool tool = ArmorStandTool.get(item);
|
||||||
if (tool != null) {
|
if (tool != null) {
|
||||||
tool.execute(as, p);
|
tool.execute(as, p);
|
||||||
// Menü aktualisieren, falls wir noch im selben Editor sind
|
// Editor nur neu öffnen wenn kein Chat-Input-Modus aktiv ist
|
||||||
if (p.getOpenInventory().getTitle().equals(title)) {
|
// und wir wirklich noch im Editor-Inventar sind
|
||||||
|
String newTitle = p.getOpenInventory().getTitle();
|
||||||
|
if (newTitle.equals("Nexus ArmorStand Editor")
|
||||||
|
&& !AST.chatInputMode.containsKey(p.getUniqueId())) {
|
||||||
new ArmorStandGUI(as, p);
|
new ArmorStandGUI(as, p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,95 @@
|
|||||||
|
package de.nexuslobby.modules.armorstandtools;
|
||||||
|
|
||||||
|
import de.nexuslobby.NexusLobby;
|
||||||
|
import io.papermc.paper.event.player.AsyncChatEvent;
|
||||||
|
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chat-basierte Namenseingabe für ArmorStands.
|
||||||
|
* Der Spieler tippt den neuen Namen in den Chat.
|
||||||
|
* Unterstützt & Farb-Codes.
|
||||||
|
*/
|
||||||
|
public class AnvilRenameGUI implements Listener {
|
||||||
|
|
||||||
|
private final Player player;
|
||||||
|
private final ArmorStand armorStand;
|
||||||
|
|
||||||
|
public AnvilRenameGUI(Player player, ArmorStand armorStand) {
|
||||||
|
this.player = player;
|
||||||
|
this.armorStand = armorStand;
|
||||||
|
|
||||||
|
// Listener registrieren
|
||||||
|
Bukkit.getPluginManager().registerEvents(this, NexusLobby.getInstance());
|
||||||
|
|
||||||
|
// Inventar schließen + Anweisung anzeigen
|
||||||
|
player.closeInventory();
|
||||||
|
|
||||||
|
// Title als UI-Feedback (wie AFK-Anzeige)
|
||||||
|
player.sendTitle(
|
||||||
|
"§6§lName eingeben",
|
||||||
|
"§7Schreibe den neuen Namen in den §eChat§7. §8(&-Codes erlaubt)",
|
||||||
|
10, 80, 20
|
||||||
|
);
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§7Gib den neuen §eNamen §7in den Chat ein. §8(&-Farb-Codes erlaubt)");
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§c'abbrechen' §7eingeben zum Abbrechen.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
// Chat-Event — Paper 1.21 AsyncChatEvent
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
|
public void onChat(AsyncChatEvent event) {
|
||||||
|
if (!event.getPlayer().equals(player)) return;
|
||||||
|
|
||||||
|
// Chat-Nachricht abfangen
|
||||||
|
event.setCancelled(true);
|
||||||
|
|
||||||
|
// Plain-Text aus Adventure Component extrahieren
|
||||||
|
String input = PlainTextComponentSerializer.plainText().serialize(event.message()).trim();
|
||||||
|
|
||||||
|
// Zurück auf Haupt-Thread wechseln für Bukkit-API Aufrufe
|
||||||
|
Bukkit.getScheduler().runTask(NexusLobby.getInstance(), () -> {
|
||||||
|
HandlerList.unregisterAll(this);
|
||||||
|
AST.chatInputMode.remove(player.getUniqueId());
|
||||||
|
|
||||||
|
if (input.equalsIgnoreCase("abbrechen")) {
|
||||||
|
player.sendTitle("§c§lAbgebrochen", "", 5, 30, 10);
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cNamensänderung abgebrochen.");
|
||||||
|
} else {
|
||||||
|
// & → § Farb-Codes
|
||||||
|
String newName = ChatColor.translateAlternateColorCodes('&', input);
|
||||||
|
armorStand.setCustomName(newName);
|
||||||
|
armorStand.setCustomNameVisible(!ChatColor.stripColor(newName).isEmpty());
|
||||||
|
|
||||||
|
player.sendTitle("§a§lName gesetzt!", "§r" + newName, 5, 40, 10);
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aName gesetzt: " + newName);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Zurück zum ArmorStand-Editor
|
||||||
|
if (armorStand.isValid()) {
|
||||||
|
new ArmorStandGUI(armorStand, player);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
// Logout — Listener sauber abmelden
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onQuit(PlayerQuitEvent event) {
|
||||||
|
if (!event.getPlayer().equals(player)) return;
|
||||||
|
HandlerList.unregisterAll(this);
|
||||||
|
AST.chatInputMode.remove(player.getUniqueId());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,14 +27,14 @@ import java.util.UUID;
|
|||||||
*/
|
*/
|
||||||
public class ArmorStandCmdExecutor implements CommandExecutor {
|
public class ArmorStandCmdExecutor implements CommandExecutor {
|
||||||
|
|
||||||
private final String prefix = "§8[§6Nexus§8] ";
|
private String prefix() { return de.nexuslobby.utils.LangManager.getPrefix(); }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
||||||
if (!(sender instanceof Player p)) return true;
|
if (!(sender instanceof Player p)) return true;
|
||||||
|
|
||||||
if (!p.hasPermission("nexuslobby.armorstand.cmd")) {
|
if (!p.hasPermission("nexuslobby.armorstand.cmd")) {
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("no_permission"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("no_permission"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
case "select4":
|
case "select4":
|
||||||
ArmorStand target = getTargetArmorStand(p);
|
ArmorStand target = getTargetArmorStand(p);
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,17 +63,17 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
UUID targetUUID = target.getUniqueId();
|
UUID targetUUID = target.getUniqueId();
|
||||||
|
|
||||||
p.setMetadata(metaKey, new FixedMetadataValue(NexusLobby.getInstance(), targetUUID.toString()));
|
p.setMetadata(metaKey, new FixedMetadataValue(NexusLobby.getInstance(), targetUUID.toString()));
|
||||||
p.sendMessage(prefix + "§aNPC §e" + slotStr + " §amarkiert (§7" + targetUUID.toString().substring(0, 8) + "...§a)");
|
p.sendMessage(prefix() + "§aNPC §e" + slotStr + " §amarkiert (§7" + targetUUID.toString().substring(0, 8) + "...§a)");
|
||||||
p.spawnParticle(Particle.WITCH, target.getLocation().add(0, 1.0, 0), 15, 0.2, 0.2, 0.2, 0.05);
|
p.spawnParticle(Particle.WITCH, target.getLocation().add(0, 1.0, 0), 15, 0.2, 0.2, 0.2, 0.05);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "link":
|
case "link":
|
||||||
if (args.length < 3) {
|
if (args.length < 3) {
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_link_usage"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("conv_link_usage"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!p.hasMetadata("conv_npc1") || !p.hasMetadata("conv_npc2")) {
|
if (!p.hasMetadata("conv_npc1") || !p.hasMetadata("conv_npc2")) {
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_mark_npcs"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("conv_mark_npcs"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,8 +101,8 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
// Im Manager speichern (Nutzt die erweiterte Methode für Gruppen)
|
// Im Manager speichern (Nutzt die erweiterte Methode für Gruppen)
|
||||||
NexusLobby.getInstance().getConversationManager().saveLinkExtended(id1, id2, id3, id4, dialogId);
|
NexusLobby.getInstance().getConversationManager().saveLinkExtended(id1, id2, id3, id4, dialogId);
|
||||||
|
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_link_created"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("conv_link_created"));
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_link_npcs").replace("{count}", (id3 == null ? "2" : (id4 == null ? "3" : "4"))));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("conv_link_npcs").replace("{count}", (id3 == null ? "2" : (id4 == null ? "3" : "4"))));
|
||||||
p.spawnParticle(Particle.HAPPY_VILLAGER, as1.getLocation().add(0, 1.5, 0), 20, 0.4, 0.4, 0.4, 0.1);
|
p.spawnParticle(Particle.HAPPY_VILLAGER, as1.getLocation().add(0, 1.5, 0), 20, 0.4, 0.4, 0.4, 0.1);
|
||||||
|
|
||||||
// Metadaten nach dem Linken aufräumen
|
// Metadaten nach dem Linken aufräumen
|
||||||
@@ -111,14 +111,14 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
p.removeMetadata("conv_npc3", NexusLobby.getInstance());
|
p.removeMetadata("conv_npc3", NexusLobby.getInstance());
|
||||||
p.removeMetadata("conv_npc4", NexusLobby.getInstance());
|
p.removeMetadata("conv_npc4", NexusLobby.getInstance());
|
||||||
} else {
|
} else {
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_speaker_not_found"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("conv_speaker_not_found"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "unlink":
|
case "unlink":
|
||||||
ArmorStand targetUnlink = getTargetArmorStand(p);
|
ArmorStand targetUnlink = getTargetArmorStand(p);
|
||||||
if (targetUnlink == null) {
|
if (targetUnlink == null) {
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_unlink_lookat"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("conv_unlink_lookat"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,17 +128,17 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
// Aus Konfiguration löschen
|
// Aus Konfiguration löschen
|
||||||
NexusLobby.getInstance().getConversationManager().removeLink(targetUnlink.getUniqueId());
|
NexusLobby.getInstance().getConversationManager().removeLink(targetUnlink.getUniqueId());
|
||||||
|
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_unlinked"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("conv_unlinked"));
|
||||||
p.spawnParticle(Particle.SMOKE, targetUnlink.getLocation().add(0, 1.0, 0), 20, 0.2, 0.2, 0.2, 0.02);
|
p.spawnParticle(Particle.SMOKE, targetUnlink.getLocation().add(0, 1.0, 0), 20, 0.2, 0.2, 0.2, 0.02);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "start":
|
case "start":
|
||||||
if (args.length < 3) {
|
if (args.length < 3) {
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_start_usage"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("conv_start_usage"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!p.hasMetadata("conv_npc1") || !p.hasMetadata("conv_npc2")) {
|
if (!p.hasMetadata("conv_npc1") || !p.hasMetadata("conv_npc2")) {
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_mark_two_npcs"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("conv_mark_two_npcs"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
ArmorStand target = getTargetArmorStand(p);
|
ArmorStand target = getTargetArmorStand(p);
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("say") && args.length >= 2) {
|
if (args[0].equalsIgnoreCase("say") && args.length >= 2) {
|
||||||
if (target == null) { p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required")); return true; }
|
if (target == null) { p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required")); return true; }
|
||||||
|
|
||||||
String text = buildString(args, 1);
|
String text = buildString(args, 1);
|
||||||
String colored = ChatColor.translateAlternateColorCodes('&', text);
|
String colored = ChatColor.translateAlternateColorCodes('&', text);
|
||||||
@@ -171,25 +171,25 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
// Nutzt die showBubble-Logik aus dem ConversationManager (Ohne Partner-Zwang)
|
// Nutzt die showBubble-Logik aus dem ConversationManager (Ohne Partner-Zwang)
|
||||||
NexusLobby.getInstance().getConversationManager().showBubble(target, colored);
|
NexusLobby.getInstance().getConversationManager().showBubble(target, colored);
|
||||||
|
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("npc_bubble_sent"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("npc_bubble_sent"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("lookat")) {
|
if (args[0].equalsIgnoreCase("lookat")) {
|
||||||
if (target == null) { p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required")); return true; }
|
if (target == null) { p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required")); return true; }
|
||||||
if (target.getScoreboardTags().contains("as_lookat")) {
|
if (target.getScoreboardTags().contains("as_lookat")) {
|
||||||
target.removeScoreboardTag("as_lookat");
|
target.removeScoreboardTag("as_lookat");
|
||||||
target.setHeadPose(new EulerAngle(0, 0, 0));
|
target.setHeadPose(new EulerAngle(0, 0, 0));
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("lookat_off"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("lookat_off"));
|
||||||
} else {
|
} else {
|
||||||
target.addScoreboardTag("as_lookat");
|
target.addScoreboardTag("as_lookat");
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("lookat_on"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("lookat_on"));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("name") && args.length >= 2) {
|
if (args[0].equalsIgnoreCase("name") && args.length >= 2) {
|
||||||
if (target == null) { p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required")); return true; }
|
if (target == null) { p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required")); return true; }
|
||||||
String nameInput = buildString(args, 1);
|
String nameInput = buildString(args, 1);
|
||||||
|
|
||||||
// Wichtig: Alle alten Namens-Tags entfernen für Konsistenz
|
// Wichtig: Alle alten Namens-Tags entfernen für Konsistenz
|
||||||
@@ -198,7 +198,7 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
if (nameInput.equalsIgnoreCase("none")) {
|
if (nameInput.equalsIgnoreCase("none")) {
|
||||||
target.setCustomName("");
|
target.setCustomName("");
|
||||||
target.setCustomNameVisible(false);
|
target.setCustomNameVisible(false);
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("name_removed"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("name_removed"));
|
||||||
} else {
|
} else {
|
||||||
String colored = ChatColor.translateAlternateColorCodes('&', nameInput);
|
String colored = ChatColor.translateAlternateColorCodes('&', nameInput);
|
||||||
target.setCustomName(colored);
|
target.setCustomName(colored);
|
||||||
@@ -208,19 +208,19 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
// ":" wird durch "§§" ersetzt, um Probleme in Scoreboard-Tags zu vermeiden
|
// ":" wird durch "§§" ersetzt, um Probleme in Scoreboard-Tags zu vermeiden
|
||||||
target.addScoreboardTag("as_displayname:" + nameInput.replace(":", "§§"));
|
target.addScoreboardTag("as_displayname:" + nameInput.replace(":", "§§"));
|
||||||
|
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("name_set").replace("{name}", colored));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("name_set").replace("{name}", colored));
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("status_backup_saved"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("status_backup_saved"));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("add") && args.length >= 5) {
|
if (args[0].equalsIgnoreCase("add") && args.length >= 5) {
|
||||||
if (target == null) { p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required")); return true; }
|
if (target == null) { p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required")); return true; }
|
||||||
String slot1 = args[1], slot2 = args[2], type = args[3].toLowerCase();
|
String slot1 = args[1], slot2 = args[2], type = args[3].toLowerCase();
|
||||||
String cmdStr = buildString(args, 4);
|
String cmdStr = buildString(args, 4);
|
||||||
|
|
||||||
target.addScoreboardTag("ascmd:" + slot1 + ":" + slot2 + ":" + type + ":" + cmdStr);
|
target.addScoreboardTag("ascmd:" + slot1 + ":" + slot2 + ":" + type + ":" + cmdStr);
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("command_bound"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("command_bound"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,7 +234,19 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
if (args[0].equalsIgnoreCase("remove")) {
|
if (args[0].equalsIgnoreCase("remove")) {
|
||||||
if (target == null) { p.sendMessage(de.nexuslobby.utils.LangManager.get("no_target")); return true; }
|
if (target == null) { p.sendMessage(de.nexuslobby.utils.LangManager.get("no_target")); return true; }
|
||||||
target.getScoreboardTags().removeIf(tag -> tag.startsWith("ascmd:"));
|
target.getScoreboardTags().removeIf(tag -> tag.startsWith("ascmd:"));
|
||||||
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("commands_removed"));
|
p.sendMessage(prefix() + de.nexuslobby.utils.LangManager.get("commands_removed"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args[0].equalsIgnoreCase("clearbubbles")) {
|
||||||
|
ConversationManager cm = NexusLobby.getInstance().getConversationManager();
|
||||||
|
if (cm == null) {
|
||||||
|
p.sendMessage(prefix() + "§cConversationManager ist nicht aktiv.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
cm.clearHangingBubbles();
|
||||||
|
p.sendMessage(prefix() + "§aAlle hängenden Sprechblasen wurden entfernt.");
|
||||||
|
p.playSound(p.getLocation(), org.bukkit.Sound.BLOCK_NOTE_BLOCK_PLING, 1f, 2f);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,6 +296,7 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
p.sendMessage("§e/nexuscmd conv §7- Gesprächs-Menü");
|
p.sendMessage("§e/nexuscmd conv §7- Gesprächs-Menü");
|
||||||
p.sendMessage("§e/nexuscmd list §7- Zeigt alle Tags");
|
p.sendMessage("§e/nexuscmd list §7- Zeigt alle Tags");
|
||||||
p.sendMessage("§e/nexuscmd remove §7- Löscht Befehle");
|
p.sendMessage("§e/nexuscmd remove §7- Löscht Befehle");
|
||||||
|
p.sendMessage("§e/nexuscmd clearbubbles §7- Entfernt hängende Sprechblasen");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ public class ArmorStandCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fester Prefix für maximale Build-Sicherheit
|
// Fester Prefix für maximale Build-Sicherheit
|
||||||
String prefix = "§8[§6Nexus§8] ";
|
String prefix = de.nexuslobby.utils.LangManager.getPrefix();
|
||||||
|
|
||||||
if (!p.hasPermission("nexuslobby.armorstand.use")) {
|
if (!p.hasPermission("nexuslobby.armorstand.use")) {
|
||||||
p.sendMessage(prefix + ChatColor.RED + "Dazu hast du keine Rechte!");
|
p.sendMessage(prefix + ChatColor.RED + "Dazu hast du keine Rechte!");
|
||||||
|
|||||||
@@ -51,19 +51,19 @@ public enum ArmorStandTool {
|
|||||||
case GRAV -> as.setGravity(!as.hasGravity());
|
case GRAV -> as.setGravity(!as.hasGravity());
|
||||||
case INVUL -> as.setInvulnerable(!as.isInvulnerable());
|
case INVUL -> as.setInvulnerable(!as.isInvulnerable());
|
||||||
case SET_NAME -> {
|
case SET_NAME -> {
|
||||||
p.closeInventory();
|
|
||||||
p.sendMessage("§8[§6Nexus§8] §7Nutze §e/nexuscmd name <Text>");
|
|
||||||
AST.selectedArmorStand.put(p.getUniqueId(), as);
|
AST.selectedArmorStand.put(p.getUniqueId(), as);
|
||||||
|
AST.chatInputMode.put(p.getUniqueId(), as);
|
||||||
|
new AnvilRenameGUI(p, as); // schließt Inventar intern
|
||||||
}
|
}
|
||||||
case CONV_SETUP -> {
|
case CONV_SETUP -> {
|
||||||
// Automatisches Markieren via GUI
|
// Automatisches Markieren via GUI
|
||||||
if (!p.hasMetadata("conv_npc1")) {
|
if (!p.hasMetadata("conv_npc1")) {
|
||||||
p.setMetadata("conv_npc1", new FixedMetadataValue(NexusLobby.getInstance(), as.getUniqueId().toString()));
|
p.setMetadata("conv_npc1", new FixedMetadataValue(NexusLobby.getInstance(), as.getUniqueId().toString()));
|
||||||
p.sendMessage("§8[§6Nexus§8] §aNPC als Sprecher 1 markiert.");
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aNPC als Sprecher 1 markiert.");
|
||||||
} else {
|
} else {
|
||||||
p.setMetadata("conv_npc2", new FixedMetadataValue(NexusLobby.getInstance(), as.getUniqueId().toString()));
|
p.setMetadata("conv_npc2", new FixedMetadataValue(NexusLobby.getInstance(), as.getUniqueId().toString()));
|
||||||
p.sendMessage("§8[§6Nexus§8] §aNPC als Sprecher 2 markiert.");
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aNPC als Sprecher 2 markiert.");
|
||||||
p.sendMessage("§8[§6Nexus§8] §7Nutze nun §e/nexuscmd conv start <ID>");
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§7Nutze nun §e/nexuscmd conv start <ID>");
|
||||||
}
|
}
|
||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
}
|
}
|
||||||
@@ -99,8 +99,11 @@ public enum ArmorStandTool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static ArmorStandTool get(ItemStack item) {
|
public static ArmorStandTool get(ItemStack item) {
|
||||||
if (item == null || !item.hasItemMeta() || !item.getItemMeta().hasDisplayName()) return null;
|
if (item == null || !item.hasItemMeta()) return null;
|
||||||
String name = ChatColor.stripColor(item.getItemMeta().getDisplayName()).replace(" ", "_");
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
// FIX: getItemMeta() kann null zurückgeben; hasDisplayName() vor getDisplayName() prüfen
|
||||||
|
if (meta == null || !meta.hasDisplayName()) return null;
|
||||||
|
String name = ChatColor.stripColor(meta.getDisplayName()).replace(" ", "_");
|
||||||
if (name.equals("Pose_Editor_öffnen")) return OPEN_POSE_EDITOR;
|
if (name.equals("Pose_Editor_öffnen")) return OPEN_POSE_EDITOR;
|
||||||
if (name.equals("Gesprächs-Setup")) return CONV_SETUP;
|
if (name.equals("Gesprächs-Setup")) return CONV_SETUP;
|
||||||
try { return valueOf(name); } catch (Exception e) { return null; }
|
try { return valueOf(name); } catch (Exception e) { return null; }
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ public class ConversationManager {
|
|||||||
|
|
||||||
// Verhindert Mehrfach-Gespräche und regelt die 60s Pause
|
// Verhindert Mehrfach-Gespräche und regelt die 60s Pause
|
||||||
private final Set<UUID> activeSpeakers = new HashSet<>();
|
private final Set<UUID> activeSpeakers = new HashSet<>();
|
||||||
|
// Alle aktiven Bubble-Entities tracken – für zuverlässiges Cleanup bei Reload/Crash
|
||||||
|
private final Set<UUID> activeBubbles = new HashSet<>();
|
||||||
|
|
||||||
public ConversationManager(NexusLobby plugin) {
|
public ConversationManager(NexusLobby plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
@@ -45,13 +47,23 @@ public class ConversationManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Entfernt alle verwaisten Sprechblasen in allen Welten.
|
* Entfernt alle verwaisten Sprechblasen in allen Welten.
|
||||||
|
* FIX: Nur ArmorStands mit dem Tag "nexus_bubble" werden entfernt.
|
||||||
|
* Die alte Bedingung (!isVisible && isMarker && customName != null) war
|
||||||
|
* zu breit und hätte auch legitime Marker-ArmorStands anderer Systeme gelöscht.
|
||||||
*/
|
*/
|
||||||
public void clearHangingBubbles() {
|
public void clearHangingBubbles() {
|
||||||
|
// Zuerst: Alle getrackte Bubble-Entities direkt entfernen (schnell, kein World-Scan nötig)
|
||||||
|
for (UUID uuid : new HashSet<>(activeBubbles)) {
|
||||||
|
Entity e = Bukkit.getEntity(uuid);
|
||||||
|
if (e != null) e.remove();
|
||||||
|
}
|
||||||
|
activeBubbles.clear();
|
||||||
|
|
||||||
|
// Danach: Vollständiger World-Scan als Fallback (fängt Bubbles nach Crash/Reload ab)
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (World world : Bukkit.getWorlds()) {
|
for (World world : Bukkit.getWorlds()) {
|
||||||
for (ArmorStand as : world.getEntitiesByClass(ArmorStand.class)) {
|
for (ArmorStand as : world.getEntitiesByClass(ArmorStand.class)) {
|
||||||
if (as.getScoreboardTags().contains("nexus_bubble") ||
|
if (as.getScoreboardTags().contains("nexus_bubble")) {
|
||||||
(!as.isVisible() && as.isMarker() && as.getCustomName() != null)) {
|
|
||||||
as.remove();
|
as.remove();
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@@ -226,10 +238,15 @@ public class ConversationManager {
|
|||||||
s.setCustomName(ChatColorTranslate(text));
|
s.setCustomName(ChatColorTranslate(text));
|
||||||
s.setCustomNameVisible(true);
|
s.setCustomNameVisible(true);
|
||||||
s.setInvulnerable(true);
|
s.setInvulnerable(true);
|
||||||
|
s.setPersistent(false); // Überlebt keinen Server-Neustart/-Absturz
|
||||||
s.addScoreboardTag("nexus_bubble");
|
s.addScoreboardTag("nexus_bubble");
|
||||||
});
|
});
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskLater(plugin, bubble::remove, 80L); // 4s Sichtbarkeit
|
activeBubbles.add(bubble.getUniqueId());
|
||||||
|
Bukkit.getScheduler().runTaskLater(plugin, () -> {
|
||||||
|
bubble.remove();
|
||||||
|
activeBubbles.remove(bubble.getUniqueId());
|
||||||
|
}, 80L); // 4s Sichtbarkeit
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Legacy Support & Config Methoden ---
|
// --- Legacy Support & Config Methoden ---
|
||||||
@@ -273,8 +290,8 @@ public class ConversationManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void reload() {
|
public void reload() {
|
||||||
setupFile();
|
clearHangingBubbles(); // Erst aufräumen, dann neu laden
|
||||||
activeSpeakers.clear();
|
activeSpeakers.clear();
|
||||||
clearHangingBubbles();
|
setupFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,6 @@ public class DynamicArmorStandModule implements Module {
|
|||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
startUpdateTask();
|
startUpdateTask();
|
||||||
Bukkit.getLogger().info("§a[NexusLobby] DynamicArmorStandModule aktiv: Ingame-Zeit & Sternen-Effekt geladen.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startUpdateTask() {
|
private void startUpdateTask() {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,7 @@ public class BorderCommand implements CommandExecutor {
|
|||||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
||||||
if (!(sender instanceof Player p)) return true;
|
if (!(sender instanceof Player p)) return true;
|
||||||
if (!p.hasPermission("nexuslobby.admin")) {
|
if (!p.hasPermission("nexuslobby.admin")) {
|
||||||
p.sendMessage("§8[§6Nexus§8] §cKeine Rechte.");
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cKeine Rechte.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,11 +40,22 @@ public class BorderCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
double radius = Double.parseDouble(args[1]);
|
double radius = Double.parseDouble(args[1]);
|
||||||
|
Location loc = p.getLocation();
|
||||||
|
|
||||||
config.set("worldborder.type", "CIRCLE");
|
config.set("worldborder.type", "CIRCLE");
|
||||||
config.set("worldborder.center", p.getLocation());
|
|
||||||
config.set("worldborder.radius", radius);
|
|
||||||
config.set("worldborder.enabled", true);
|
config.set("worldborder.enabled", true);
|
||||||
p.sendMessage("§8[§6Nexus§8] §aKreis-Grenze (Radius: " + radius + ") gesetzt.");
|
config.set("worldborder.radius", radius);
|
||||||
|
|
||||||
|
// FIX: Location als einzelne Werte speichern statt als Objekt.
|
||||||
|
// config.set(key, Location) ist nach Neustarts unzuverlässig,
|
||||||
|
// weil config.getLocation() die Welt zum Deserialisierungs-
|
||||||
|
// zeitpunkt auflösen muss und das fehlschlagen kann.
|
||||||
|
config.set("worldborder.center.world", loc.getWorld().getName());
|
||||||
|
config.set("worldborder.center.x", loc.getX());
|
||||||
|
config.set("worldborder.center.y", loc.getY());
|
||||||
|
config.set("worldborder.center.z", loc.getZ());
|
||||||
|
|
||||||
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aKreis-Grenze (Radius: " + radius + ") gesetzt.");
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
p.sendMessage("§cUngültige Zahl.");
|
p.sendMessage("§cUngültige Zahl.");
|
||||||
return true;
|
return true;
|
||||||
@@ -54,18 +65,29 @@ public class BorderCommand implements CommandExecutor {
|
|||||||
Location l1 = PortalCommand.getSelection1(p);
|
Location l1 = PortalCommand.getSelection1(p);
|
||||||
Location l2 = PortalCommand.getSelection2(p);
|
Location l2 = PortalCommand.getSelection2(p);
|
||||||
if (l1 == null || l2 == null) {
|
if (l1 == null || l2 == null) {
|
||||||
p.sendMessage("§8[§6Nexus§8] §cBitte markiere erst 2 Punkte mit der Portalwand!");
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cBitte markiere erst 2 Punkte mit der Portalwand!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
config.set("worldborder.type", "SQUARE");
|
config.set("worldborder.type", "SQUARE");
|
||||||
config.set("worldborder.pos1", l1);
|
|
||||||
config.set("worldborder.pos2", l2);
|
|
||||||
config.set("worldborder.enabled", true);
|
config.set("worldborder.enabled", true);
|
||||||
p.sendMessage("§8[§6Nexus§8] §aViereckige Grenze erfolgreich gesetzt.");
|
|
||||||
|
// FIX: Beide Positionen als einzelne Werte speichern
|
||||||
|
config.set("worldborder.pos1.world", l1.getWorld().getName());
|
||||||
|
config.set("worldborder.pos1.x", l1.getX());
|
||||||
|
config.set("worldborder.pos1.y", l1.getY());
|
||||||
|
config.set("worldborder.pos1.z", l1.getZ());
|
||||||
|
|
||||||
|
config.set("worldborder.pos2.world", l2.getWorld().getName());
|
||||||
|
config.set("worldborder.pos2.x", l2.getX());
|
||||||
|
config.set("worldborder.pos2.y", l2.getY());
|
||||||
|
config.set("worldborder.pos2.z", l2.getZ());
|
||||||
|
|
||||||
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aViereckige Grenze erfolgreich gesetzt.");
|
||||||
}
|
}
|
||||||
case "disable" -> {
|
case "disable" -> {
|
||||||
config.set("worldborder.enabled", false);
|
config.set("worldborder.enabled", false);
|
||||||
p.sendMessage("§8[§6Nexus§8] §cGrenze wurde deaktiviert.");
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cGrenze wurde deaktiviert.");
|
||||||
}
|
}
|
||||||
default -> {
|
default -> {
|
||||||
p.sendMessage("§cUnbekannter Unterbefehl.");
|
p.sendMessage("§cUnbekannter Unterbefehl.");
|
||||||
|
|||||||
@@ -9,19 +9,29 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verwaltet die Lobby-Begrenzung (Kreis oder Rechteck).
|
* Verwaltet die Lobby-Begrenzung (Kreis oder Rechteck).
|
||||||
* Speichert Daten in der Haupt-config.yml unter 'worldborder'.
|
* Speichert Daten in der Haupt-config.yml unter 'worldborder'.
|
||||||
|
*
|
||||||
|
* FIX: Locations werden als einzelne Werte (worldName, x, y, z) gespeichert
|
||||||
|
* statt als serialisiertes Location-Objekt, da config.getLocation()
|
||||||
|
* nach einem Neustart unzuverlässig ist.
|
||||||
*/
|
*/
|
||||||
public class BorderModule implements Module, Listener {
|
public class BorderModule implements Module, Listener {
|
||||||
|
|
||||||
private String type;
|
private String type;
|
||||||
private Location pos1, pos2, center;
|
// FIX: Statt Location-Objekte die rohen Werte cachen
|
||||||
|
private String pos1World, pos2World, centerWorld;
|
||||||
|
private double pos1X, pos1Y, pos1Z;
|
||||||
|
private double pos2X, pos2Y, pos2Z;
|
||||||
|
private double centerX, centerZ;
|
||||||
private double radius;
|
private double radius;
|
||||||
private boolean enabled;
|
private boolean enabled;
|
||||||
|
private boolean hasPos1, hasPos2, hasCenter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() { return "WorldBorder"; }
|
public String getName() { return "WorldBorder"; }
|
||||||
@@ -34,87 +44,108 @@ public class BorderModule implements Module, Listener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
// Aufräumarbeiten falls nötig
|
// FIX: Listener beim Deaktivieren abmelden, damit nach /reload
|
||||||
|
// keine doppelten Events gefeuert werden.
|
||||||
|
HandlerList.unregisterAll(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lädt die Border-Einstellungen aus der config.yml.
|
* Lädt die Border-Einstellungen aus der config.yml.
|
||||||
* Wird auch von NexusLobby.reloadPlugin() aufgerufen.
|
* Wird auch von BorderCommand und NexusLobby.reloadPlugin() aufgerufen.
|
||||||
|
*
|
||||||
|
* FIX: Robuste Methode - liest world-Name und einzelne Koordinaten,
|
||||||
|
* kein config.getLocation() mehr (das nach Neustarts versagen kann).
|
||||||
*/
|
*/
|
||||||
public void reloadConfig() {
|
public void reloadConfig() {
|
||||||
FileConfiguration config = NexusLobby.getInstance().getConfig();
|
FileConfiguration config = NexusLobby.getInstance().getConfig();
|
||||||
|
|
||||||
// Pfad in der config.yml: worldborder.enabled etc.
|
|
||||||
this.enabled = config.getBoolean("worldborder.enabled", false);
|
this.enabled = config.getBoolean("worldborder.enabled", false);
|
||||||
this.type = config.getString("worldborder.type", "CIRCLE");
|
this.type = config.getString("worldborder.type", "CIRCLE").toUpperCase();
|
||||||
this.radius = config.getDouble("worldborder.radius", 50.0);
|
this.radius = config.getDouble("worldborder.radius", 50.0);
|
||||||
|
|
||||||
// Locations laden
|
// --- CIRCLE-Daten laden ---
|
||||||
this.center = config.getLocation("worldborder.center");
|
this.hasCenter = config.contains("worldborder.center.world");
|
||||||
this.pos1 = config.getLocation("worldborder.pos1");
|
if (hasCenter) {
|
||||||
this.pos2 = config.getLocation("worldborder.pos2");
|
this.centerWorld = config.getString("worldborder.center.world");
|
||||||
|
this.centerX = config.getDouble("worldborder.center.x");
|
||||||
|
this.centerZ = config.getDouble("worldborder.center.z");
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- SQUARE-Daten laden ---
|
||||||
|
this.hasPos1 = config.contains("worldborder.pos1.world");
|
||||||
|
this.hasPos2 = config.contains("worldborder.pos2.world");
|
||||||
|
if (hasPos1) {
|
||||||
|
this.pos1World = config.getString("worldborder.pos1.world");
|
||||||
|
this.pos1X = config.getDouble("worldborder.pos1.x");
|
||||||
|
this.pos1Y = config.getDouble("worldborder.pos1.y");
|
||||||
|
this.pos1Z = config.getDouble("worldborder.pos1.z");
|
||||||
|
}
|
||||||
|
if (hasPos2) {
|
||||||
|
this.pos2World = config.getString("worldborder.pos2.world");
|
||||||
|
this.pos2X = config.getDouble("worldborder.pos2.x");
|
||||||
|
this.pos2Y = config.getDouble("worldborder.pos2.y");
|
||||||
|
this.pos2Z = config.getDouble("worldborder.pos2.z");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onMove(PlayerMoveEvent event) {
|
public void onMove(PlayerMoveEvent event) {
|
||||||
if (!enabled || event.getTo() == null) return;
|
if (!enabled || event.getTo() == null) return;
|
||||||
|
|
||||||
// Performance: Nur prüfen, wenn sich die Block-Koordinaten ändern
|
// Performance: Nur prüfen wenn sich Block-Koordinaten ändern
|
||||||
if (event.getFrom().getBlockX() == event.getTo().getBlockX() &&
|
if (event.getFrom().getBlockX() == event.getTo().getBlockX() &&
|
||||||
event.getFrom().getBlockZ() == event.getTo().getBlockZ() &&
|
event.getFrom().getBlockZ() == event.getTo().getBlockZ() &&
|
||||||
event.getFrom().getBlockY() == event.getTo().getBlockY()) return;
|
event.getFrom().getBlockY() == event.getTo().getBlockY()) return;
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
// Admins und Spectators ignorieren
|
// FIX: nexuslobby.border.bypass statt nur nexuslobby.admin prüfen
|
||||||
if (player.hasPermission("nexuslobby.admin") || player.getGameMode().name().equals("SPECTATOR")) return;
|
if (player.hasPermission("nexuslobby.border.bypass") ||
|
||||||
|
player.hasPermission("nexuslobby.admin") ||
|
||||||
|
player.getGameMode().name().equals("SPECTATOR")) return;
|
||||||
|
|
||||||
Location to = event.getTo();
|
Location to = event.getTo();
|
||||||
boolean outside = false;
|
boolean outside = false;
|
||||||
|
|
||||||
// --- Prüfung: Kreis-Border ---
|
// --- Prüfung: Kreis-Border ---
|
||||||
if (type.equalsIgnoreCase("CIRCLE") && center != null) {
|
if (type.equals("CIRCLE") && hasCenter) {
|
||||||
if (to.getWorld().equals(center.getWorld())) {
|
World cWorld = Bukkit.getWorld(centerWorld);
|
||||||
double distSq = Math.pow(to.getX() - center.getX(), 2) + Math.pow(to.getZ() - center.getZ(), 2);
|
if (cWorld != null && to.getWorld().equals(cWorld)) {
|
||||||
if (distSq > Math.pow(radius, 2)) outside = true;
|
double distSq = Math.pow(to.getX() - centerX, 2) + Math.pow(to.getZ() - centerZ, 2);
|
||||||
|
if (distSq > radius * radius) outside = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// --- Prüfung: Rechteck-Border (Square) ---
|
// --- Prüfung: Rechteck-Border (Square) ---
|
||||||
else if (type.equalsIgnoreCase("SQUARE") && pos1 != null && pos2 != null) {
|
else if (type.equals("SQUARE") && hasPos1 && hasPos2) {
|
||||||
if (to.getWorld().equals(pos1.getWorld())) {
|
World bWorld = Bukkit.getWorld(pos1World);
|
||||||
double minX = Math.min(pos1.getX(), pos2.getX());
|
if (bWorld != null && to.getWorld().equals(bWorld)) {
|
||||||
double maxX = Math.max(pos1.getX(), pos2.getX());
|
double minX = Math.min(pos1X, pos2X);
|
||||||
double minZ = Math.min(pos1.getZ(), pos2.getZ());
|
double maxX = Math.max(pos1X, pos2X);
|
||||||
double maxZ = Math.max(pos1.getZ(), pos2.getZ());
|
double minZ = Math.min(pos1Z, pos2Z);
|
||||||
|
double maxZ = Math.max(pos1Z, pos2Z);
|
||||||
if (to.getX() < minX || to.getX() > maxX || to.getZ() < minZ || to.getZ() > maxZ) {
|
if (to.getX() < minX || to.getX() > maxX ||
|
||||||
|
to.getZ() < minZ || to.getZ() > maxZ) {
|
||||||
outside = true;
|
outside = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Aktion wenn außerhalb ---
|
|
||||||
if (outside) {
|
if (outside) {
|
||||||
Location spawnLocation = getMainSpawnLocation();
|
Location spawnLocation = getMainSpawnLocation();
|
||||||
|
|
||||||
if (spawnLocation != null) {
|
if (spawnLocation != null) {
|
||||||
// Sofortiger Teleport zum definierten Spawn
|
|
||||||
player.teleport(spawnLocation);
|
player.teleport(spawnLocation);
|
||||||
|
|
||||||
// Feedback an den Spieler
|
|
||||||
player.playSound(player.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT, 1.0f, 0.5f);
|
player.playSound(player.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT, 1.0f, 0.5f);
|
||||||
player.sendMessage("§8[§6Nexus§8] §cDu hast den Lobby-Bereich verlassen!");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cDu hast den Lobby-Bereich verlassen!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holt den zentralen Spawnpunkt aus der Config (Pfad: spawn.world, spawn.x, etc.)
|
* Holt den Spawnpunkt aus der Config (Pfad: spawn.world, spawn.x, etc.)
|
||||||
*/
|
*/
|
||||||
private Location getMainSpawnLocation() {
|
private Location getMainSpawnLocation() {
|
||||||
FileConfiguration config = NexusLobby.getInstance().getConfig();
|
FileConfiguration config = NexusLobby.getInstance().getConfig();
|
||||||
String worldName = config.getString("spawn.world");
|
String worldName = config.getString("spawn.world");
|
||||||
|
|
||||||
if (worldName != null) {
|
if (worldName != null) {
|
||||||
World w = Bukkit.getWorld(worldName);
|
World w = Bukkit.getWorld(worldName);
|
||||||
if (w != null) {
|
if (w != null) {
|
||||||
@@ -126,7 +157,6 @@ public class BorderModule implements Module, Listener {
|
|||||||
(float) config.getDouble("spawn.pitch"));
|
(float) config.getDouble("spawn.pitch"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Fallback falls kein Spawn gesetzt ist
|
|
||||||
return Bukkit.getWorlds().isEmpty() ? null : Bukkit.getWorlds().get(0).getSpawnLocation();
|
return Bukkit.getWorlds().isEmpty() ? null : Bukkit.getWorlds().get(0).getSpawnLocation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,77 +1,70 @@
|
|||||||
package de.nexuslobby.modules.gadgets;
|
package de.nexuslobby.modules.gadgets;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class Balloon {
|
public class Balloon {
|
||||||
|
private final UUID playerUUID;
|
||||||
|
private final LivingEntity balloonEntity;
|
||||||
|
private final ArmorStand headStand;
|
||||||
|
|
||||||
private final UUID playerUUID;
|
public Balloon(Player player, Material balloonMaterial) {
|
||||||
private final LivingEntity balloonEntity;
|
this.playerUUID = player.getUniqueId();
|
||||||
private final ArmorStand headStand;
|
Location loc = player.getLocation().add((double)0.0F, (double)2.0F, (double)0.0F);
|
||||||
|
this.balloonEntity = (LivingEntity)loc.getWorld().spawnEntity(loc, EntityType.PIG);
|
||||||
|
this.balloonEntity.setInvisible(true);
|
||||||
|
this.balloonEntity.setSilent(true);
|
||||||
|
this.balloonEntity.setInvulnerable(true);
|
||||||
|
this.balloonEntity.setGravity(false);
|
||||||
|
this.balloonEntity.setLeashHolder(player);
|
||||||
|
this.balloonEntity.addScoreboardTag("nexus_balloon");
|
||||||
|
this.headStand = (ArmorStand)loc.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
|
||||||
|
this.headStand.setVisible(false);
|
||||||
|
this.headStand.setGravity(false);
|
||||||
|
this.headStand.setMarker(true);
|
||||||
|
this.headStand.setHelmet(new ItemStack(balloonMaterial));
|
||||||
|
}
|
||||||
|
|
||||||
public Balloon(Player player, Material balloonMaterial) {
|
public void update() {
|
||||||
this.playerUUID = player.getUniqueId();
|
Player player = Bukkit.getPlayer(this.playerUUID);
|
||||||
Location loc = player.getLocation().add(0, 2, 0);
|
if (player != null && player.isOnline() && this.balloonEntity != null && this.balloonEntity.isValid()) {
|
||||||
|
if (!this.balloonEntity.isLeashed()) {
|
||||||
|
this.remove();
|
||||||
|
} else {
|
||||||
|
Location targetLoc = player.getLocation().clone().add((double)0.0F, (double)2.5F, (double)0.0F);
|
||||||
|
Vector direction = targetLoc.toVector().subtract(this.balloonEntity.getLocation().toVector());
|
||||||
|
double distance = direction.length();
|
||||||
|
if (distance > (double)5.0F) {
|
||||||
|
this.balloonEntity.teleport(targetLoc);
|
||||||
|
} else if (distance > 0.1) {
|
||||||
|
this.balloonEntity.setVelocity(direction.multiply(0.4));
|
||||||
|
}
|
||||||
|
|
||||||
// Das unsichtbare Träger-Entity
|
this.headStand.teleport(this.balloonEntity.getLocation().clone().subtract((double)0.0F, (double)1.5F, (double)0.0F));
|
||||||
this.balloonEntity = (LivingEntity) loc.getWorld().spawnEntity(loc, EntityType.PIG);
|
}
|
||||||
this.balloonEntity.setInvisible(true);
|
} else {
|
||||||
this.balloonEntity.setSilent(true);
|
this.remove();
|
||||||
this.balloonEntity.setInvulnerable(true);
|
}
|
||||||
this.balloonEntity.setGravity(false);
|
}
|
||||||
this.balloonEntity.setLeashHolder(player);
|
|
||||||
|
|
||||||
// Der ArmorStand, der den farbigen Block trägt
|
public void remove() {
|
||||||
this.headStand = (ArmorStand) loc.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
|
if (this.balloonEntity != null) {
|
||||||
this.headStand.setVisible(false);
|
this.balloonEntity.setLeashHolder((Entity)null);
|
||||||
this.headStand.setGravity(false);
|
this.balloonEntity.remove();
|
||||||
this.headStand.setMarker(true);
|
}
|
||||||
|
|
||||||
// Hier wird das übergebene Material gesetzt (z.B. RED_WOOL, BLUE_WOOL etc.)
|
if (this.headStand != null) {
|
||||||
this.headStand.setHelmet(new ItemStack(balloonMaterial));
|
this.headStand.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update() {
|
}
|
||||||
Player player = org.bukkit.Bukkit.getPlayer(playerUUID);
|
|
||||||
|
|
||||||
if (player == null || !player.isOnline() || balloonEntity == null || !balloonEntity.isValid()) {
|
|
||||||
remove();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!balloonEntity.isLeashed()) {
|
|
||||||
remove();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Location targetLoc = player.getLocation().clone().add(0, 2.5, 0);
|
|
||||||
Vector direction = targetLoc.toVector().subtract(balloonEntity.getLocation().toVector());
|
|
||||||
double distance = direction.length();
|
|
||||||
|
|
||||||
if (distance > 5) {
|
|
||||||
balloonEntity.teleport(targetLoc);
|
|
||||||
} else if (distance > 0.1) {
|
|
||||||
balloonEntity.setVelocity(direction.multiply(0.4));
|
|
||||||
}
|
|
||||||
|
|
||||||
headStand.teleport(balloonEntity.getLocation().clone().subtract(0, 1.5, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void remove() {
|
|
||||||
if (balloonEntity != null) {
|
|
||||||
balloonEntity.setLeashHolder(null);
|
|
||||||
balloonEntity.remove();
|
|
||||||
}
|
|
||||||
if (headStand != null) {
|
|
||||||
headStand.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,11 @@
|
|||||||
package de.nexuslobby.modules.gadgets;
|
package de.nexuslobby.modules.gadgets;
|
||||||
|
|
||||||
import de.nexuslobby.NexusLobby;
|
import de.nexuslobby.NexusLobby;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Random;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
@@ -10,45 +15,40 @@ import org.bukkit.entity.EntityType;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class ChickenRain {
|
public class ChickenRain {
|
||||||
|
private static final Set<UUID> activeRains = Collections.synchronizedSet(new HashSet());
|
||||||
|
|
||||||
public static void start(Player player) {
|
public static void start(final Player player) {
|
||||||
new BukkitRunnable() {
|
if (!activeRains.contains(player.getUniqueId())) {
|
||||||
|
activeRains.add(player.getUniqueId());
|
||||||
|
(new BukkitRunnable() {
|
||||||
int ticks = 0;
|
int ticks = 0;
|
||||||
final Random random = new Random();
|
final Random random = new Random();
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!player.isOnline() || ticks > 100) { // 100 Ticks = 5 Sekunden
|
if (player.isOnline() && this.ticks <= 100) {
|
||||||
this.cancel();
|
if (this.ticks % 2 == 0) {
|
||||||
return;
|
Location spawnLoc = player.getLocation().add((this.random.nextDouble() - (double)0.5F) * (double)4.0F, (double)4.0F, (this.random.nextDouble() - (double)0.5F) * (double)4.0F);
|
||||||
}
|
Chicken chicken = (Chicken)spawnLoc.getWorld().spawnEntity(spawnLoc, EntityType.CHICKEN);
|
||||||
|
chicken.setBaby();
|
||||||
// Alle 2 Ticks ein Huhn spawnen
|
chicken.setInvulnerable(true);
|
||||||
if (ticks % 2 == 0) {
|
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), () -> {
|
||||||
Location spawnLoc = player.getLocation().add(
|
|
||||||
(random.nextDouble() - 0.5) * 4,
|
|
||||||
4.0,
|
|
||||||
(random.nextDouble() - 0.5) * 4
|
|
||||||
);
|
|
||||||
|
|
||||||
Chicken chicken = (Chicken) spawnLoc.getWorld().spawnEntity(spawnLoc, EntityType.CHICKEN);
|
|
||||||
chicken.setBaby();
|
|
||||||
chicken.setInvulnerable(true);
|
|
||||||
|
|
||||||
// Nach 1.5 Sekunden "ploppt" das Huhn
|
|
||||||
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), () -> {
|
|
||||||
if (chicken.isValid()) {
|
if (chicken.isValid()) {
|
||||||
chicken.getWorld().spawnParticle(Particle.CLOUD, chicken.getLocation(), 5, 0.2, 0.2, 0.2, 0.1);
|
chicken.getWorld().spawnParticle(Particle.CLOUD, chicken.getLocation(), 5, 0.2, 0.2, 0.2, 0.1);
|
||||||
chicken.getWorld().playSound(chicken.getLocation(), Sound.ENTITY_CHICKEN_EGG, 1.0f, 1.5f);
|
chicken.getWorld().playSound(chicken.getLocation(), Sound.ENTITY_CHICKEN_EGG, 1.0F, 1.5F);
|
||||||
chicken.remove();
|
chicken.remove();
|
||||||
}
|
}
|
||||||
}, 30L);
|
|
||||||
}
|
}, 30L);
|
||||||
ticks++;
|
}
|
||||||
|
|
||||||
|
++this.ticks;
|
||||||
|
} else {
|
||||||
|
ChickenRain.activeRains.remove(player.getUniqueId());
|
||||||
|
this.cancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}.runTaskTimer(NexusLobby.getInstance(), 0L, 1L);
|
}).runTaskTimer(NexusLobby.getInstance(), 0L, 1L);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,97 +1,100 @@
|
|||||||
package de.nexuslobby.modules.gadgets;
|
package de.nexuslobby.modules.gadgets;
|
||||||
|
|
||||||
import de.nexuslobby.NexusLobby;
|
import de.nexuslobby.NexusLobby;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class FreezeRay {
|
public class FreezeRay {
|
||||||
// Auf public gesetzt, damit das GadgetModule im PlayerMoveEvent darauf prüfen kann
|
private static final Set<UUID> frozenPlayers = new HashSet();
|
||||||
public static final Set<UUID> frozenPlayers = new HashSet<>();
|
|
||||||
|
|
||||||
public static void shoot(Player shooter) {
|
public static boolean isFrozen(UUID uuid) {
|
||||||
Location start = shooter.getEyeLocation();
|
return frozenPlayers.contains(uuid);
|
||||||
Vector direction = start.getDirection();
|
}
|
||||||
|
|
||||||
// Sound beim Schießen
|
public static void unfreeze(UUID uuid) {
|
||||||
shooter.getWorld().playSound(start, Sound.ENTITY_SNOW_GOLEM_SHOOT, 1.0f, 1.5f);
|
frozenPlayers.remove(uuid);
|
||||||
|
}
|
||||||
|
|
||||||
// Wir prüfen in 0.3er Schritten bis zu 15 Blöcke weit
|
public static void shoot(Player shooter) {
|
||||||
for (double d = 0; d < 15; d += 0.3) {
|
Location start = shooter.getEyeLocation();
|
||||||
Location point = start.clone().add(direction.clone().multiply(d));
|
Vector direction = start.getDirection();
|
||||||
|
shooter.getWorld().playSound(start, Sound.ENTITY_SNOW_GOLEM_SHOOT, 1.0F, 1.5F);
|
||||||
|
|
||||||
// Partikel-Strahl sichtbar machen
|
for(double d = (double)0.0F; d < (double)15.0F; d += 0.3) {
|
||||||
point.getWorld().spawnParticle(Particle.SNOWFLAKE, point, 1, 0, 0, 0, 0);
|
Location point = start.clone().add(direction.clone().multiply(d));
|
||||||
|
point.getWorld().spawnParticle(Particle.SNOWFLAKE, point, 1, (double)0.0F, (double)0.0F, (double)0.0F, (double)0.0F);
|
||||||
|
|
||||||
// Prüfung auf Spieler im Umkreis von 0.8 Blöcken (etwas großzügiger)
|
for(Entity entity : point.getWorld().getNearbyEntities(point, 0.8, 0.8, 0.8)) {
|
||||||
for (Entity entity : point.getWorld().getNearbyEntities(point, 0.8, 0.8, 0.8)) {
|
if (entity instanceof Player target) {
|
||||||
if (entity instanceof Player target && target != shooter) {
|
if (target != shooter) {
|
||||||
applyFreeze(target);
|
if (GadgetShield.isProtected(target)) {
|
||||||
return; // Stoppt den Strahl beim ersten Treffer
|
String reason = GadgetShield.isAdminShielded(target) ? "Dieser Spieler hat Gadget-Schutz aktiviert." : "Dieser Spieler ist gerade im Parkour.";
|
||||||
}
|
shooter.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§7" + reason);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
applyFreeze(target);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Stoppe den Strahl, falls er eine Wand trifft
|
if (point.getBlock().getType().isSolid()) {
|
||||||
if (point.getBlock().getType().isSolid()) {
|
break;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void applyFreeze(Player target) {
|
}
|
||||||
if (frozenPlayers.contains(target.getUniqueId())) return;
|
|
||||||
|
|
||||||
frozenPlayers.add(target.getUniqueId());
|
private static void applyFreeze(final Player target) {
|
||||||
|
if (!frozenPlayers.contains(target.getUniqueId())) {
|
||||||
// Fixiere die Position für den Stasis-Effekt
|
frozenPlayers.add(target.getUniqueId());
|
||||||
final Location freezeLocation = target.getLocation();
|
final Location freezeLocation = target.getLocation();
|
||||||
|
target.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§bDu wurdest eingefroren!");
|
||||||
// Feedback für getroffenen Spieler
|
target.getWorld().playSound(target.getLocation(), Sound.BLOCK_GLASS_BREAK, 1.0F, 0.5F);
|
||||||
target.sendMessage("§8[§6Nexus§8] §bDu wurdest eingefroren!");
|
(new BukkitRunnable() {
|
||||||
target.getWorld().playSound(target.getLocation(), Sound.BLOCK_GLASS_BREAK, 1.0f, 0.5f);
|
|
||||||
|
|
||||||
new org.bukkit.scheduler.BukkitRunnable() {
|
|
||||||
int ticks = 0;
|
int ticks = 0;
|
||||||
@Override
|
|
||||||
public void run() {
|
public void run() {
|
||||||
// Sicherheitscheck: Ist der Spieler noch online?
|
if (target.isOnline() && this.ticks < 60) {
|
||||||
if (!target.isOnline() || ticks >= 60) {
|
if (GadgetShield.isProtected(target)) {
|
||||||
frozenPlayers.remove(target.getUniqueId());
|
FreezeRay.frozenPlayers.remove(target.getUniqueId());
|
||||||
this.cancel();
|
this.cancel();
|
||||||
return;
|
} else {
|
||||||
}
|
target.setVelocity(new Vector(0, 0, 0));
|
||||||
|
Location current = target.getLocation();
|
||||||
|
if (current.getX() != freezeLocation.getX() || current.getZ() != freezeLocation.getZ()) {
|
||||||
|
freezeLocation.setYaw(current.getYaw());
|
||||||
|
freezeLocation.setPitch(current.getPitch());
|
||||||
|
target.teleport(freezeLocation);
|
||||||
|
}
|
||||||
|
|
||||||
// Stasis-Effekt: Bewegung auf 0 setzen und Position fixieren
|
Location loc = target.getLocation();
|
||||||
target.setVelocity(new Vector(0, 0, 0));
|
|
||||||
|
|
||||||
// Alle 2 Ticks zurückteleportieren, falls er versucht zu laufen
|
for(int i = 0; i < 8; ++i) {
|
||||||
// (Behält die Blickrichtung des Spielers bei)
|
double angle = (double)i * Math.PI / (double)4.0F;
|
||||||
Location current = target.getLocation();
|
double x = Math.cos(angle) * 0.7;
|
||||||
if (current.getX() != freezeLocation.getX() || current.getZ() != freezeLocation.getZ()) {
|
double z = Math.sin(angle) * 0.7;
|
||||||
freezeLocation.setYaw(current.getYaw());
|
loc.getWorld().spawnParticle(Particle.SNOWFLAKE, loc.clone().add(x, (double)1.0F, z), 1, (double)0.0F, (double)0.0F, (double)0.0F, (double)0.0F);
|
||||||
freezeLocation.setPitch(current.getPitch());
|
loc.getWorld().spawnParticle(Particle.SNOWFLAKE, loc.clone().add(x, 0.2, z), 1, (double)0.0F, (double)0.0F, (double)0.0F, (double)0.0F);
|
||||||
target.teleport(freezeLocation);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Optischer Käfig (Ring-Effekt)
|
this.ticks += 2;
|
||||||
Location loc = target.getLocation();
|
}
|
||||||
for (int i = 0; i < 8; i++) {
|
} else {
|
||||||
double angle = i * Math.PI / 4;
|
FreezeRay.frozenPlayers.remove(target.getUniqueId());
|
||||||
double x = Math.cos(angle) * 0.7;
|
this.cancel();
|
||||||
double z = Math.sin(angle) * 0.7;
|
}
|
||||||
loc.getWorld().spawnParticle(Particle.SNOWFLAKE, loc.clone().add(x, 1, z), 1, 0, 0, 0, 0);
|
|
||||||
loc.getWorld().spawnParticle(Particle.SNOWFLAKE, loc.clone().add(x, 0.2, z), 1, 0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
ticks += 2;
|
|
||||||
}
|
}
|
||||||
}.runTaskTimer(NexusLobby.getInstance(), 0L, 2L);
|
}).runTaskTimer(NexusLobby.getInstance(), 0L, 2L);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,45 @@
|
|||||||
|
package de.nexuslobby.modules.gadgets;
|
||||||
|
|
||||||
|
import de.nexuslobby.NexusLobby;
|
||||||
|
import de.nexuslobby.modules.parkour.ParkourManager;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class GadgetShield {
|
||||||
|
private static final Set<UUID> shielded = new HashSet();
|
||||||
|
|
||||||
|
public static boolean toggle(Player player) {
|
||||||
|
UUID uuid = player.getUniqueId();
|
||||||
|
if (shielded.contains(uuid)) {
|
||||||
|
shielded.remove(uuid);
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cGadget-Schutz §7deaktiviert.");
|
||||||
|
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_BASS, 1.0F, 1.0F);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
shielded.add(uuid);
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aGadget-Schutz §7aktiviert. §8Du bist nun immun gegen Gadgets.");
|
||||||
|
player.playSound(player.getLocation(), Sound.BLOCK_AMETHYST_BLOCK_CHIME, 1.0F, 1.5F);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isAdminShielded(Player player) {
|
||||||
|
return shielded.contains(player.getUniqueId());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isProtected(Player player) {
|
||||||
|
if (shielded.contains(player.getUniqueId())) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
ParkourManager pm = NexusLobby.getInstance().getParkourManager();
|
||||||
|
return pm != null && pm.isIngame(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clear() {
|
||||||
|
shielded.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,32 +6,20 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class GrapplingHook {
|
public class GrapplingHook {
|
||||||
|
public static void pullPlayer(Player player, Location target) {
|
||||||
|
Location playerLoc = player.getLocation();
|
||||||
|
double distance = target.distance(playerLoc);
|
||||||
|
if (!(distance < (double)2.0F) && !(distance > (double)50.0F)) {
|
||||||
|
Vector v = target.toVector().subtract(playerLoc.toVector());
|
||||||
|
v.multiply(0.3);
|
||||||
|
v.setY(v.getY() * 0.6 + (double)0.5F);
|
||||||
|
if (v.length() > (double)2.5F) {
|
||||||
|
v.normalize().multiply((double)2.5F);
|
||||||
|
}
|
||||||
|
|
||||||
public static void pullPlayer(Player player, Location target) {
|
player.setVelocity(v);
|
||||||
Location playerLoc = player.getLocation();
|
player.playSound(playerLoc, Sound.ENTITY_WIND_CHARGE_WIND_BURST, 1.0F, 1.2F);
|
||||||
|
player.playSound(playerLoc, Sound.ITEM_TRIDENT_RIPTIDE_1, 0.5F, 1.5F);
|
||||||
// Vektor vom Spieler zum Ziel berechnen
|
}
|
||||||
double distance = target.distance(playerLoc);
|
}
|
||||||
|
|
||||||
// Wenn das Ziel zu nah oder zu weit weg ist, nichts tun
|
|
||||||
if (distance < 2 || distance > 50) return;
|
|
||||||
|
|
||||||
// Berechnung des Wurfs (Vektor)
|
|
||||||
Vector v = target.toVector().subtract(playerLoc.toVector());
|
|
||||||
|
|
||||||
// Den Vektor normalisieren und skalieren (Stärke des Zugs)
|
|
||||||
v.multiply(0.3); // Basis-Geschwindigkeit
|
|
||||||
v.setY(v.getY() * 0.6 + 0.5); // Etwas mehr Höhe für den Bogen-Effekt
|
|
||||||
|
|
||||||
// Geschwindigkeit begrenzen, damit man nicht aus der Map schießt
|
|
||||||
if (v.length() > 2.5) {
|
|
||||||
v.normalize().multiply(2.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
player.setVelocity(v);
|
|
||||||
|
|
||||||
// Sound-Effekt für das "Ziehen"
|
|
||||||
player.playSound(playerLoc, Sound.ENTITY_WIND_CHARGE_WIND_BURST, 1.0f, 1.2f);
|
|
||||||
player.playSound(playerLoc, Sound.ITEM_TRIDENT_RIPTIDE_1, 0.5f, 1.5f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -6,21 +6,19 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
public class HatManager {
|
public class HatManager {
|
||||||
|
public static void setHat(Player player, Material material, String name) {
|
||||||
|
ItemStack hat = new ItemStack(material);
|
||||||
|
ItemMeta meta = hat.getItemMeta();
|
||||||
|
if (meta != null) {
|
||||||
|
meta.setDisplayName("§6Hut: " + name);
|
||||||
|
hat.setItemMeta(meta);
|
||||||
|
}
|
||||||
|
|
||||||
public static void setHat(Player player, Material material, String name) {
|
player.getInventory().setHelmet(hat);
|
||||||
ItemStack hat = new ItemStack(material);
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aDu trägst nun: " + name);
|
||||||
ItemMeta meta = hat.getItemMeta();
|
}
|
||||||
if (meta != null) {
|
|
||||||
meta.setDisplayName("§6Hut: " + name);
|
|
||||||
hat.setItemMeta(meta);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Den Gegenstand auf den Kopf setzen
|
public static void removeHat(Player player) {
|
||||||
player.getInventory().setHelmet(hat);
|
player.getInventory().setHelmet((ItemStack)null);
|
||||||
player.sendMessage("§8[§6Nexus§8] §aDu trägst nun: " + name);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static void removeHat(Player player) {
|
|
||||||
player.getInventory().setHelmet(null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package de.nexuslobby.modules.gadgets;
|
package de.nexuslobby.modules.gadgets;
|
||||||
|
|
||||||
import de.nexuslobby.NexusLobby;
|
import de.nexuslobby.NexusLobby;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
@@ -9,39 +10,45 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class MeteorStrike {
|
public class MeteorStrike {
|
||||||
|
public static void launch(Player shooter) {
|
||||||
|
Location target = null;
|
||||||
|
Location start = shooter.getEyeLocation();
|
||||||
|
Vector direction = start.getDirection();
|
||||||
|
|
||||||
public static void launch(Player shooter) {
|
for(double d = (double)0.0F; d < (double)30.0F; d += (double)0.5F) {
|
||||||
Location target = null;
|
Location point = start.clone().add(direction.clone().multiply(d));
|
||||||
Location start = shooter.getEyeLocation();
|
if (point.getBlock().getType().isSolid()) {
|
||||||
Vector direction = start.getDirection();
|
target = point;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (double d = 0; d < 30; d += 0.5) {
|
if (target != null) {
|
||||||
Location point = start.clone().add(direction.clone().multiply(d));
|
Location finalTarget = target.clone().add((double)0.0F, (double)0.5F, (double)0.0F);
|
||||||
if (point.getBlock().getType().isSolid()) {
|
finalTarget.getWorld().spawnParticle(Particle.FLAME, finalTarget, 20, (double)0.5F, 0.1, (double)0.5F, 0.05);
|
||||||
target = point;
|
shooter.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cMeteorit im Anflug...");
|
||||||
break;
|
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), () -> {
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (target == null) return;
|
|
||||||
final Location finalTarget = target.clone().add(0, 0.5, 0);
|
|
||||||
|
|
||||||
finalTarget.getWorld().spawnParticle(Particle.FLAME, finalTarget, 20, 0.5, 0.1, 0.5, 0.05);
|
|
||||||
shooter.sendMessage("§8[§6Nexus§8] §cMeteorit im Anflug...");
|
|
||||||
|
|
||||||
org.bukkit.Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), () -> {
|
|
||||||
// EXPLOSION_EMITTER ist der moderne Name für HUGE_EXPLOSION
|
|
||||||
finalTarget.getWorld().spawnParticle(Particle.EXPLOSION_EMITTER, finalTarget, 1);
|
finalTarget.getWorld().spawnParticle(Particle.EXPLOSION_EMITTER, finalTarget, 1);
|
||||||
finalTarget.getWorld().spawnParticle(Particle.LAVA, finalTarget, 30, 0.5, 0.5, 0.5, 0.1);
|
finalTarget.getWorld().spawnParticle(Particle.LAVA, finalTarget, 30, (double)0.5F, (double)0.5F, (double)0.5F, 0.1);
|
||||||
finalTarget.getWorld().playSound(finalTarget, Sound.ENTITY_GENERIC_EXPLODE, 1.0f, 0.8f);
|
finalTarget.getWorld().playSound(finalTarget, Sound.ENTITY_GENERIC_EXPLODE, 1.0F, 0.8F);
|
||||||
|
|
||||||
for (Entity entity : finalTarget.getWorld().getNearbyEntities(finalTarget, 4, 4, 4)) {
|
for(Entity entity : finalTarget.getWorld().getNearbyEntities(finalTarget, (double)4.0F, (double)4.0F, (double)4.0F)) {
|
||||||
if (entity instanceof Player p) {
|
if (entity instanceof Player p) {
|
||||||
Vector v = p.getLocation().toVector().subtract(finalTarget.toVector()).normalize().multiply(1.5).setY(0.5);
|
if (GadgetShield.isProtected(p)) {
|
||||||
p.setVelocity(v);
|
if (GadgetShield.isAdminShielded(p)) {
|
||||||
p.sendMessage("§cBUMM!");
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§7Dein Gadget-Schutzschild hat den Meteoriten abgelenkt!");
|
||||||
}
|
} else {
|
||||||
|
p.sendMessage("§8[§6Parkour§8] §7Dein Parkour-Schutzschild hat den Meteoriten abgelenkt!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Vector v = p.getLocation().toVector().subtract(finalTarget.toVector()).normalize().multiply((double)1.5F).setY((double)0.5F);
|
||||||
|
p.setVelocity(v);
|
||||||
|
p.sendMessage("§cBUMM!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, 30L);
|
|
||||||
}
|
}, 30L);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package de.nexuslobby.modules.gadgets;
|
package de.nexuslobby.modules.gadgets;
|
||||||
|
|
||||||
import de.nexuslobby.NexusLobby;
|
import de.nexuslobby.NexusLobby;
|
||||||
|
import java.util.Random;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@@ -10,80 +11,65 @@ import org.bukkit.block.Block;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class PaintballGun {
|
public class PaintballGun {
|
||||||
private static final Random random = new Random();
|
private static final Random random = new Random();
|
||||||
|
private static final Material[] COLORS;
|
||||||
|
|
||||||
// Wir nutzen jetzt Wolle für kräftigere Farben
|
public static void shoot(Player shooter) {
|
||||||
private static final Material[] COLORS = {
|
Location start = shooter.getEyeLocation();
|
||||||
Material.RED_WOOL, Material.BLUE_WOOL, Material.LIME_WOOL,
|
Vector direction = start.getDirection();
|
||||||
Material.ORANGE_WOOL, Material.MAGENTA_WOOL, Material.LIGHT_BLUE_WOOL,
|
Material randomColor = COLORS[random.nextInt(COLORS.length)];
|
||||||
Material.YELLOW_WOOL, Material.PURPLE_WOOL, Material.PINK_WOOL
|
shooter.getWorld().playSound(start, Sound.ENTITY_CHICKEN_EGG, 1.0F, 2.0F);
|
||||||
};
|
|
||||||
|
|
||||||
public static void shoot(Player shooter) {
|
for(double d = (double)0.0F; d < (double)25.0F; d += (double)0.5F) {
|
||||||
Location start = shooter.getEyeLocation();
|
Location point = start.clone().add(direction.clone().multiply(d));
|
||||||
Vector direction = start.getDirection();
|
point.getWorld().spawnParticle(Particle.ITEM_SNOWBALL, point, 1, (double)0.0F, (double)0.0F, (double)0.0F, (double)0.0F);
|
||||||
Material randomColor = COLORS[random.nextInt(COLORS.length)];
|
Block block = point.getBlock();
|
||||||
|
if (block.getType().isSolid()) {
|
||||||
|
impact(block, randomColor);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
shooter.getWorld().playSound(start, Sound.ENTITY_CHICKEN_EGG, 1.0f, 2.0f);
|
}
|
||||||
|
|
||||||
for (double d = 0; d < 25; d += 0.5) {
|
private static void impact(Block centerBlock, Material color) {
|
||||||
Location point = start.clone().add(direction.clone().multiply(d));
|
Location centerLoc = centerBlock.getLocation();
|
||||||
|
centerLoc.getWorld().playSound(centerLoc, Sound.ENTITY_SLIME_SQUISH, 1.0F, 1.2F);
|
||||||
|
int radius = 2;
|
||||||
|
|
||||||
// Flug-Partikel (kleiner Rauch oder Schneeball)
|
for(int x = -radius; x <= radius; ++x) {
|
||||||
point.getWorld().spawnParticle(Particle.ITEM_SNOWBALL, point, 1, 0, 0, 0, 0);
|
for(int y = -radius; y <= radius; ++y) {
|
||||||
|
for(int z = -radius; z <= radius; ++z) {
|
||||||
Block block = point.getBlock();
|
if ((double)(x * x + y * y + z * z) <= (double)(radius * radius) + (double)0.5F) {
|
||||||
if (block.getType().isSolid()) {
|
Block target = centerLoc.clone().add((double)x, (double)y, (double)z).getBlock();
|
||||||
impact(block, randomColor);
|
if (target.getType().isSolid()) {
|
||||||
break;
|
applyColor(target, color);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void impact(Block centerBlock, Material color) {
|
}
|
||||||
Location centerLoc = centerBlock.getLocation();
|
|
||||||
centerLoc.getWorld().playSound(centerLoc, Sound.ENTITY_SLIME_SQUISH, 1.0f, 1.2f);
|
|
||||||
|
|
||||||
int radius = 2; // Radius der Farbkugel
|
private static void applyColor(Block block, Material color) {
|
||||||
|
Location loc = block.getLocation();
|
||||||
|
loc.getWorld().spawnParticle(Particle.BLOCK, loc.clone().add((double)0.5F, (double)0.5F, (double)0.5F), 3, 0.1, 0.1, 0.1, color.createBlockData());
|
||||||
|
|
||||||
// Wir gehen alle Blöcke im Würfel um den Einschlag durch
|
for(Player online : Bukkit.getOnlinePlayers()) {
|
||||||
for (int x = -radius; x <= radius; x++) {
|
online.sendBlockChange(loc, color.createBlockData());
|
||||||
for (int y = -radius; y <= radius; y++) {
|
}
|
||||||
for (int z = -radius; z <= radius; z++) {
|
|
||||||
|
|
||||||
// Berechne Distanz für eine Kugelform (statt Würfel)
|
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), () -> {
|
||||||
if (x * x + y * y + z * z <= radius * radius + 0.5) {
|
for(Player online : Bukkit.getOnlinePlayers()) {
|
||||||
Block target = centerLoc.clone().add(x, y, z).getBlock();
|
online.sendBlockChange(loc, block.getBlockData());
|
||||||
|
}
|
||||||
|
|
||||||
// Nur solide Blöcke färben (keine Luft/Gras)
|
}, 400L);
|
||||||
if (target.getType().isSolid()) {
|
}
|
||||||
applyColor(target, color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void applyColor(Block block, Material color) {
|
static {
|
||||||
Location loc = block.getLocation();
|
COLORS = new Material[]{Material.RED_WOOL, Material.BLUE_WOOL, Material.LIME_WOOL, Material.ORANGE_WOOL, Material.MAGENTA_WOOL, Material.LIGHT_BLUE_WOOL, Material.YELLOW_WOOL, Material.PURPLE_WOOL, Material.PINK_WOOL};
|
||||||
|
}
|
||||||
// Effekt-Partikel am Block
|
|
||||||
loc.getWorld().spawnParticle(Particle.BLOCK, loc.clone().add(0.5, 0.5, 0.5), 3, 0.1, 0.1, 0.1, color.createBlockData());
|
|
||||||
|
|
||||||
// Block-Änderung an alle senden
|
|
||||||
for (Player online : Bukkit.getOnlinePlayers()) {
|
|
||||||
online.sendBlockChange(loc, color.createBlockData());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Nach 10 Sekunden zurücksetzen
|
|
||||||
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), () -> {
|
|
||||||
for (Player online : Bukkit.getOnlinePlayers()) {
|
|
||||||
online.sendBlockChange(loc, block.getBlockData());
|
|
||||||
}
|
|
||||||
}, 400L);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -5,27 +5,29 @@ import org.bukkit.Particle;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class ParticleEffect {
|
public class ParticleEffect {
|
||||||
private final String type;
|
private final String type;
|
||||||
private double angle = 0;
|
private double angle = (double)0.0F;
|
||||||
|
|
||||||
public ParticleEffect(String type) { this.type = type; }
|
public ParticleEffect(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
public void update(Player player) {
|
public void update(Player player) {
|
||||||
Location loc = player.getLocation();
|
Location loc = player.getLocation();
|
||||||
switch (type.toLowerCase()) {
|
switch (this.type.toLowerCase()) {
|
||||||
case "hearts":
|
case "hearts":
|
||||||
player.getWorld().spawnParticle(Particle.HEART, loc.clone().add(0, 2.2, 0), 1, 0.3, 0.3, 0.3, 0);
|
player.getWorld().spawnParticle(Particle.HEART, loc.clone().add((double)0.0F, 2.2, (double)0.0F), 1, 0.3, 0.3, 0.3, (double)0.0F);
|
||||||
break;
|
break;
|
||||||
case "flames":
|
case "flames":
|
||||||
double x = 0.6 * Math.cos(angle);
|
double x = 0.6 * Math.cos(this.angle);
|
||||||
double z = 0.6 * Math.sin(angle);
|
double z = 0.6 * Math.sin(this.angle);
|
||||||
player.getWorld().spawnParticle(Particle.FLAME, loc.clone().add(x, 0.1, z), 1, 0, 0, 0, 0);
|
player.getWorld().spawnParticle(Particle.FLAME, loc.clone().add(x, 0.1, z), 1, (double)0.0F, (double)0.0F, (double)0.0F, (double)0.0F);
|
||||||
angle += 0.2;
|
this.angle += 0.2;
|
||||||
break;
|
break;
|
||||||
case "cloud":
|
case "cloud":
|
||||||
player.getWorld().spawnParticle(Particle.CLOUD, loc.clone().add(0, 2.5, 0), 2, 0.2, 0.05, 0.2, 0);
|
player.getWorld().spawnParticle(Particle.CLOUD, loc.clone().add((double)0.0F, (double)2.5F, (double)0.0F), 2, 0.2, 0.05, 0.2, (double)0.0F);
|
||||||
player.getWorld().spawnParticle(Particle.FALLING_WATER, loc.clone().add(0, 2.4, 0), 1, 0.1, 0, 0.1, 0);
|
player.getWorld().spawnParticle(Particle.FALLING_WATER, loc.clone().add((double)0.0F, 2.4, (double)0.0F), 1, 0.1, (double)0.0F, 0.1, (double)0.0F);
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,138 +1,234 @@
|
|||||||
package de.nexuslobby.modules.gadgets;
|
package de.nexuslobby.modules.gadgets;
|
||||||
|
|
||||||
import de.nexuslobby.NexusLobby;
|
import de.nexuslobby.NexusLobby;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.NamespacedKey;
|
||||||
|
import org.bukkit.Registry;
|
||||||
|
import org.bukkit.entity.Ageable;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Fox;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Tameable;
|
import org.bukkit.entity.Tameable;
|
||||||
|
import org.bukkit.entity.Wolf;
|
||||||
|
import org.bukkit.entity.Fox.Type;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.bukkit.event.entity.EntityTargetEvent;
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
import org.bukkit.scoreboard.Scoreboard;
|
||||||
import java.util.HashMap;
|
import org.bukkit.scoreboard.Team;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class PetManager implements Listener {
|
public class PetManager implements Listener {
|
||||||
|
private static final Map<UUID, Entity> activePets = new HashMap();
|
||||||
|
private static PetManager instance;
|
||||||
|
|
||||||
private static final Map<UUID, Entity> activePets = new HashMap<>();
|
public PetManager() {
|
||||||
|
Bukkit.getPluginManager().registerEvents(this, NexusLobby.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
public PetManager() {
|
public static void register() {
|
||||||
Bukkit.getPluginManager().registerEvents(this, NexusLobby.getInstance());
|
if (instance == null) {
|
||||||
}
|
instance = new PetManager();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
}
|
||||||
* Spawnt ein echtes Tier-Entity für den Spieler.
|
|
||||||
*/
|
|
||||||
public static void spawnEntityPet(Player player, String type) {
|
|
||||||
removePet(player);
|
|
||||||
|
|
||||||
EntityType entityType;
|
public static void unregister() {
|
||||||
try {
|
if (instance != null) {
|
||||||
entityType = EntityType.valueOf(type);
|
HandlerList.unregisterAll(instance);
|
||||||
} catch (IllegalArgumentException e) {
|
instance = null;
|
||||||
player.sendMessage("§cFehler: Tier-Typ nicht gefunden.");
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Location loc = player.getLocation();
|
}
|
||||||
Entity pet = player.getWorld().spawnEntity(loc, entityType);
|
|
||||||
|
|
||||||
pet.setCustomName("§d" + player.getName() + "'s " + capitalize(type.toLowerCase()));
|
public static void spawnEntityPet(Player player, String type) {
|
||||||
pet.setCustomNameVisible(true);
|
spawnEntityPet(player, type, false);
|
||||||
pet.setInvulnerable(true);
|
}
|
||||||
pet.setPersistent(false);
|
|
||||||
|
|
||||||
if (pet instanceof LivingEntity) {
|
public static void spawnEntityPet(Player player, String type, boolean baby) {
|
||||||
LivingEntity le = (LivingEntity) pet;
|
spawnEntityPet(player, type, baby, (String)null);
|
||||||
le.setRemoveWhenFarAway(false);
|
}
|
||||||
|
|
||||||
// Verhindert, dass das Pet andere angreift
|
public static void spawnEntityPet(Player player, String type, boolean baby, String variantName) {
|
||||||
if (le instanceof Tameable) {
|
removePet(player);
|
||||||
((Tameable) le).setTamed(true);
|
|
||||||
((Tameable) le).setOwner(player);
|
EntityType entityType;
|
||||||
|
try {
|
||||||
|
entityType = EntityType.valueOf(type);
|
||||||
|
} catch (IllegalArgumentException var12) {
|
||||||
|
player.sendMessage("§cFehler: Tier-Typ nicht gefunden.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Location loc = player.getLocation();
|
||||||
|
Entity pet = player.getWorld().spawnEntity(loc, entityType);
|
||||||
|
String agePrefix = baby ? "§bBaby " : "";
|
||||||
|
String petName = buildPetDisplayName(type, variantName);
|
||||||
|
pet.setCustomName(agePrefix + petName);
|
||||||
|
pet.setCustomNameVisible(true);
|
||||||
|
pet.setInvulnerable(true);
|
||||||
|
pet.setPersistent(false);
|
||||||
|
applyNeutralPetTeam(pet);
|
||||||
|
if (pet instanceof LivingEntity le) {
|
||||||
|
le.setRemoveWhenFarAway(false);
|
||||||
|
if (le instanceof Ageable ageable) {
|
||||||
|
if (baby) {
|
||||||
|
ageable.setBaby();
|
||||||
|
} else {
|
||||||
|
ageable.setAdult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
activePets.put(player.getUniqueId(), pet);
|
if (le instanceof Wolf && variantName != null && !variantName.isEmpty()) {
|
||||||
}
|
Wolf.Variant variant = resolveWolfVariant(variantName);
|
||||||
|
if (variant != null) {
|
||||||
|
((Wolf)le).setVariant(variant);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
if (le instanceof Fox && variantName != null && !variantName.isEmpty()) {
|
||||||
* Steuert das Folgen der Tiere. Wird vom GadgetModule-Timer aufgerufen.
|
try {
|
||||||
*/
|
((Fox)le).setFoxType(Type.valueOf(variantName));
|
||||||
public static void updatePets() {
|
} catch (IllegalArgumentException var11) {
|
||||||
for (Map.Entry<UUID, Entity> entry : activePets.entrySet()) {
|
}
|
||||||
Player owner = Bukkit.getPlayer(entry.getKey());
|
}
|
||||||
Entity pet = entry.getValue();
|
|
||||||
|
|
||||||
if (owner == null || !owner.isOnline() || pet.isDead()) {
|
if (le instanceof Tameable) {
|
||||||
continue;
|
((Tameable)le).setTamed(true);
|
||||||
|
((Tameable)le).setOwner(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
activePets.put(player.getUniqueId(), pet);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void updatePets() {
|
||||||
|
for(Map.Entry<UUID, Entity> entry : activePets.entrySet()) {
|
||||||
|
Player owner = Bukkit.getPlayer((UUID)entry.getKey());
|
||||||
|
Entity pet = (Entity)entry.getValue();
|
||||||
|
if (owner != null && owner.isOnline() && !pet.isDead()) {
|
||||||
|
if (pet.getWorld().equals(owner.getWorld()) && !(pet.getLocation().distance(owner.getLocation()) > (double)10.0F)) {
|
||||||
|
if (pet.getLocation().distance(owner.getLocation()) > (double)3.0F) {
|
||||||
|
Location target = owner.getLocation().clone().add(owner.getLocation().getDirection().multiply((double)-1.5F));
|
||||||
|
target.setY(owner.getLocation().getY());
|
||||||
|
pet.teleport(pet.getLocation().add(target.toVector().subtract(pet.getLocation().toVector()).normalize().multiply(0.2)));
|
||||||
|
Location lookAt = pet.getLocation();
|
||||||
|
lookAt.setDirection(owner.getLocation().toVector().subtract(pet.getLocation().toVector()));
|
||||||
|
pet.teleport(lookAt);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
pet.teleport(owner.getLocation());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void removePet(Player player) {
|
||||||
|
if (activePets.containsKey(player.getUniqueId())) {
|
||||||
|
Entity pet = (Entity)activePets.get(player.getUniqueId());
|
||||||
|
removeFromPetTeam(pet);
|
||||||
|
pet.remove();
|
||||||
|
activePets.remove(player.getUniqueId());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clearAll() {
|
||||||
|
for(Entity pet : activePets.values()) {
|
||||||
|
removeFromPetTeam(pet);
|
||||||
|
pet.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
activePets.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String capitalize(String str) {
|
||||||
|
if (str != null && !str.isEmpty()) {
|
||||||
|
String var10000 = str.substring(0, 1).toUpperCase();
|
||||||
|
return var10000 + str.substring(1);
|
||||||
|
} else {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String buildPetDisplayName(String type, String variantName) {
|
||||||
|
String baseType = capitalize(type.toLowerCase());
|
||||||
|
if (variantName != null && !variantName.isEmpty()) {
|
||||||
|
String variant = capitalize(variantName.toLowerCase());
|
||||||
|
return variant + " " + baseType;
|
||||||
|
} else {
|
||||||
|
return baseType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Wolf.Variant resolveWolfVariant(String variantName) {
|
||||||
|
String keyName = variantName.toLowerCase();
|
||||||
|
NamespacedKey key = NamespacedKey.minecraft(keyName);
|
||||||
|
return (Wolf.Variant)Registry.WOLF_VARIANT.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Team getOrCreatePetTeam() {
|
||||||
|
Scoreboard scoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
|
||||||
|
Team team = scoreboard.getTeam("nexus_pets");
|
||||||
|
if (team == null) {
|
||||||
|
team = scoreboard.registerNewTeam("nexus_pets");
|
||||||
|
team.setPrefix("");
|
||||||
|
team.setSuffix("");
|
||||||
|
}
|
||||||
|
|
||||||
|
return team;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void applyNeutralPetTeam(Entity pet) {
|
||||||
|
Team team = getOrCreatePetTeam();
|
||||||
|
String entry = pet.getUniqueId().toString();
|
||||||
|
if (!team.hasEntry(entry)) {
|
||||||
|
team.addEntry(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void removeFromPetTeam(Entity pet) {
|
||||||
|
if (pet != null) {
|
||||||
|
Scoreboard scoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
|
||||||
|
Team team = scoreboard.getTeam("nexus_pets");
|
||||||
|
if (team != null) {
|
||||||
|
String entry = pet.getUniqueId().toString();
|
||||||
|
if (team.hasEntry(entry)) {
|
||||||
|
team.removeEntry(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wenn das Pet in einer anderen Welt ist oder zu weit weg, teleportiere es
|
}
|
||||||
if (!pet.getWorld().equals(owner.getWorld()) || pet.getLocation().distance(owner.getLocation()) > 10) {
|
}
|
||||||
pet.teleport(owner.getLocation());
|
}
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sanftes Folgen: Wenn das Pet weiter als 3 Blöcke weg ist
|
@EventHandler
|
||||||
if (pet.getLocation().distance(owner.getLocation()) > 3) {
|
public void onPetDamage(EntityDamageEvent event) {
|
||||||
Location target = owner.getLocation().clone().add(owner.getLocation().getDirection().multiply(-1.5));
|
if (activePets.containsValue(event.getEntity())) {
|
||||||
target.setY(owner.getLocation().getY());
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
// Teleportiert das Pet leicht zum Ziel (simuliert Laufen)
|
}
|
||||||
pet.teleport(pet.getLocation().add(target.toVector().subtract(pet.getLocation().toVector()).normalize().multiply(0.2)));
|
|
||||||
|
|
||||||
// Blickrichtung anpassen
|
@EventHandler
|
||||||
Location lookAt = pet.getLocation();
|
public void onPetTarget(EntityTargetEvent event) {
|
||||||
lookAt.setDirection(owner.getLocation().toVector().subtract(pet.getLocation().toVector()));
|
if (activePets.containsValue(event.getEntity())) {
|
||||||
pet.teleport(lookAt);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void removePet(Player player) {
|
}
|
||||||
if (activePets.containsKey(player.getUniqueId())) {
|
|
||||||
activePets.get(player.getUniqueId()).remove();
|
|
||||||
activePets.remove(player.getUniqueId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void clearAll() {
|
@EventHandler
|
||||||
for (Entity pet : activePets.values()) {
|
public void onQuit(PlayerQuitEvent event) {
|
||||||
pet.remove();
|
removePet(event.getPlayer());
|
||||||
}
|
}
|
||||||
activePets.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String capitalize(String str) {
|
|
||||||
if (str == null || str.isEmpty()) return str;
|
|
||||||
return str.substring(0, 1).toUpperCase() + str.substring(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- Events um die Pets zu schützen ---
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onPetDamage(EntityDamageEvent event) {
|
|
||||||
if (activePets.containsValue(event.getEntity())) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onPetTarget(EntityTargetEvent event) {
|
|
||||||
if (activePets.containsValue(event.getEntity())) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onQuit(PlayerQuitEvent event) {
|
|
||||||
removePet(event.getPlayer());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
package de.nexuslobby.modules.gadgets;
|
package de.nexuslobby.modules.gadgets;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
@@ -7,26 +10,32 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class ShieldTask {
|
public class ShieldTask {
|
||||||
|
private static final Map<UUID, Long> pushCooldowns = new HashMap();
|
||||||
|
private static final long PUSH_COOLDOWN_MS = 3000L;
|
||||||
|
|
||||||
public static void handleShield(Player owner) {
|
public static void handleShield(Player owner) {
|
||||||
// Erzeuge einen Partikel-Ring um den Spieler
|
for(double i = (double)0.0F; i < (Math.PI * 2D); i += (Math.PI / 8D)) {
|
||||||
for (double i = 0; i < Math.PI * 2; i += Math.PI / 8) {
|
double x = Math.cos(i) * 2.2;
|
||||||
double x = Math.cos(i) * 2.2;
|
double z = Math.sin(i) * 2.2;
|
||||||
double z = Math.sin(i) * 2.2;
|
owner.getWorld().spawnParticle(Particle.WITCH, owner.getLocation().add(x, (double)0.5F, z), 1, (double)0.0F, (double)0.0F, (double)0.0F, (double)0.0F);
|
||||||
owner.getWorld().spawnParticle(Particle.WITCH, owner.getLocation().add(x, 0.5, z), 1, 0, 0, 0, 0);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Stoße andere Spieler weg
|
long now = System.currentTimeMillis();
|
||||||
for (Entity entity : owner.getNearbyEntities(2.2, 2.0, 2.2)) {
|
|
||||||
if (entity instanceof Player && entity != owner) {
|
|
||||||
Player target = (Player) entity;
|
|
||||||
|
|
||||||
Vector direction = target.getLocation().toVector().subtract(owner.getLocation().toVector()).normalize();
|
for(Entity entity : owner.getNearbyEntities(2.2, (double)2.0F, 2.2)) {
|
||||||
direction.multiply(0.4).setY(0.2);
|
if (entity instanceof Player target) {
|
||||||
|
if (entity != owner && !GadgetShield.isProtected(target)) {
|
||||||
target.setVelocity(direction);
|
long lastPush = (Long)pushCooldowns.getOrDefault(target.getUniqueId(), 0L);
|
||||||
target.playSound(target.getLocation(), Sound.ENTITY_CHICKEN_EGG, 0.5f, 0.5f);
|
if (now - lastPush >= 3000L) {
|
||||||
|
pushCooldowns.put(target.getUniqueId(), now);
|
||||||
|
Vector direction = target.getLocation().toVector().subtract(owner.getLocation().toVector()).normalize();
|
||||||
|
direction.multiply(0.4).setY(0.2);
|
||||||
|
target.setVelocity(direction);
|
||||||
|
target.playSound(target.getLocation(), Sound.ENTITY_CHICKEN_EGG, 0.5F, 0.5F);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ public class HoloCommand implements CommandExecutor {
|
|||||||
if (!(sender instanceof Player player)) return true;
|
if (!(sender instanceof Player player)) return true;
|
||||||
|
|
||||||
if (!player.hasPermission("nexuslobby.hologram")) {
|
if (!player.hasPermission("nexuslobby.hologram")) {
|
||||||
player.sendMessage("§8[§6Nexus§8] §cKeine Rechte.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cKeine Rechte.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ public class HoloCommand implements CommandExecutor {
|
|||||||
|
|
||||||
// Aufruf der neuen Methode mit List<String>
|
// Aufruf der neuen Methode mit List<String>
|
||||||
module.createHologram(id, player.getLocation(), pages);
|
module.createHologram(id, player.getLocation(), pages);
|
||||||
player.sendMessage("§8[§6Nexus§8] §aHologramm §e" + id + " §aerstellt (" + pages.size() + " Seiten).");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aHologramm §e" + id + " §aerstellt (" + pages.size() + " Seiten).");
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("delete")) {
|
else if (args[0].equalsIgnoreCase("delete")) {
|
||||||
if (args.length < 2) {
|
if (args.length < 2) {
|
||||||
@@ -67,7 +67,11 @@ public class HoloCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
module.removeHologram(args[1]);
|
module.removeHologram(args[1]);
|
||||||
player.sendMessage("§8[§6Nexus§8] §cHologramm §e" + args[1] + " §agelöscht.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cHologramm §e" + args[1] + " §agelöscht.");
|
||||||
|
}
|
||||||
|
else if (args[0].equalsIgnoreCase("reload")) {
|
||||||
|
module.reloadHolograms();
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aHologramme neu geladen.");
|
||||||
} else {
|
} else {
|
||||||
sendHelp(player);
|
sendHelp(player);
|
||||||
}
|
}
|
||||||
@@ -79,6 +83,7 @@ public class HoloCommand implements CommandExecutor {
|
|||||||
player.sendMessage("§8§m-----------§r §6Hologramme §8§m-----------");
|
player.sendMessage("§8§m-----------§r §6Hologramme §8§m-----------");
|
||||||
player.sendMessage("§e/holo create <id> <NONE|FAST|SLOW> <text>");
|
player.sendMessage("§e/holo create <id> <NONE|FAST|SLOW> <text>");
|
||||||
player.sendMessage("§e/holo delete <id>");
|
player.sendMessage("§e/holo delete <id>");
|
||||||
|
player.sendMessage("§e/holo reload");
|
||||||
player.sendMessage("§7Nutze §b; §7für neue Seiten.");
|
player.sendMessage("§7Nutze §b; §7für neue Seiten.");
|
||||||
player.sendMessage("§7Nutze §b\\n §7für Zeilenumbruch.");
|
player.sendMessage("§7Nutze §b\\n §7für Zeilenumbruch.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,15 +153,57 @@ public class HologramModule implements Module, Listener {
|
|||||||
saveHoloConfig();
|
saveHoloConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lädt die holograms.yml neu und rendert alle Hologramme für Online-Spieler neu.
|
||||||
|
* Wird von HoloCommand (/holo reload) aufgerufen.
|
||||||
|
*/
|
||||||
|
public void reloadHolograms() {
|
||||||
|
// Alle aktiven Hologramme für alle Spieler entfernen
|
||||||
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
|
holograms.values().forEach(h -> h.removeForPlayer(player));
|
||||||
|
}
|
||||||
|
// Config neu einlesen und Hologramme neu laden
|
||||||
|
loadConfig();
|
||||||
|
loadHolograms();
|
||||||
|
}
|
||||||
|
|
||||||
private void saveHoloConfig() {
|
private void saveHoloConfig() {
|
||||||
try {
|
try {
|
||||||
config.save(file);
|
// Sicherstellen, dass Placeholder-Strings (z.B. %bungeetotal%) korrekt
|
||||||
|
// gequotet gespeichert werden, damit SnakeYAML sie nicht als YAML-Direktive
|
||||||
|
// missinterpretiert. Dazu speichern wir die text-Listen explizit als
|
||||||
|
// String-Werte mit einfachen Anführungszeichen via eigener Serialisierung.
|
||||||
|
StringBuilder yaml = new StringBuilder();
|
||||||
|
for (String id : config.getKeys(false)) {
|
||||||
|
yaml.append(id).append(":\n");
|
||||||
|
yaml.append(" world: ").append(quoteIfNeeded(config.getString(id + ".world", ""))).append("\n");
|
||||||
|
yaml.append(" x: ").append(config.getDouble(id + ".x")).append("\n");
|
||||||
|
yaml.append(" y: ").append(config.getDouble(id + ".y")).append("\n");
|
||||||
|
yaml.append(" z: ").append(config.getDouble(id + ".z")).append("\n");
|
||||||
|
yaml.append(" text:\n");
|
||||||
|
for (String line : config.getStringList(id + ".text")) {
|
||||||
|
yaml.append(" - ").append(quoteIfNeeded(line)).append("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
java.nio.file.Files.writeString(file.toPath(), yaml.toString());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
NexusLobby.getInstance().getLogger().severe("Konnte holograms.yml nicht speichern!");
|
NexusLobby.getInstance().getLogger().severe("Konnte holograms.yml nicht speichern!");
|
||||||
NexusLobby.getInstance().getLogger().severe("Fehler beim Speichern der Hologramme: " + e.getMessage());
|
NexusLobby.getInstance().getLogger().severe("Fehler beim Speichern der Hologramme: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Umschließt Strings mit einfachen Anführungszeichen, wenn sie YAML-Sonderzeichen
|
||||||
|
* wie '%', ':', '#' enthalten, um Parsing-Fehler zu vermeiden.
|
||||||
|
*/
|
||||||
|
private String quoteIfNeeded(String value) {
|
||||||
|
if (value == null) return "''";
|
||||||
|
if (value.contains("%") || value.contains(":") || value.contains("#") || value.contains("'")) {
|
||||||
|
return "'" + value.replace("'", "''") + "'";
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WICHTIG: Diese Methode wird vom LobbyTabCompleter benötigt!
|
* WICHTIG: Diese Methode wird vom LobbyTabCompleter benötigt!
|
||||||
* @return Set aller registrierten Hologramm-IDs
|
* @return Set aller registrierten Hologramm-IDs
|
||||||
@@ -172,6 +214,7 @@ public class HologramModule implements Module, Listener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
|
org.bukkit.event.HandlerList.unregisterAll(this);
|
||||||
holograms.values().forEach(NexusHologram::removeAll);
|
holograms.values().forEach(NexusHologram::removeAll);
|
||||||
holograms.clear();
|
holograms.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package de.nexuslobby.modules.intro;
|
|||||||
|
|
||||||
import de.nexuslobby.NexusLobby;
|
import de.nexuslobby.NexusLobby;
|
||||||
import de.nexuslobby.api.Module;
|
import de.nexuslobby.api.Module;
|
||||||
import net.md_5.bungee.api.ChatMessageType;
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@@ -16,7 +14,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@@ -27,13 +24,24 @@ import java.util.*;
|
|||||||
public class IntroModule implements Module, Listener, CommandExecutor {
|
public class IntroModule implements Module, Listener, CommandExecutor {
|
||||||
|
|
||||||
private final Set<UUID> activeIntro = new HashSet<>();
|
private final Set<UUID> activeIntro = new HashSet<>();
|
||||||
|
|
||||||
private final List<Location> points = new ArrayList<>();
|
private final List<Location> points = new ArrayList<>();
|
||||||
|
private final List<String> labels = new ArrayList<>();
|
||||||
|
|
||||||
|
// Abschluss-Titel (konfigurierbar)
|
||||||
|
private String endTitle = "§a§lWillkommen!";
|
||||||
|
private String endSubtitle = "§7Viel Spaß auf NexusLobby";
|
||||||
|
|
||||||
private File configFile;
|
private File configFile;
|
||||||
private FileConfiguration config;
|
private FileConfiguration config;
|
||||||
|
|
||||||
// --- Einstellungen ---
|
// --- Einstellungen ---
|
||||||
private final int TICKS_FLUG = 70; // Dauer der Fahrt zwischen zwei Punkten (3.5 Sek)
|
private final int TICKS_FLUG = 70;
|
||||||
private final int TICKS_PAUSE = 30; // Standzeit an jedem Punkt (1.5 Sek)
|
private final int TICKS_PAUSE = 30;
|
||||||
|
|
||||||
|
private final int TITLE_FADE_IN = 10;
|
||||||
|
private final int TITLE_STAY = 50;
|
||||||
|
private final int TITLE_FADE_OUT = 10;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() { return "Intro"; }
|
public String getName() { return "Intro"; }
|
||||||
@@ -44,31 +52,77 @@ public class IntroModule implements Module, Listener, CommandExecutor {
|
|||||||
if (NexusLobby.getInstance().getCommand("intro") != null) {
|
if (NexusLobby.getInstance().getCommand("intro") != null) {
|
||||||
NexusLobby.getInstance().getCommand("intro").setExecutor(this);
|
NexusLobby.getInstance().getCommand("intro").setExecutor(this);
|
||||||
}
|
}
|
||||||
loadPoints();
|
loadConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
|
org.bukkit.event.HandlerList.unregisterAll(this);
|
||||||
activeIntro.clear();
|
activeIntro.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadPoints() {
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
// Persistenz
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
private void loadConfig() {
|
||||||
points.clear();
|
points.clear();
|
||||||
|
labels.clear();
|
||||||
configFile = new File(NexusLobby.getInstance().getDataFolder(), "intro.yml");
|
configFile = new File(NexusLobby.getInstance().getDataFolder(), "intro.yml");
|
||||||
if (!configFile.exists()) {
|
if (!configFile.exists()) {
|
||||||
try { configFile.createNewFile(); } catch (IOException ignored) {}
|
try { configFile.createNewFile(); } catch (IOException ignored) {}
|
||||||
}
|
}
|
||||||
config = YamlConfiguration.loadConfiguration(configFile);
|
config = YamlConfiguration.loadConfiguration(configFile);
|
||||||
List<?> list = config.getList("points");
|
|
||||||
|
// Abschluss-Titel laden
|
||||||
|
endTitle = config.getString("end-title", "§a§lWillkommen!");
|
||||||
|
endSubtitle = config.getString("end-subtitle", "§7Viel Spaß auf NexusLobby");
|
||||||
|
|
||||||
|
// Punkte laden
|
||||||
|
List<?> list = config.getList("intro-points");
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
for (Object obj : list) {
|
for (Object obj : list) {
|
||||||
if (obj instanceof Location loc) points.add(loc);
|
if (obj instanceof Map<?, ?> map) {
|
||||||
|
Object locObj = map.get("location");
|
||||||
|
Object labelObj = map.get("label");
|
||||||
|
if (locObj instanceof Location loc) {
|
||||||
|
points.add(loc);
|
||||||
|
labels.add(labelObj != null ? labelObj.toString() : "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rückwärts-Kompatibilität
|
||||||
|
if (points.isEmpty()) {
|
||||||
|
List<?> oldList = config.getList("points");
|
||||||
|
if (oldList != null) {
|
||||||
|
for (Object obj : oldList) {
|
||||||
|
if (obj instanceof Location loc) {
|
||||||
|
points.add(loc);
|
||||||
|
labels.add("");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void savePoints() {
|
private void saveConfig() {
|
||||||
config.set("points", points);
|
// Abschluss-Titel speichern
|
||||||
|
config.set("end-title", endTitle);
|
||||||
|
config.set("end-subtitle", endSubtitle);
|
||||||
|
|
||||||
|
// Punkte speichern
|
||||||
|
List<Map<String, Object>> data = new ArrayList<>();
|
||||||
|
for (int i = 0; i < points.size(); i++) {
|
||||||
|
Map<String, Object> entry = new LinkedHashMap<>();
|
||||||
|
entry.put("location", points.get(i));
|
||||||
|
entry.put("label", labels.get(i));
|
||||||
|
data.add(entry);
|
||||||
|
}
|
||||||
|
config.set("intro-points", data);
|
||||||
|
config.set("points", null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
config.save(configFile);
|
config.save(configFile);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -76,6 +130,10 @@ public class IntroModule implements Module, Listener, CommandExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
// Events
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onJoin(PlayerJoinEvent event) {
|
public void onJoin(PlayerJoinEvent event) {
|
||||||
if (!event.getPlayer().hasPlayedBefore() && points.size() >= 2) {
|
if (!event.getPlayer().hasPlayedBefore() && points.size() >= 2) {
|
||||||
@@ -83,12 +141,9 @@ public class IntroModule implements Module, Listener, CommandExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
public void onSneak(PlayerToggleSneakEvent event) {
|
// Befehle
|
||||||
if (activeIntro.contains(event.getPlayer().getUniqueId()) && event.isSneaking()) {
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
stopIntro(event.getPlayer(), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
||||||
@@ -96,45 +151,122 @@ public class IntroModule implements Module, Listener, CommandExecutor {
|
|||||||
if (!p.hasPermission("nexuslobby.admin")) return true;
|
if (!p.hasPermission("nexuslobby.admin")) return true;
|
||||||
|
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
p.sendMessage("§8§m------------------------------------");
|
sendHelp(p);
|
||||||
p.sendMessage("§6§lNexus Intro System (Cinematic)");
|
|
||||||
p.sendMessage("§e/intro add §7- Punkt hinzufügen");
|
|
||||||
p.sendMessage("§e/intro clear §7- Alle Punkte löschen");
|
|
||||||
p.sendMessage("§e/intro start §7- Teste die Fahrt");
|
|
||||||
p.sendMessage("§8§m------------------------------------");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (args[0].toLowerCase()) {
|
switch (args[0].toLowerCase()) {
|
||||||
|
|
||||||
case "add" -> {
|
case "add" -> {
|
||||||
|
String pointLabel = args.length > 1
|
||||||
|
? String.join(" ", Arrays.copyOfRange(args, 1, args.length))
|
||||||
|
: "";
|
||||||
points.add(p.getLocation());
|
points.add(p.getLocation());
|
||||||
savePoints();
|
labels.add(pointLabel);
|
||||||
p.sendMessage("§8[§6Nexus§8] §aPunkt #" + points.size() + " wurde gesetzt!");
|
saveConfig();
|
||||||
|
if (pointLabel.isEmpty()) {
|
||||||
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aPunkt §e#" + points.size() + " §awurde gesetzt.");
|
||||||
|
} else {
|
||||||
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aPunkt §e#" + points.size() + " §amit Text §e\"" + pointLabel + "\" §agesetzt.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case "clear" -> {
|
case "clear" -> {
|
||||||
points.clear();
|
points.clear();
|
||||||
savePoints();
|
labels.clear();
|
||||||
p.sendMessage("§8[§6Nexus§8] §cAlle Intro-Punkte wurden gelöscht.");
|
saveConfig();
|
||||||
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cAlle Intro-Punkte wurden gelöscht.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "list" -> {
|
||||||
|
if (points.isEmpty()) {
|
||||||
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cKeine Punkte vorhanden.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
p.sendMessage("§8§m------------------------------------");
|
||||||
|
p.sendMessage("§6§lIntro-Punkte (" + points.size() + ")");
|
||||||
|
for (int i = 0; i < points.size(); i++) {
|
||||||
|
Location loc = points.get(i);
|
||||||
|
String lbl = labels.get(i).isEmpty() ? "§7(kein Text)" : "§e" + labels.get(i);
|
||||||
|
p.sendMessage("§8#" + (i + 1) + " §7"
|
||||||
|
+ String.format("%.1f", loc.getX()) + ", "
|
||||||
|
+ String.format("%.1f", loc.getY()) + ", "
|
||||||
|
+ String.format("%.1f", loc.getZ())
|
||||||
|
+ " " + lbl);
|
||||||
|
}
|
||||||
|
p.sendMessage("§8§m------------------------------------");
|
||||||
|
}
|
||||||
|
|
||||||
case "start" -> {
|
case "start" -> {
|
||||||
if (points.size() < 2) {
|
if (points.size() < 2) {
|
||||||
p.sendMessage("§8[§6Nexus§8] §cDu brauchst mindestens 2 Punkte für eine Fahrt.");
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cDu brauchst mindestens 2 Punkte für eine Fahrt.");
|
||||||
} else {
|
} else {
|
||||||
startIntro(p);
|
startIntro(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /intro setendtitle <Text> — setzt den großen Abschluss-Titel
|
||||||
|
case "setendtitle" -> {
|
||||||
|
if (args.length < 2) {
|
||||||
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cBenutzung: §e/intro setendtitle <Text>");
|
||||||
|
p.sendMessage("§7Farbcodes mit §e& §7möglich. Beispiel: §e/intro setendtitle &a&lWillkommen!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
endTitle = colorize(String.join(" ", Arrays.copyOfRange(args, 1, args.length)));
|
||||||
|
saveConfig();
|
||||||
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aAbschluss-Titel gesetzt: " + endTitle);
|
||||||
|
// Vorschau
|
||||||
|
p.sendTitle(endTitle, endSubtitle, TITLE_FADE_IN, TITLE_STAY, TITLE_FADE_OUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /intro setendsubtitle <Text> — setzt den kleinen Abschluss-Untertitel
|
||||||
|
case "setendsubtitle" -> {
|
||||||
|
if (args.length < 2) {
|
||||||
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cBenutzung: §e/intro setendsubtitle <Text>");
|
||||||
|
p.sendMessage("§7Farbcodes mit §e& §7möglich. Beispiel: §e/intro setendsubtitle &7Viel Spaß!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
endSubtitle = colorize(String.join(" ", Arrays.copyOfRange(args, 1, args.length)));
|
||||||
|
saveConfig();
|
||||||
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aAbschluss-Untertitel gesetzt: " + endSubtitle);
|
||||||
|
// Vorschau
|
||||||
|
p.sendTitle(endTitle, endSubtitle, TITLE_FADE_IN, TITLE_STAY, TITLE_FADE_OUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
default -> sendHelp(p);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendHelp(Player p) {
|
||||||
|
p.sendMessage("§8§m------------------------------------");
|
||||||
|
p.sendMessage("§6§lNexus Intro System (Cinematic)");
|
||||||
|
p.sendMessage("§e/intro add [Text] §7- Punkt + optionaler Titel");
|
||||||
|
p.sendMessage("§e/intro clear §7- Alle Punkte löschen");
|
||||||
|
p.sendMessage("§e/intro list §7- Alle Punkte anzeigen");
|
||||||
|
p.sendMessage("§e/intro start §7- Fahrt testen");
|
||||||
|
p.sendMessage("§e/intro setendtitle <Text> §7- Abschluss-Titel setzen");
|
||||||
|
p.sendMessage("§e/intro setendsubtitle <Text> §7- Abschluss-Untertitel setzen");
|
||||||
|
p.sendMessage("§7Aktuell: §r" + endTitle + " §8/ §r" + endSubtitle);
|
||||||
|
p.sendMessage("§8§m------------------------------------");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
// Intro-Logik
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
public void startIntro(Player player) {
|
public void startIntro(Player player) {
|
||||||
activeIntro.add(player.getUniqueId());
|
activeIntro.add(player.getUniqueId());
|
||||||
player.setGameMode(GameMode.SPECTATOR);
|
player.setGameMode(GameMode.SPECTATOR);
|
||||||
|
|
||||||
|
// Titel für den ersten Punkt sofort anzeigen
|
||||||
|
showTitleForSegment(player, 0);
|
||||||
|
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
int currentSegment = 0;
|
int currentSegment = 0;
|
||||||
int tickInSegment = 0;
|
int tickInSegment = 0;
|
||||||
boolean isPausing = true;
|
boolean isPausing = true;
|
||||||
|
int lastTitleSegment = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -145,79 +277,89 @@ public class IntroModule implements Module, Listener, CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (currentSegment >= points.size() - 1) {
|
if (currentSegment >= points.size() - 1) {
|
||||||
stopIntro(player, false);
|
stopIntro(player);
|
||||||
this.cancel();
|
this.cancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Location start = points.get(currentSegment);
|
Location start = points.get(currentSegment);
|
||||||
Location end = points.get(currentSegment + 1);
|
Location end = points.get(currentSegment + 1);
|
||||||
|
|
||||||
if (isPausing) {
|
if (isPausing) {
|
||||||
// Kamera steht am aktuellen Punkt
|
|
||||||
player.teleport(start);
|
player.teleport(start);
|
||||||
tickInSegment++;
|
tickInSegment++;
|
||||||
if (tickInSegment >= TICKS_PAUSE) {
|
if (tickInSegment >= TICKS_PAUSE) {
|
||||||
isPausing = false;
|
isPausing = false;
|
||||||
tickInSegment = 0;
|
tickInSegment = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Kamera fliegt zum nächsten Punkt
|
|
||||||
double progress = (double) tickInSegment / (double) TICKS_FLUG;
|
double progress = (double) tickInSegment / (double) TICKS_FLUG;
|
||||||
|
double smoothT = progress * progress * (3 - 2 * progress);
|
||||||
|
|
||||||
// "Smooth Step" für flüssigeres Beschleunigen/Bremsen
|
player.teleport(interpolate(start, end, smoothT));
|
||||||
double smoothT = progress * progress * (3 - 2 * progress);
|
|
||||||
|
|
||||||
Location nextLoc = interpolate(start, end, smoothT);
|
|
||||||
player.teleport(nextLoc);
|
|
||||||
|
|
||||||
tickInSegment++;
|
tickInSegment++;
|
||||||
if (tickInSegment >= TICKS_FLUG) {
|
if (tickInSegment >= TICKS_FLUG) {
|
||||||
isPausing = true;
|
isPausing = true;
|
||||||
tickInSegment = 0;
|
tickInSegment = 0;
|
||||||
currentSegment++;
|
currentSegment++;
|
||||||
|
|
||||||
|
if (currentSegment < points.size() && currentSegment != lastTitleSegment) {
|
||||||
|
showTitleForSegment(player, currentSegment);
|
||||||
|
lastTitleSegment = currentSegment;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
player.spigot().sendMessage(ChatMessageType.ACTION_BAR,
|
|
||||||
new TextComponent("§6§lINTRO-TOUR §8| §ePunkt " + (currentSegment + 1) + " §8| §7Sneak zum Abbrechen"));
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.cancel();
|
this.cancel();
|
||||||
stopIntro(player, true);
|
stopIntro(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.runTaskTimer(NexusLobby.getInstance(), 0L, 1L);
|
}.runTaskTimer(NexusLobby.getInstance(), 0L, 1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showTitleForSegment(Player player, int segmentIndex) {
|
||||||
|
if (segmentIndex < 0 || segmentIndex >= labels.size()) return;
|
||||||
|
String lbl = labels.get(segmentIndex);
|
||||||
|
if (lbl == null || lbl.isEmpty()) return;
|
||||||
|
|
||||||
|
player.sendTitle(
|
||||||
|
"§6§l" + lbl,
|
||||||
|
"§7✦ NexusLobby ✦",
|
||||||
|
TITLE_FADE_IN,
|
||||||
|
TITLE_STAY,
|
||||||
|
TITLE_FADE_OUT
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
private Location interpolate(Location start, Location end, double t) {
|
private Location interpolate(Location start, Location end, double t) {
|
||||||
double x = start.getX() + (end.getX() - start.getX()) * t;
|
double x = start.getX() + (end.getX() - start.getX()) * t;
|
||||||
double y = start.getY() + (end.getY() - start.getY()) * t;
|
double y = start.getY() + (end.getY() - start.getY()) * t;
|
||||||
double z = start.getZ() + (end.getZ() - start.getZ()) * t;
|
double z = start.getZ() + (end.getZ() - start.getZ()) * t;
|
||||||
|
|
||||||
// Sanfte Drehung
|
|
||||||
float startYaw = start.getYaw();
|
float startYaw = start.getYaw();
|
||||||
float endYaw = end.getYaw();
|
float endYaw = end.getYaw();
|
||||||
// Verhindert ruckartige 360-Grad Dreher
|
float diff = (endYaw - startYaw) % 360;
|
||||||
float diff = (endYaw - startYaw) % 360;
|
if (diff > 180) diff -= 360;
|
||||||
if (diff > 180) diff -= 360;
|
|
||||||
if (diff < -180) diff += 360;
|
if (diff < -180) diff += 360;
|
||||||
float yaw = startYaw + diff * (float)t;
|
float yaw = startYaw + diff * (float) t;
|
||||||
|
|
||||||
float pitch = (float) (start.getPitch() + (end.getPitch() - start.getPitch()) * t);
|
float pitch = (float) (start.getPitch() + (end.getPitch() - start.getPitch()) * t);
|
||||||
|
|
||||||
return new Location(start.getWorld(), x, y, z, yaw, pitch);
|
return new Location(start.getWorld(), x, y, z, yaw, pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopIntro(Player player, boolean canceled) {
|
private void stopIntro(Player player) {
|
||||||
activeIntro.remove(player.getUniqueId());
|
activeIntro.remove(player.getUniqueId());
|
||||||
player.setGameMode(GameMode.ADVENTURE);
|
player.setGameMode(GameMode.ADVENTURE);
|
||||||
player.teleport(player.getWorld().getSpawnLocation());
|
player.teleport(player.getWorld().getSpawnLocation());
|
||||||
|
|
||||||
if (canceled) {
|
// Abschluss-Titel — komplett konfigurierbar
|
||||||
player.sendMessage("§8[§6Nexus§8] §cIntro abgebrochen.");
|
player.sendTitle(endTitle, endSubtitle, 10, 60, 20);
|
||||||
} else {
|
}
|
||||||
player.sendMessage("§8[§6Nexus§8] §aWillkommen auf dem Netzwerk!");
|
|
||||||
}
|
/** Ersetzt &-Farbcodes durch §-Codes */
|
||||||
|
private String colorize(String input) {
|
||||||
|
return input.replace("&", "§");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,8 @@ import java.awt.image.BufferedImage;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
@@ -38,8 +40,18 @@ public class MapArtModule implements Module, CommandExecutor {
|
|||||||
private File storageFile;
|
private File storageFile;
|
||||||
private FileConfiguration storageConfig;
|
private FileConfiguration storageConfig;
|
||||||
|
|
||||||
// RAM-Schutz: Cache für bereits geladene Bild-Kacheln
|
// FIX: Unbegrenzter Cache führt bei vielen verschiedenen Bild-URLs zu einem
|
||||||
private final Map<String, BufferedImage> tileCache = new ConcurrentHashMap<>();
|
// OutOfMemoryError. Stattdessen nutzen wir einen LRU-Cache mit max. 50 Einträgen.
|
||||||
|
// Älteste Kacheln werden automatisch verdrängt.
|
||||||
|
private static final int MAX_CACHE_SIZE = 50;
|
||||||
|
private final Map<String, BufferedImage> tileCache = Collections.synchronizedMap(
|
||||||
|
new LinkedHashMap<String, BufferedImage>(MAX_CACHE_SIZE + 1, 0.75f, true) {
|
||||||
|
@Override
|
||||||
|
protected boolean removeEldestEntry(Map.Entry<String, BufferedImage> eldest) {
|
||||||
|
return size() > MAX_CACHE_SIZE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
// Hilfs-Set um parallele Downloads der gleichen URL zu verhindern
|
// Hilfs-Set um parallele Downloads der gleichen URL zu verhindern
|
||||||
private final Map<String, Boolean> loadingShield = new ConcurrentHashMap<>();
|
private final Map<String, Boolean> loadingShield = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
@@ -107,7 +119,7 @@ public class MapArtModule implements Module, CommandExecutor {
|
|||||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
||||||
if (!(sender instanceof Player player)) return true;
|
if (!(sender instanceof Player player)) return true;
|
||||||
if (!player.hasPermission("nexuslobby.mapart")) {
|
if (!player.hasPermission("nexuslobby.mapart")) {
|
||||||
player.sendMessage("§8[§6Nexus§8] §cKeine Rechte.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cKeine Rechte.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +134,7 @@ public class MapArtModule implements Module, CommandExecutor {
|
|||||||
try {
|
try {
|
||||||
radius = Integer.parseInt(args[1]);
|
radius = Integer.parseInt(args[1]);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
player.sendMessage("§8[§6Nexus§8] §cUngültiger Radius.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cUngültiger Radius.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,7 +149,7 @@ public class MapArtModule implements Module, CommandExecutor {
|
|||||||
|
|
||||||
RayTraceResult rayTrace = player.rayTraceBlocks(5);
|
RayTraceResult rayTrace = player.rayTraceBlocks(5);
|
||||||
if (rayTrace == null || rayTrace.getHitBlock() == null || rayTrace.getHitBlockFace() == null) {
|
if (rayTrace == null || rayTrace.getHitBlock() == null || rayTrace.getHitBlockFace() == null) {
|
||||||
player.sendMessage("§8[§6Nexus§8] §cBitte schaue eine Wand direkt an.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cBitte schaue eine Wand direkt an.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +157,7 @@ public class MapArtModule implements Module, CommandExecutor {
|
|||||||
BlockFace hitFace = rayTrace.getHitBlockFace();
|
BlockFace hitFace = rayTrace.getHitBlockFace();
|
||||||
|
|
||||||
if (hitFace == BlockFace.UP || hitFace == BlockFace.DOWN) {
|
if (hitFace == BlockFace.UP || hitFace == BlockFace.DOWN) {
|
||||||
player.sendMessage("§8[§6Nexus§8] §cAktuell nur an vertikalen Wänden möglich.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cAktuell nur an vertikalen Wänden möglich.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,11 +168,11 @@ public class MapArtModule implements Module, CommandExecutor {
|
|||||||
width = Integer.parseInt(parts[0]);
|
width = Integer.parseInt(parts[0]);
|
||||||
height = Integer.parseInt(parts[1]);
|
height = Integer.parseInt(parts[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
player.sendMessage("§8[§6Nexus§8] §cUngültiges Format (z.B. 6x4).");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cUngültiges Format (z.B. 6x4).");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendMessage("§8[§6Nexus§8] §7Bild wird verarbeitet...");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§7Bild wird verarbeitet...");
|
||||||
createRaster(player, targetBlock, hitFace, url, width, height);
|
createRaster(player, targetBlock, hitFace, url, width, height);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -192,7 +204,7 @@ public class MapArtModule implements Module, CommandExecutor {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
saveStorage();
|
saveStorage();
|
||||||
player.sendMessage("§8[§6Nexus§8] §aErfolgreich §e" + count.get() + " §aKartenelemente gelöscht.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aErfolgreich §e" + count.get() + " §aKartenelemente gelöscht.");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createRaster(Player player, Block startBlock, BlockFace face, String url, int gridW, int gridH) {
|
private void createRaster(Player player, Block startBlock, BlockFace face, String url, int gridW, int gridH) {
|
||||||
@@ -213,7 +225,7 @@ public class MapArtModule implements Module, CommandExecutor {
|
|||||||
spawnPersistentFrame(player, currentPos, face, url, x, y, gridW, gridH);
|
spawnPersistentFrame(player, currentPos, face, url, x, y, gridW, gridH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.sendMessage("§8[§6Nexus§8] §aBild-Raster wurde permanent platziert!");
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§aBild-Raster wurde permanent platziert!");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void spawnPersistentFrame(Player player, Block pos, BlockFace face, String url, int x, int y, int totalW, int totalH) {
|
private void spawnPersistentFrame(Player player, Block pos, BlockFace face, String url, int x, int y, int totalW, int totalH) {
|
||||||
|
|||||||
@@ -25,41 +25,36 @@ public class ParkourListener implements Listener {
|
|||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Startet den Parkour per Rechtsklick auf den ArmorStand
|
|
||||||
*/
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onInteract(PlayerInteractAtEntityEvent event) {
|
public void onInteract(PlayerInteractAtEntityEvent event) {
|
||||||
if (!(event.getRightClicked() instanceof ArmorStand as)) return;
|
if (!(event.getRightClicked() instanceof ArmorStand as)) return;
|
||||||
|
if (!as.getScoreboardTags().contains(NPC_TAG)) return;
|
||||||
|
|
||||||
// Prüfen, ob der ArmorStand den richtigen Tag hat
|
Player player = event.getPlayer();
|
||||||
if (as.getScoreboardTags().contains(NPC_TAG)) {
|
event.setCancelled(true);
|
||||||
Player player = event.getPlayer();
|
|
||||||
|
|
||||||
// Abbrechen, wenn der Spieler schon im Parkour ist
|
if (manager.isIngame(player)) return;
|
||||||
if (manager.isIngame(player)) return;
|
|
||||||
|
|
||||||
// Cooldown-Check (3 Sekunden)
|
// Cooldown-Check (3 Sekunden)
|
||||||
if (startCooldown.containsKey(player.getUniqueId())) {
|
if (startCooldown.containsKey(player.getUniqueId())) {
|
||||||
if (System.currentTimeMillis() - startCooldown.get(player.getUniqueId()) < 3000) {
|
if (System.currentTimeMillis() - startCooldown.get(player.getUniqueId()) < 3000) {
|
||||||
player.sendMessage("§cBitte warte einen Moment, bevor du erneut startest.");
|
player.sendMessage("§cBitte warte einen Moment, bevor du erneut startest.");
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parkour starten
|
|
||||||
manager.startParkour(player, as.getLocation());
|
|
||||||
player.sendMessage("§8[§6Parkour§8] §eViel Erfolg! Erreiche das Ziel so schnell wie möglich.");
|
|
||||||
player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1f, 1f);
|
|
||||||
|
|
||||||
// Event abbrechen, damit man keine Ausrüstung vom ArmorStand klaut
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
manager.startParkour(player, as.getLocation());
|
||||||
|
// Strecken-Nummer dem Spieler mitteilen
|
||||||
|
int track = manager.getActiveTrack(player);
|
||||||
|
if (track != -1) {
|
||||||
|
player.sendMessage("§8[§6Parkour§8] §eViel Erfolg auf §bStrecke " + track + "§e! Erreiche das Ziel so schnell wie möglich.");
|
||||||
|
}
|
||||||
|
player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1f, 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onMove(PlayerMoveEvent event) {
|
public void onMove(PlayerMoveEvent event) {
|
||||||
// Performance: Nur berechnen, wenn ein voller Block gewechselt wurde
|
// Performance: Nur bei Block-Wechsel berechnen
|
||||||
if (event.getFrom().getBlockX() == event.getTo().getBlockX() &&
|
if (event.getFrom().getBlockX() == event.getTo().getBlockX() &&
|
||||||
event.getFrom().getBlockY() == event.getTo().getBlockY() &&
|
event.getFrom().getBlockY() == event.getTo().getBlockY() &&
|
||||||
event.getFrom().getBlockZ() == event.getTo().getBlockZ()) return;
|
event.getFrom().getBlockZ() == event.getTo().getBlockZ()) return;
|
||||||
@@ -70,8 +65,9 @@ public class ParkourListener implements Listener {
|
|||||||
Location loc = player.getLocation();
|
Location loc = player.getLocation();
|
||||||
|
|
||||||
// --- 1. ABSTURZ-CHECK ---
|
// --- 1. ABSTURZ-CHECK ---
|
||||||
// Passe die Höhe '50' an deine Map an!
|
// Absturz-Y aus config lesen (Standard: 50), damit Maps unter Y=50 korrekt funktionieren
|
||||||
if (loc.getY() < 50) {
|
double fallY = NexusLobby.getInstance().getConfig().getDouble("parkour.fall_y", 50.0);
|
||||||
|
if (loc.getY() < fallY) {
|
||||||
Location lastCp = manager.getCheckpoint(player);
|
Location lastCp = manager.getCheckpoint(player);
|
||||||
if (lastCp != null) {
|
if (lastCp != null) {
|
||||||
player.teleport(lastCp);
|
player.teleport(lastCp);
|
||||||
@@ -81,27 +77,25 @@ public class ParkourListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- 2. CHECKPOINT-CHECK ---
|
// --- 2. CHECKPOINT-CHECK (Track-spezifisch) ---
|
||||||
List<Location> cps = manager.getOrderedCheckpoints();
|
List<Location> cps = manager.getOrderedCheckpoints(player);
|
||||||
for (int i = 0; i < cps.size(); i++) {
|
for (int i = 0; i < cps.size(); i++) {
|
||||||
if (isNearby(loc, cps.get(i))) {
|
if (isNearby(loc, cps.get(i))) {
|
||||||
manager.reachCheckpoint(player, i);
|
manager.reachCheckpoint(player, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- 3. ZIEL-CHECK ---
|
// --- 3. ZIEL-CHECK (Track-spezifisch) ---
|
||||||
Location finish = manager.getFinishLocation();
|
Location finish = manager.getFinishLocation(player);
|
||||||
if (finish != null && isNearby(loc, finish)) {
|
if (finish != null && isNearby(loc, finish)) {
|
||||||
manager.finishParkour(player);
|
manager.finishParkour(player);
|
||||||
// Nach dem Ziel setzen wir einen Cooldown
|
|
||||||
startCooldown.put(player.getUniqueId(), System.currentTimeMillis());
|
startCooldown.put(player.getUniqueId(), System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isNearby(Location playerLoc, Location targetLoc) {
|
private boolean isNearby(Location playerLoc, Location targetLoc) {
|
||||||
if (playerLoc.getWorld() == null || !playerLoc.getWorld().equals(targetLoc.getWorld())) return false;
|
if (playerLoc.getWorld() == null || !playerLoc.getWorld().equals(targetLoc.getWorld())) return false;
|
||||||
// 2.25 entspricht einem Radius von ca. 1.5 Blöcken
|
return playerLoc.distanceSquared(targetLoc) <= 2.25; // ~1.5 Blöcke Radius
|
||||||
return playerLoc.distanceSquared(targetLoc) <= 2.25;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
|||||||
@@ -17,23 +17,60 @@ import java.io.IOException;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ParkourManager – unterstützt zwei Strecken (Track 1 & 2).
|
||||||
|
*
|
||||||
|
* Config-Struktur (parkour.yml):
|
||||||
|
* tracks:
|
||||||
|
* 1:
|
||||||
|
* start: <Location>
|
||||||
|
* finish: <Location>
|
||||||
|
* checkpoints:
|
||||||
|
* 1: <Location>
|
||||||
|
* 2: <Location>
|
||||||
|
* ...
|
||||||
|
* 2:
|
||||||
|
* start: <Location>
|
||||||
|
* finish: <Location>
|
||||||
|
* checkpoints:
|
||||||
|
* 1: <Location>
|
||||||
|
* ...
|
||||||
|
* besttimes:
|
||||||
|
* <uuid>: <seconds>
|
||||||
|
* names:
|
||||||
|
* <uuid>: <playerName>
|
||||||
|
*
|
||||||
|
* Beim Start wird zufällig eine der beiden konfigurierten Strecken ausgewählt.
|
||||||
|
* Beide Strecken müssen die gleiche Anzahl an Checkpoints haben – andernfalls
|
||||||
|
* wird nur die vollständige gewählt.
|
||||||
|
*/
|
||||||
public class ParkourManager {
|
public class ParkourManager {
|
||||||
|
|
||||||
private final NexusLobby plugin;
|
private final NexusLobby plugin;
|
||||||
private final File file;
|
private final File file;
|
||||||
private FileConfiguration config;
|
private FileConfiguration config;
|
||||||
|
|
||||||
private final Map<UUID, Long> startTime = new HashMap<>();
|
// Aktive Läufe
|
||||||
private final Map<UUID, Location> lastCheckpointLoc = new HashMap<>();
|
private final Map<UUID, Long> startTime = new HashMap<>();
|
||||||
private final Map<UUID, Integer> nextCheckpointIndex = new HashMap<>();
|
private final Map<UUID, Location> lastCheckpointLoc = new HashMap<>();
|
||||||
|
private final Map<UUID, Integer> nextCheckpointIndex= new HashMap<>();
|
||||||
|
/** Welche Track-Nummer (1 oder 2) der Spieler gerade läuft */
|
||||||
|
private final Map<UUID, Integer> activeTrack = new HashMap<>();
|
||||||
|
|
||||||
|
private final Random random = new Random();
|
||||||
|
|
||||||
public ParkourManager(NexusLobby plugin) {
|
public ParkourManager(NexusLobby plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.file = new File(plugin.getDataFolder(), "parkour.yml");
|
this.file = new File(plugin.getDataFolder(), "parkour.yml");
|
||||||
loadConfig();
|
loadConfig();
|
||||||
|
migrateLegacyBestTimes();
|
||||||
startParticleTask();
|
startParticleTask();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
// Config I/O
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
private void loadConfig() {
|
private void loadConfig() {
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
file.getParentFile().mkdirs();
|
file.getParentFile().mkdirs();
|
||||||
@@ -46,41 +83,158 @@ public class ParkourManager {
|
|||||||
config = YamlConfiguration.loadConfiguration(file);
|
config = YamlConfiguration.loadConfiguration(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCheckpoint(Player player, Location loc) {
|
/**
|
||||||
int nextId = 1;
|
* Migriert Bestzeiten vom alten Format (besttimes.<uuid>) ins neue Format
|
||||||
if (config.contains("locations.checkpoints") && config.getConfigurationSection("locations.checkpoints") != null) {
|
* (besttimes.<track>.<uuid>). Alte Zeiten werden Track 1 zugeordnet, da vor
|
||||||
nextId = config.getConfigurationSection("locations.checkpoints").getKeys(false).size() + 1;
|
* dieser Änderung nur ein Track existierte.
|
||||||
|
* Läuft einmalig beim Start; tut nichts wenn keine alten Daten vorhanden sind.
|
||||||
|
*/
|
||||||
|
private void migrateLegacyBestTimes() {
|
||||||
|
if (!config.contains("besttimes")) return;
|
||||||
|
|
||||||
|
// Prüfen ob es direkte UUID-Keys unter besttimes gibt (altes Format)
|
||||||
|
// Im neuen Format wären hier nur "1" und "2" als Keys
|
||||||
|
var section = config.getConfigurationSection("besttimes");
|
||||||
|
if (section == null) return;
|
||||||
|
|
||||||
|
int migrated = 0;
|
||||||
|
for (String key : new java.util.HashSet<>(section.getKeys(false))) {
|
||||||
|
// Neue Keys sind "1" oder "2" – alte Keys sind UUID-Strings (36 Zeichen, enthalten "-")
|
||||||
|
if (!key.equals("1") && !key.equals("2") && key.contains("-")) {
|
||||||
|
double time = config.getDouble("besttimes." + key);
|
||||||
|
// Nur migrieren wenn unter besttimes.1.<uuid> noch kein besserer Wert steht
|
||||||
|
String newPath = "besttimes.1." + key;
|
||||||
|
double existingTime = config.getDouble(newPath, 99999.9);
|
||||||
|
if (time < existingTime) {
|
||||||
|
config.set(newPath, time);
|
||||||
|
}
|
||||||
|
// Alten Key entfernen
|
||||||
|
config.set("besttimes." + key, null);
|
||||||
|
migrated++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addCheckpointLocation(String.valueOf(nextId), loc);
|
if (migrated > 0) {
|
||||||
player.sendMessage("§8[§6Parkour§8] §7Checkpoint §e#" + nextId + " §7an deiner Position gesetzt.");
|
save();
|
||||||
|
plugin.getLogger().info("[Parkour] Migration: " + migrated
|
||||||
|
+ " Bestzeit(en) von altem Format nach Strecke 1 übertragen.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void save() {
|
||||||
|
try {
|
||||||
|
config.save(file);
|
||||||
|
} catch (IOException e) {
|
||||||
|
plugin.getLogger().severe("Fehler beim Speichern der Parkour-Config: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
// Setup-Befehle (Admin)
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
public void setStartLocation(Player player, int track) {
|
||||||
|
config.set("tracks." + track + ".start", player.getLocation());
|
||||||
|
save();
|
||||||
|
player.sendMessage("§8[§6Parkour§8] §7Start von §eStrecke " + track + " §7an deiner Position gesetzt.");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFinishLocation(Player player, int track) {
|
||||||
|
config.set("tracks." + track + ".finish", player.getLocation());
|
||||||
|
save();
|
||||||
|
player.sendMessage("§8[§6Parkour§8] §7Ziel von §eStrecke " + track + " §7an deiner Position gesetzt.");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCheckpoint(Player player, int track) {
|
||||||
|
String cpBase = "tracks." + track + ".checkpoints";
|
||||||
|
int nextId = 1;
|
||||||
|
if (config.contains(cpBase) && config.getConfigurationSection(cpBase) != null) {
|
||||||
|
nextId = config.getConfigurationSection(cpBase).getKeys(false).size() + 1;
|
||||||
|
}
|
||||||
|
config.set(cpBase + "." + nextId, player.getLocation());
|
||||||
|
save();
|
||||||
|
player.sendMessage("§8[§6Parkour§8] §7Checkpoint §e#" + nextId + " §7(Strecke " + track + ") §7gesetzt.");
|
||||||
player.playSound(player.getLocation(), Sound.BLOCK_AMETHYST_BLOCK_CHIME, 1.0f, 1.5f);
|
player.playSound(player.getLocation(), Sound.BLOCK_AMETHYST_BLOCK_CHIME, 1.0f, 1.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Löscht die gesamte Strecke (Checkpoints und Ziel) und bricht aktuelle Läufe ab.
|
* Löscht alle Punkte beider Strecken und bricht laufende Runs ab.
|
||||||
*/
|
*/
|
||||||
public void removeAllPoints() {
|
public void removeAllPoints() {
|
||||||
config.set("locations.checkpoints", null);
|
config.set("tracks", null);
|
||||||
config.set("locations.finish", null);
|
|
||||||
save();
|
save();
|
||||||
|
|
||||||
// Alle Spieler aus dem Parkour werfen, damit keine Partikel zu gelöschten Zielen führen
|
|
||||||
for (UUID uuid : new HashSet<>(startTime.keySet())) {
|
for (UUID uuid : new HashSet<>(startTime.keySet())) {
|
||||||
Player p = Bukkit.getPlayer(uuid);
|
Player p = Bukkit.getPlayer(uuid);
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
stopParkour(p);
|
stopParkour(p);
|
||||||
p.sendMessage("§8[§6Parkour§8] §cDie aktuelle Strecke wurde soeben gelöscht.");
|
p.sendMessage("§8[§6Parkour§8] §cDie Strecken wurden soeben gelöscht.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startParkour(Player player, Location startLoc) {
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
// Getter (Track-spezifisch)
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
public Location getStartLocation(int track) {
|
||||||
|
return config.getLocation("tracks." + track + ".start");
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location getFinishLocation(int track) {
|
||||||
|
return config.getLocation("tracks." + track + ".finish");
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Location> getOrderedCheckpoints(int track) {
|
||||||
|
String cpBase = "tracks." + track + ".checkpoints";
|
||||||
|
if (!config.contains(cpBase) || config.getConfigurationSection(cpBase) == null)
|
||||||
|
return new ArrayList<>();
|
||||||
|
|
||||||
|
return config.getConfigurationSection(cpBase).getKeys(false).stream()
|
||||||
|
.sorted(Comparator.comparingInt(Integer::parseInt))
|
||||||
|
.map(key -> config.getLocation(cpBase + "." + key))
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gibt die aktive Track-Nummer des Spielers zurück (1 oder 2), oder -1 wenn nicht aktiv.
|
||||||
|
*/
|
||||||
|
public int getActiveTrack(Player player) {
|
||||||
|
return activeTrack.getOrDefault(player.getUniqueId(), -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convenience-Wrapper für ParkourListener (nutzt den aktiven Track des Spielers)
|
||||||
|
public List<Location> getOrderedCheckpoints(Player player) {
|
||||||
|
return getOrderedCheckpoints(getActiveTrack(player));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location getFinishLocation(Player player) {
|
||||||
|
return getFinishLocation(getActiveTrack(player));
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
// Parkour-Ablauf
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Startet den Parkour für den Spieler.
|
||||||
|
* Es wird zufällig eine der beiden Strecken gewählt, sofern beide vollständig
|
||||||
|
* konfiguriert sind (Start + Finish + mindestens gleiche Checkpoint-Anzahl).
|
||||||
|
* Falls nur eine Strecke konfiguriert ist, wird diese gewählt.
|
||||||
|
*/
|
||||||
|
public void startParkour(Player player, Location npcLocation) {
|
||||||
if (startTime.containsKey(player.getUniqueId())) return;
|
if (startTime.containsKey(player.getUniqueId())) return;
|
||||||
|
|
||||||
|
int chosenTrack = pickRandomTrack();
|
||||||
|
if (chosenTrack == -1) {
|
||||||
|
player.sendMessage("§8[§6Parkour§8] §cKeine Strecke konfiguriert. Bitte einen Admin kontaktieren.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
startTime.put(player.getUniqueId(), System.currentTimeMillis());
|
startTime.put(player.getUniqueId(), System.currentTimeMillis());
|
||||||
lastCheckpointLoc.put(player.getUniqueId(), startLoc);
|
lastCheckpointLoc.put(player.getUniqueId(), npcLocation);
|
||||||
nextCheckpointIndex.put(player.getUniqueId(), 0);
|
nextCheckpointIndex.put(player.getUniqueId(), 0);
|
||||||
|
activeTrack.put(player.getUniqueId(), chosenTrack);
|
||||||
|
|
||||||
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_CHIME, 1.0f, 1.2f);
|
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_CHIME, 1.0f, 1.2f);
|
||||||
|
|
||||||
@@ -94,11 +248,44 @@ public class ParkourManager {
|
|||||||
long diff = System.currentTimeMillis() - startTime.get(player.getUniqueId());
|
long diff = System.currentTimeMillis() - startTime.get(player.getUniqueId());
|
||||||
double sec = diff / 1000.0;
|
double sec = diff / 1000.0;
|
||||||
player.spigot().sendMessage(ChatMessageType.ACTION_BAR,
|
player.spigot().sendMessage(ChatMessageType.ACTION_BAR,
|
||||||
new TextComponent("§6⏱ Zeit: §e" + String.format("%.2f", sec) + "s §8| §bNächster Punkt: §7Partikel folgen"));
|
new TextComponent("§6⏱ Zeit: §e" + String.format("%.2f", sec) + "s §8| §bNächster Punkt: §7Partikel folgen"));
|
||||||
}
|
}
|
||||||
}.runTaskTimer(plugin, 0L, 1L);
|
}.runTaskTimer(plugin, 0L, 1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wählt zufällig einen validen Track (1 oder 2).
|
||||||
|
* Bevorzugt Tracks mit gleichem Checkpoint-Count; fällt auf jeden konfigurierten zurück.
|
||||||
|
* Gibt -1 zurück, wenn kein Track konfiguriert ist.
|
||||||
|
*/
|
||||||
|
private int pickRandomTrack() {
|
||||||
|
boolean t1 = isTrackReady(1);
|
||||||
|
boolean t2 = isTrackReady(2);
|
||||||
|
|
||||||
|
if (t1 && t2) {
|
||||||
|
// Beide vollständig – prüfen ob gleiche Länge
|
||||||
|
int len1 = getOrderedCheckpoints(1).size();
|
||||||
|
int len2 = getOrderedCheckpoints(2).size();
|
||||||
|
if (len1 != len2) {
|
||||||
|
// Warnung ins Log, aber trotzdem zufällig wählen
|
||||||
|
plugin.getLogger().warning("[Parkour] Strecke 1 hat " + len1 + " Checkpoints, Strecke 2 hat " + len2 + ". Bitte angleichen!");
|
||||||
|
}
|
||||||
|
return random.nextBoolean() ? 1 : 2;
|
||||||
|
} else if (t1) {
|
||||||
|
return 1;
|
||||||
|
} else if (t2) {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Gibt zurück, ob Start, Finish und mindestens 1 Checkpoint für den Track gesetzt sind. */
|
||||||
|
public boolean isTrackReady(int track) {
|
||||||
|
return getStartLocation(track) != null
|
||||||
|
&& getFinishLocation(track) != null
|
||||||
|
&& !getOrderedCheckpoints(track).isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
private void startParticleTask() {
|
private void startParticleTask() {
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -107,8 +294,9 @@ public class ParkourManager {
|
|||||||
Player p = Bukkit.getPlayer(uuid);
|
Player p = Bukkit.getPlayer(uuid);
|
||||||
if (p == null) continue;
|
if (p == null) continue;
|
||||||
|
|
||||||
|
int track = activeTrack.getOrDefault(uuid, 1);
|
||||||
int nextIdx = nextCheckpointIndex.getOrDefault(uuid, 0);
|
int nextIdx = nextCheckpointIndex.getOrDefault(uuid, 0);
|
||||||
List<Location> cps = getOrderedCheckpoints();
|
List<Location> cps = getOrderedCheckpoints(track);
|
||||||
|
|
||||||
if (nextIdx < cps.size()) {
|
if (nextIdx < cps.size()) {
|
||||||
Location nextCp = cps.get(nextIdx);
|
Location nextCp = cps.get(nextIdx);
|
||||||
@@ -116,7 +304,7 @@ public class ParkourManager {
|
|||||||
p.spawnParticle(Particle.SOUL_FIRE_FLAME, nextCp.clone().add(0, 0.5, 0), 5, 0.1, 0.3, 0.1, 0.02);
|
p.spawnParticle(Particle.SOUL_FIRE_FLAME, nextCp.clone().add(0, 0.5, 0), 5, 0.1, 0.3, 0.1, 0.02);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Location finish = getFinishLocation();
|
Location finish = getFinishLocation(track);
|
||||||
if (finish != null && p.getWorld().equals(finish.getWorld())) {
|
if (finish != null && p.getWorld().equals(finish.getWorld())) {
|
||||||
p.spawnParticle(Particle.HAPPY_VILLAGER, finish.clone().add(0, 0.5, 0), 8, 0.2, 0.5, 0.2, 0.02);
|
p.spawnParticle(Particle.HAPPY_VILLAGER, finish.clone().add(0, 0.5, 0), 8, 0.2, 0.5, 0.2, 0.02);
|
||||||
}
|
}
|
||||||
@@ -128,23 +316,24 @@ public class ParkourManager {
|
|||||||
|
|
||||||
public void reachCheckpoint(Player player, int reachedIndex) {
|
public void reachCheckpoint(Player player, int reachedIndex) {
|
||||||
int currentNext = nextCheckpointIndex.getOrDefault(player.getUniqueId(), 0);
|
int currentNext = nextCheckpointIndex.getOrDefault(player.getUniqueId(), 0);
|
||||||
|
if (reachedIndex != currentNext) return;
|
||||||
|
|
||||||
if (reachedIndex == currentNext) {
|
int track = activeTrack.getOrDefault(player.getUniqueId(), 1);
|
||||||
List<Location> cps = getOrderedCheckpoints();
|
List<Location> cps = getOrderedCheckpoints(track);
|
||||||
if (reachedIndex < cps.size()) {
|
if (reachedIndex >= cps.size()) return;
|
||||||
lastCheckpointLoc.put(player.getUniqueId(), cps.get(reachedIndex));
|
|
||||||
nextCheckpointIndex.put(player.getUniqueId(), reachedIndex + 1);
|
|
||||||
|
|
||||||
player.sendMessage("§8[§6Parkour§8] §bCheckpoint #" + (reachedIndex + 1) + " erreicht!");
|
lastCheckpointLoc.put(player.getUniqueId(), cps.get(reachedIndex));
|
||||||
player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 0.8f, 1.5f);
|
nextCheckpointIndex.put(player.getUniqueId(), reachedIndex + 1);
|
||||||
}
|
|
||||||
}
|
player.sendMessage("§8[§6Parkour§8] §bCheckpoint #" + (reachedIndex + 1) + " erreicht!");
|
||||||
|
player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 0.8f, 1.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finishParkour(Player player) {
|
public void finishParkour(Player player) {
|
||||||
if (!startTime.containsKey(player.getUniqueId())) return;
|
if (!startTime.containsKey(player.getUniqueId())) return;
|
||||||
|
|
||||||
if (nextCheckpointIndex.getOrDefault(player.getUniqueId(), 0) < getOrderedCheckpoints().size()) {
|
int track = activeTrack.getOrDefault(player.getUniqueId(), 1);
|
||||||
|
if (nextCheckpointIndex.getOrDefault(player.getUniqueId(), 0) < getOrderedCheckpoints(track).size()) {
|
||||||
player.sendMessage("§cDu hast Checkpoints übersprungen! Folge den Partikeln.");
|
player.sendMessage("§cDu hast Checkpoints übersprungen! Folge den Partikeln.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -153,7 +342,7 @@ public class ParkourManager {
|
|||||||
double seconds = duration / 1000.0;
|
double seconds = duration / 1000.0;
|
||||||
|
|
||||||
player.sendMessage("§8§m--------------------------------------");
|
player.sendMessage("§8§m--------------------------------------");
|
||||||
player.sendMessage("§8[§6Parkour§8] §a§lZiel erreicht!");
|
player.sendMessage("§8[§6Parkour§8] §a§lZiel erreicht! §8(Strecke " + track + ")");
|
||||||
player.sendMessage("§7Deine Zeit: §e" + String.format("%.2f", seconds) + "s");
|
player.sendMessage("§7Deine Zeit: §e" + String.format("%.2f", seconds) + "s");
|
||||||
player.sendMessage("§8§m--------------------------------------");
|
player.sendMessage("§8§m--------------------------------------");
|
||||||
|
|
||||||
@@ -167,45 +356,16 @@ public class ParkourManager {
|
|||||||
startTime.remove(player.getUniqueId());
|
startTime.remove(player.getUniqueId());
|
||||||
lastCheckpointLoc.remove(player.getUniqueId());
|
lastCheckpointLoc.remove(player.getUniqueId());
|
||||||
nextCheckpointIndex.remove(player.getUniqueId());
|
nextCheckpointIndex.remove(player.getUniqueId());
|
||||||
|
activeTrack.remove(player.getUniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStartLocation(Location loc) { config.set("locations.start", loc); save(); }
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
public void setFinishLocation(Location loc) { config.set("locations.finish", loc); save(); }
|
// Bestzeiten
|
||||||
public void addCheckpointLocation(String id, Location loc) { config.set("locations.checkpoints." + id, loc); save(); }
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
public Location getStartLocation() { return config.getLocation("locations.start"); }
|
|
||||||
public Location getFinishLocation() { return config.getLocation("locations.finish"); }
|
|
||||||
|
|
||||||
public List<Location> getOrderedCheckpoints() {
|
|
||||||
if (!config.contains("locations.checkpoints") || config.getConfigurationSection("locations.checkpoints") == null)
|
|
||||||
return new ArrayList<>();
|
|
||||||
|
|
||||||
return config.getConfigurationSection("locations.checkpoints").getKeys(false).stream()
|
|
||||||
.sorted(Comparator.comparingInt(Integer::parseInt))
|
|
||||||
.map(key -> config.getLocation("locations.checkpoints." + key))
|
|
||||||
.filter(Objects::nonNull)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void save() {
|
|
||||||
try {
|
|
||||||
config.save(file);
|
|
||||||
} catch (IOException e) {
|
|
||||||
plugin.getLogger().severe("Fehler beim Speichern der Parkour-Config: " + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clearStats() {
|
|
||||||
config.set("besttimes", null);
|
|
||||||
config.set("names", null);
|
|
||||||
save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isIngame(Player player) { return startTime.containsKey(player.getUniqueId()); }
|
|
||||||
public Location getCheckpoint(Player player) { return lastCheckpointLoc.get(player.getUniqueId()); }
|
|
||||||
|
|
||||||
private void saveBestTime(Player player, double time) {
|
private void saveBestTime(Player player, double time) {
|
||||||
String path = "besttimes." + player.getUniqueId();
|
int track = activeTrack.getOrDefault(player.getUniqueId(), 1);
|
||||||
|
String path = "besttimes." + track + "." + player.getUniqueId();
|
||||||
double currentTime = config.getDouble(path, 99999.9);
|
double currentTime = config.getDouble(path, 99999.9);
|
||||||
if (time < currentTime) {
|
if (time < currentTime) {
|
||||||
config.set(path, time);
|
config.set(path, time);
|
||||||
@@ -215,27 +375,90 @@ public class ParkourManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Löscht NUR die Bestzeiten-Liste (besttimes + names).
|
||||||
|
* Die Strecken-Konfiguration (tracks) bleibt vollständig erhalten.
|
||||||
|
* Wird durch "/nexus parkour clear" aufgerufen.
|
||||||
|
*/
|
||||||
|
public void clearStats() {
|
||||||
|
config.set("besttimes", null);
|
||||||
|
config.set("names", null);
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearStats(int track) {
|
||||||
|
config.set("besttimes." + track, null);
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
|
||||||
public String getTopTen() {
|
public String getTopTen() {
|
||||||
if (!config.contains("besttimes") || config.getConfigurationSection("besttimes") == null)
|
// Fallback: kombiniert beide Tracks (Legacy-Support für %nexuslobby_parkour_top%)
|
||||||
return "§6§l🏆 TOP 10 PARKOUR 🏆\n§7Noch keine Rekorde.";
|
return getTopTen(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTopTen(int track) {
|
||||||
|
String trackLabel = track == 1 ? " §8(Strecke 1)" : track == 2 ? " §8(Strecke 2)" : "";
|
||||||
|
|
||||||
Map<String, Double> allTimes = new HashMap<>();
|
Map<String, Double> allTimes = new HashMap<>();
|
||||||
for (String uuidStr : config.getConfigurationSection("besttimes").getKeys(false)) {
|
|
||||||
allTimes.put(uuidStr, config.getDouble("besttimes." + uuidStr));
|
if (track == 0) {
|
||||||
|
// Alle Tracks kombiniert (nimmt die beste Zeit je Spieler über alle Tracks)
|
||||||
|
for (int t = 1; t <= 2; t++) {
|
||||||
|
String section = "besttimes." + t;
|
||||||
|
if (config.contains(section) && config.getConfigurationSection(section) != null) {
|
||||||
|
for (String uuidStr : config.getConfigurationSection(section).getKeys(false)) {
|
||||||
|
double time = config.getDouble(section + "." + uuidStr);
|
||||||
|
allTimes.merge(uuidStr, time, Math::min);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String section = "besttimes." + track;
|
||||||
|
if (!config.contains(section) || config.getConfigurationSection(section) == null) {
|
||||||
|
return "§6§l🏆 TOP 10 PARKOUR" + trackLabel + "\n§7Noch keine Rekorde.";
|
||||||
|
}
|
||||||
|
for (String uuidStr : config.getConfigurationSection(section).getKeys(false)) {
|
||||||
|
allTimes.put(uuidStr, config.getDouble(section + "." + uuidStr));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (allTimes.isEmpty())
|
||||||
|
return "§6§l🏆 TOP 10 PARKOUR" + trackLabel + "\n§7Noch keine Rekorde.";
|
||||||
|
|
||||||
List<Map.Entry<String, Double>> sortedList = allTimes.entrySet().stream()
|
List<Map.Entry<String, Double>> sortedList = allTimes.entrySet().stream()
|
||||||
.sorted(Map.Entry.comparingByValue())
|
.sorted(Map.Entry.comparingByValue())
|
||||||
.limit(10)
|
.limit(10)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder("§6§l🏆 TOP 10 PARKOUR 🏆");
|
StringBuilder builder = new StringBuilder("§6§l🏆 TOP 10 PARKOUR" + trackLabel);
|
||||||
int rank = 1;
|
int rank = 1;
|
||||||
for (Map.Entry<String, Double> entry : sortedList) {
|
for (Map.Entry<String, Double> entry : sortedList) {
|
||||||
String name = config.getString("names." + entry.getKey(), "Unbekannt");
|
String name = config.getString("names." + entry.getKey(), "Unbekannt");
|
||||||
builder.append("\n§e#").append(rank).append(" §f").append(name).append(" §8» §a").append(String.format("%.2f", entry.getValue())).append("s");
|
builder.append("\n§e#").append(rank).append(" §f").append(name)
|
||||||
|
.append(" §8» §a").append(String.format("%.2f", entry.getValue())).append("s");
|
||||||
rank++;
|
rank++;
|
||||||
}
|
}
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
// Hilfsmethoden
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
public boolean isIngame(Player player) { return startTime.containsKey(player.getUniqueId()); }
|
||||||
|
public Location getCheckpoint(Player player) { return lastCheckpointLoc.get(player.getUniqueId()); }
|
||||||
|
|
||||||
|
/** Gibt die Strecken-Info als lesbaren String aus (für Admin-Feedback). */
|
||||||
|
public String getTrackInfo() {
|
||||||
|
StringBuilder sb = new StringBuilder("§8[§6Parkour§8] §7Track-Status:\n");
|
||||||
|
for (int t = 1; t <= 2; t++) {
|
||||||
|
int cps = getOrderedCheckpoints(t).size();
|
||||||
|
boolean ready = isTrackReady(t);
|
||||||
|
sb.append(" §eStrecke ").append(t).append(": ")
|
||||||
|
.append(ready ? "§a✔" : "§c✘")
|
||||||
|
.append(" §7(").append(cps).append(" Checkpoints)");
|
||||||
|
if (t < 2) sb.append("\n");
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,9 @@ public class PlayerInspectModule implements Module, Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {}
|
public void onDisable() {
|
||||||
|
org.bukkit.event.HandlerList.unregisterAll(this);
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerInteract(PlayerInteractEntityEvent event) {
|
public void onPlayerInteract(PlayerInteractEntityEvent event) {
|
||||||
|
|||||||
@@ -5,12 +5,15 @@ import org.bukkit.command.Command;
|
|||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class PortalCommand implements CommandExecutor {
|
public class PortalCommand implements CommandExecutor, Listener {
|
||||||
|
|
||||||
private final PortalManager portalManager;
|
private final PortalManager portalManager;
|
||||||
|
|
||||||
@@ -20,6 +23,17 @@ public class PortalCommand implements CommandExecutor {
|
|||||||
|
|
||||||
public PortalCommand(PortalManager portalManager) {
|
public PortalCommand(PortalManager portalManager) {
|
||||||
this.portalManager = portalManager;
|
this.portalManager = portalManager;
|
||||||
|
// FIX: Listener registrieren, damit Selektionen beim Verlassen bereinigt werden
|
||||||
|
de.nexuslobby.NexusLobby.getInstance().getServer().getPluginManager()
|
||||||
|
.registerEvents(this, de.nexuslobby.NexusLobby.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
// FIX: Selektionen beim Quit entfernen – statische Maps wuchsen sonst ewig
|
||||||
|
@EventHandler
|
||||||
|
public void onQuit(PlayerQuitEvent event) {
|
||||||
|
UUID uuid = event.getPlayer().getUniqueId();
|
||||||
|
selection1.remove(uuid);
|
||||||
|
selection2.remove(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Statische Hilfsmethoden für andere Klassen
|
// Statische Hilfsmethoden für andere Klassen
|
||||||
|
|||||||
@@ -31,7 +31,12 @@ import java.util.UUID;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PortalManager - Verwaltet Portale, Markierungen und den globalen Grenzschutz.
|
* PortalManager - Verwaltet Portale und Wand-Markierungen.
|
||||||
|
*
|
||||||
|
* FIX: Die doppelte Border-Logik wurde entfernt. Der BorderModule ist
|
||||||
|
* der alleinige Verantwortliche für die Lobby-Grenze. Hätte der
|
||||||
|
* PortalManager die Border ebenfalls geprüft, wären Spieler doppelt
|
||||||
|
* teleportiert worden und hätten zwei Nachrichten erhalten.
|
||||||
*/
|
*/
|
||||||
public class PortalManager implements Module, Listener {
|
public class PortalManager implements Module, Listener {
|
||||||
|
|
||||||
@@ -42,12 +47,6 @@ public class PortalManager implements Module, Listener {
|
|||||||
private final NamespacedKey wandKey;
|
private final NamespacedKey wandKey;
|
||||||
private BukkitTask particleTask;
|
private BukkitTask particleTask;
|
||||||
|
|
||||||
// Boundary Cache
|
|
||||||
private Location borderMin;
|
|
||||||
private Location borderMax;
|
|
||||||
private boolean borderEnabled = false;
|
|
||||||
private String borderType;
|
|
||||||
|
|
||||||
public PortalManager(NexusLobby plugin) {
|
public PortalManager(NexusLobby plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.wandKey = new NamespacedKey(plugin, "nexuslobby_portal_wand");
|
this.wandKey = new NamespacedKey(plugin, "nexuslobby_portal_wand");
|
||||||
@@ -61,10 +60,8 @@ public class PortalManager implements Module, Listener {
|
|||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
loadPortals();
|
loadPortals();
|
||||||
loadBorderSettings();
|
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
startParticleTask();
|
startParticleTask();
|
||||||
plugin.getLogger().info("PortalManager vollständig geladen.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -77,28 +74,6 @@ public class PortalManager implements Module, Listener {
|
|||||||
plugin.getLogger().info("PortalManager deaktiviert.");
|
plugin.getLogger().info("PortalManager deaktiviert.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadBorderSettings() {
|
|
||||||
this.borderType = plugin.getConfig().getString("worldborder.type", "SQUARE");
|
|
||||||
boolean enabled = plugin.getConfig().getBoolean("worldborder.enabled", false);
|
|
||||||
if (!enabled || !"SQUARE".equalsIgnoreCase(borderType)) {
|
|
||||||
this.borderEnabled = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (plugin.getConfig().contains("worldborder.pos1") && plugin.getConfig().contains("worldborder.pos2")) {
|
|
||||||
Location p1 = plugin.getConfig().getLocation("worldborder.pos1");
|
|
||||||
Location p2 = plugin.getConfig().getLocation("worldborder.pos2");
|
|
||||||
if (p1 != null && p2 != null) {
|
|
||||||
this.borderMin = getMinLocation(p1, p2);
|
|
||||||
this.borderMax = getMaxLocation(p1, p2);
|
|
||||||
this.borderEnabled = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.borderEnabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<String> getPortalNames() {
|
public Set<String> getPortalNames() {
|
||||||
return portals.keySet();
|
return portals.keySet();
|
||||||
}
|
}
|
||||||
@@ -149,17 +124,17 @@ public class PortalManager implements Module, Listener {
|
|||||||
|
|
||||||
Location loc1 = selectionMap.get(uuid)[0];
|
Location loc1 = selectionMap.get(uuid)[0];
|
||||||
if (loc1 != null) {
|
if (loc1 != null) {
|
||||||
int width = Math.abs(loc1.getBlockX() - clickedLoc.getBlockX()) + 1;
|
int width = Math.abs(loc1.getBlockX() - clickedLoc.getBlockX()) + 1;
|
||||||
int height = Math.abs(loc1.getBlockY() - clickedLoc.getBlockY()) + 1;
|
int height = Math.abs(loc1.getBlockY() - clickedLoc.getBlockY()) + 1;
|
||||||
int length = Math.abs(loc1.getBlockZ() - clickedLoc.getBlockZ()) + 1;
|
int length = Math.abs(loc1.getBlockZ() - clickedLoc.getBlockZ()) + 1;
|
||||||
long volume = (long) width * height * length;
|
long volume = (long) width * height * length;
|
||||||
|
|
||||||
p.sendMessage("§7§m----------------------------------");
|
p.sendMessage("§7§m----------------------------------");
|
||||||
if (volume < 500) {
|
if (volume < 500) {
|
||||||
p.sendMessage("§e[Nexus] Kleiner Bereich erkannt (Portal-Größe)");
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§eKleiner Bereich erkannt (Portal-Größe)");
|
||||||
p.sendMessage("§fBefehl: §b/portal create <Name> <server|world>");
|
p.sendMessage("§fBefehl: §b/portal create <n> <server|world>");
|
||||||
} else {
|
} else {
|
||||||
p.sendMessage("§6[Nexus] Großer Bereich erkannt (WorldBorder-Größe)");
|
p.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§6Großer Bereich erkannt (WorldBorder-Größe)");
|
||||||
p.sendMessage("§fBefehl: §a/border square");
|
p.sendMessage("§fBefehl: §a/border square");
|
||||||
}
|
}
|
||||||
p.sendMessage("§7§m----------------------------------");
|
p.sendMessage("§7§m----------------------------------");
|
||||||
@@ -191,12 +166,9 @@ public class PortalManager implements Module, Listener {
|
|||||||
String type = portalConfig.getString("portals." + key + ".type", "WORLD");
|
String type = portalConfig.getString("portals." + key + ".type", "WORLD");
|
||||||
Portal portal = new Portal(key, type);
|
Portal portal = new Portal(key, type);
|
||||||
|
|
||||||
if (portalConfig.contains("portals." + key + ".pos1")) {
|
portal.setPos1(loadLocation(portalConfig, "portals." + key + ".pos1"));
|
||||||
portal.setPos1(portalConfig.getLocation("portals." + key + ".pos1"));
|
portal.setPos2(loadLocation(portalConfig, "portals." + key + ".pos2"));
|
||||||
}
|
portal.setReturnSpawn(loadLocation(portalConfig, "portals." + key + ".returnSpawn"));
|
||||||
if (portalConfig.contains("portals." + key + ".pos2")) {
|
|
||||||
portal.setPos2(portalConfig.getLocation("portals." + key + ".pos2"));
|
|
||||||
}
|
|
||||||
|
|
||||||
portal.setDestination(portalConfig.getString("portals." + key + ".destination", ""));
|
portal.setDestination(portalConfig.getString("portals." + key + ".destination", ""));
|
||||||
try {
|
try {
|
||||||
@@ -205,10 +177,6 @@ public class PortalManager implements Module, Listener {
|
|||||||
portal.setParticle(Particle.PORTAL);
|
portal.setParticle(Particle.PORTAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (portalConfig.contains("portals." + key + ".returnSpawn")) {
|
|
||||||
portal.setReturnSpawn(portalConfig.getLocation("portals." + key + ".returnSpawn"));
|
|
||||||
}
|
|
||||||
|
|
||||||
portals.put(key, portal);
|
portals.put(key, portal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -220,11 +188,11 @@ public class PortalManager implements Module, Listener {
|
|||||||
for (Portal portal : portals.values()) {
|
for (Portal portal : portals.values()) {
|
||||||
String path = "portals." + portal.getName() + ".";
|
String path = "portals." + portal.getName() + ".";
|
||||||
config.set(path + "type", portal.getType());
|
config.set(path + "type", portal.getType());
|
||||||
config.set(path + "pos1", portal.getPos1());
|
saveLocation(config, path + "pos1", portal.getPos1());
|
||||||
config.set(path + "pos2", portal.getPos2());
|
saveLocation(config, path + "pos2", portal.getPos2());
|
||||||
config.set(path + "destination", portal.getDestination());
|
config.set(path + "destination", portal.getDestination());
|
||||||
config.set(path + "particle", portal.getParticle() != null ? portal.getParticle().name() : "PORTAL");
|
config.set(path + "particle", portal.getParticle() != null ? portal.getParticle().name() : "PORTAL");
|
||||||
config.set(path + "returnSpawn", portal.getReturnSpawn());
|
saveLocation(config, path + "returnSpawn", portal.getReturnSpawn());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -234,6 +202,35 @@ public class PortalManager implements Module, Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIX: Hilfsmethoden für robustes Location-Speichern/Laden.
|
||||||
|
// Speichert world + x/y/z als einzelne Keys statt als serialisiertes
|
||||||
|
// Location-Objekt, was nach Neustarts zu null führen kann.
|
||||||
|
private void saveLocation(YamlConfiguration config, String path, Location loc) {
|
||||||
|
if (loc == null || loc.getWorld() == null) return;
|
||||||
|
config.set(path + ".world", loc.getWorld().getName());
|
||||||
|
config.set(path + ".x", loc.getX());
|
||||||
|
config.set(path + ".y", loc.getY());
|
||||||
|
config.set(path + ".z", loc.getZ());
|
||||||
|
config.set(path + ".yaw", (double) loc.getYaw());
|
||||||
|
config.set(path + ".pitch", (double) loc.getPitch());
|
||||||
|
}
|
||||||
|
|
||||||
|
private Location loadLocation(YamlConfiguration config, String path) {
|
||||||
|
if (!config.contains(path + ".world")) return null;
|
||||||
|
String worldName = config.getString(path + ".world");
|
||||||
|
World world = Bukkit.getWorld(worldName);
|
||||||
|
if (world == null) {
|
||||||
|
plugin.getLogger().warning("Welt '" + worldName + "' nicht gefunden für Pfad: " + path);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new Location(world,
|
||||||
|
config.getDouble(path + ".x"),
|
||||||
|
config.getDouble(path + ".y"),
|
||||||
|
config.getDouble(path + ".z"),
|
||||||
|
(float) config.getDouble(path + ".yaw"),
|
||||||
|
(float) config.getDouble(path + ".pitch"));
|
||||||
|
}
|
||||||
|
|
||||||
// --- CRUD ---
|
// --- CRUD ---
|
||||||
public boolean createPortal(String name, String type, Player creator) {
|
public boolean createPortal(String name, String type, Player creator) {
|
||||||
Location[] sel = selectionMap.getOrDefault(creator.getUniqueId(), new Location[2]);
|
Location[] sel = selectionMap.getOrDefault(creator.getUniqueId(), new Location[2]);
|
||||||
@@ -296,7 +293,7 @@ public class PortalManager implements Module, Listener {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Movement / Teleport / Boundary Logic ---
|
// --- Movement / Teleport Logic ---
|
||||||
@org.bukkit.event.EventHandler
|
@org.bukkit.event.EventHandler
|
||||||
public void onPlayerMove(PlayerMoveEvent event) {
|
public void onPlayerMove(PlayerMoveEvent event) {
|
||||||
if (event.getFrom().getX() == event.getTo().getX() &&
|
if (event.getFrom().getX() == event.getTo().getX() &&
|
||||||
@@ -308,20 +305,7 @@ public class PortalManager implements Module, Listener {
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
Location loc = event.getTo();
|
Location loc = event.getTo();
|
||||||
|
|
||||||
// 1. Grenzschutz (Boundary Protection)
|
// Portal-Logik
|
||||||
if (borderEnabled && !player.hasPermission("nexuslobby.border.bypass")) {
|
|
||||||
if (!isWithinBorder(loc)) {
|
|
||||||
Location spawn = getMainSpawnLocation();
|
|
||||||
if (spawn != null) {
|
|
||||||
player.teleport(spawn);
|
|
||||||
player.playSound(player.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT, 1.0f, 0.5f);
|
|
||||||
player.sendMessage("§c§lHEY! §7Du hast den erlaubten Bereich verlassen.");
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Portal Logik
|
|
||||||
for (Portal portal : portals.values()) {
|
for (Portal portal : portals.values()) {
|
||||||
if (portal.getPos1() == null || portal.getPos2() == null) continue;
|
if (portal.getPos1() == null || portal.getPos2() == null) continue;
|
||||||
if (!isInArea(loc, portal.getPos1(), portal.getPos2())) continue;
|
if (!isInArea(loc, portal.getPos1(), portal.getPos2())) continue;
|
||||||
@@ -337,14 +321,6 @@ public class PortalManager implements Module, Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isWithinBorder(Location loc) {
|
|
||||||
if (borderMin == null || borderMax == null) return true;
|
|
||||||
if (!loc.getWorld().equals(borderMin.getWorld())) return true;
|
|
||||||
return loc.getX() >= borderMin.getX() && loc.getX() <= borderMax.getX() &&
|
|
||||||
loc.getY() >= borderMin.getY() && loc.getY() <= borderMax.getY() &&
|
|
||||||
loc.getZ() >= borderMin.getZ() && loc.getZ() <= borderMax.getZ();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void executeTeleport(Player player, Portal portal) {
|
private void executeTeleport(Player player, Portal portal) {
|
||||||
if ("SERVER".equalsIgnoreCase(portal.getType())) {
|
if ("SERVER".equalsIgnoreCase(portal.getType())) {
|
||||||
String serverName = portal.getDestination();
|
String serverName = portal.getDestination();
|
||||||
@@ -353,17 +329,17 @@ public class PortalManager implements Module, Listener {
|
|||||||
Location loc = portal.getReturnSpawn();
|
Location loc = portal.getReturnSpawn();
|
||||||
if (loc == null) {
|
if (loc == null) {
|
||||||
Location pos2 = portal.getPos2();
|
Location pos2 = portal.getPos2();
|
||||||
loc = player.getLocation();
|
loc = player.getLocation().clone();
|
||||||
if (pos2 != null) {
|
if (pos2 != null) {
|
||||||
double dx = loc.getX() - pos2.getX();
|
double dx = loc.getX() - pos2.getX();
|
||||||
double dz = loc.getZ() - pos2.getZ();
|
double dz = loc.getZ() - pos2.getZ();
|
||||||
double length = Math.sqrt(dx*dx + dz*dz);
|
double length = Math.sqrt(dx * dx + dz * dz);
|
||||||
if (length == 0) length = 1;
|
if (length == 0) length = 1;
|
||||||
dx = (dx / length) * 2;
|
dx = (dx / length) * 2;
|
||||||
dz = (dz / length) * 2;
|
dz = (dz / length) * 2;
|
||||||
loc.add(dx, 0, dz);
|
loc.add(dx, 0, dz);
|
||||||
} else {
|
} else {
|
||||||
loc.add(0,0,2);
|
loc.add(0, 0, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.teleport(loc);
|
player.teleport(loc);
|
||||||
@@ -394,7 +370,7 @@ public class PortalManager implements Module, Listener {
|
|||||||
double x = Double.parseDouble(parts[1]);
|
double x = Double.parseDouble(parts[1]);
|
||||||
double y = Double.parseDouble(parts[2]);
|
double y = Double.parseDouble(parts[2]);
|
||||||
double z = Double.parseDouble(parts[3]);
|
double z = Double.parseDouble(parts[3]);
|
||||||
float yaw = parts.length >= 6 ? Float.parseFloat(parts[4]) : 0f;
|
float yaw = parts.length >= 5 ? Float.parseFloat(parts[4]) : 0f;
|
||||||
float pitch = parts.length >= 6 ? Float.parseFloat(parts[5]) : 0f;
|
float pitch = parts.length >= 6 ? Float.parseFloat(parts[5]) : 0f;
|
||||||
player.teleport(new Location(world, x, y, z, yaw, pitch));
|
player.teleport(new Location(world, x, y, z, yaw, pitch));
|
||||||
player.sendMessage("§aDu wurdest teleportiert!");
|
player.sendMessage("§aDu wurdest teleportiert!");
|
||||||
@@ -462,6 +438,7 @@ public class PortalManager implements Module, Listener {
|
|||||||
Location min = getMinLocation(portal.getPos1(), portal.getPos2());
|
Location min = getMinLocation(portal.getPos1(), portal.getPos2());
|
||||||
Location max = getMaxLocation(portal.getPos1(), portal.getPos2());
|
Location max = getMaxLocation(portal.getPos1(), portal.getPos2());
|
||||||
World world = portal.getPos1().getWorld();
|
World world = portal.getPos1().getWorld();
|
||||||
|
if (world == null) return;
|
||||||
for (int i = 0; i < 15; i++) {
|
for (int i = 0; i < 15; i++) {
|
||||||
double x = min.getX() + Math.random() * (max.getX() - min.getX() + 1);
|
double x = min.getX() + Math.random() * (max.getX() - min.getX() + 1);
|
||||||
double y = min.getY() + Math.random() * (max.getY() - min.getY() + 1);
|
double y = min.getY() + Math.random() * (max.getY() - min.getY() + 1);
|
||||||
|
|||||||
@@ -115,5 +115,7 @@ public class SecurityModule implements Module, Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {}
|
public void onDisable() {
|
||||||
|
org.bukkit.event.HandlerList.unregisterAll(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -146,20 +146,50 @@ public class ServerSwitcherListener implements Listener, CommandExecutor {
|
|||||||
int clickedSlot = e.getSlot();
|
int clickedSlot = e.getSlot();
|
||||||
ConfigurationSection serversSection = NexusLobby.getInstance().getConfig().getConfigurationSection("compass.servers");
|
ConfigurationSection serversSection = NexusLobby.getInstance().getConfig().getConfigurationSection("compass.servers");
|
||||||
|
|
||||||
if (serversSection != null) {
|
if (serversSection == null) return;
|
||||||
for (String serverId : serversSection.getKeys(false)) {
|
|
||||||
String path = "compass.servers." + serverId;
|
|
||||||
int configSlot = NexusLobby.getInstance().getConfig().getInt(path + ".slot", -1);
|
|
||||||
|
|
||||||
if (configSlot == clickedSlot) {
|
for (String serverId : serversSection.getKeys(false)) {
|
||||||
String command = NexusLobby.getInstance().getConfig().getString(path + ".command");
|
String path = "compass.servers." + serverId;
|
||||||
if (command != null && !command.isEmpty()) {
|
int configSlot = NexusLobby.getInstance().getConfig().getInt(path + ".slot", -1);
|
||||||
p.closeInventory();
|
|
||||||
p.chat("/" + command);
|
if (configSlot != clickedSlot) continue;
|
||||||
return;
|
|
||||||
}
|
String command = NexusLobby.getInstance().getConfig().getString(path + ".command", "").trim();
|
||||||
}
|
if (command.isEmpty()) return;
|
||||||
|
|
||||||
|
p.closeInventory();
|
||||||
|
|
||||||
|
// "server <name>" → BungeeCord Connect Plugin-Message
|
||||||
|
if (command.toLowerCase().startsWith("server ")) {
|
||||||
|
String serverName = command.substring(7).trim();
|
||||||
|
connectBungee(p, serverName);
|
||||||
|
} else {
|
||||||
|
// Alle anderen Befehle als Konsolen-Befehl ausführen
|
||||||
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(),
|
||||||
|
command.replace("%player%", p.getName()));
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sendet den Spieler per BungeeCord Plugin-Message an einen anderen Server.
|
||||||
|
*/
|
||||||
|
private void connectBungee(Player player, String serverName) {
|
||||||
|
if (!Bukkit.getMessenger().isOutgoingChannelRegistered(
|
||||||
|
NexusLobby.getInstance(), "BungeeCord")) {
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cKein BungeeCord-Kanal registriert.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
java.io.ByteArrayOutputStream b = new java.io.ByteArrayOutputStream();
|
||||||
|
java.io.DataOutputStream out = new java.io.DataOutputStream(b);
|
||||||
|
out.writeUTF("Connect");
|
||||||
|
out.writeUTF(serverName);
|
||||||
|
player.sendPluginMessage(NexusLobby.getInstance(), "BungeeCord", b.toByteArray());
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§7Verbinde mit §e" + serverName + "§7...");
|
||||||
|
} catch (java.io.IOException ex) {
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.getPrefix() + "§cFehler beim Verbinden: " + ex.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -231,5 +231,8 @@ public class LobbySettingsModule implements Module, Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() { saveSettings(); }
|
public void onDisable() {
|
||||||
|
org.bukkit.event.HandlerList.unregisterAll(this);
|
||||||
|
saveSettings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -47,6 +47,7 @@ public class GlobalChatSuppressor implements Module, PluginMessageListener, List
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
|
org.bukkit.event.HandlerList.unregisterAll(this);
|
||||||
plugin.getServer().getMessenger().unregisterIncomingPluginChannel(plugin, CHANNEL_CONTROL);
|
plugin.getServer().getMessenger().unregisterIncomingPluginChannel(plugin, CHANNEL_CONTROL);
|
||||||
plugin.getServer().getMessenger().unregisterIncomingPluginChannel(plugin, CHANNEL_CHAT);
|
plugin.getServer().getMessenger().unregisterIncomingPluginChannel(plugin, CHANNEL_CHAT);
|
||||||
plugin.getServer().getMessenger().unregisterOutgoingPluginChannel(plugin, CHANNEL_CONTROL);
|
plugin.getServer().getMessenger().unregisterOutgoingPluginChannel(plugin, CHANNEL_CONTROL);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public class ConfigValidator {
|
|||||||
* Validiert alle Config-Werte und gibt Warnings aus
|
* Validiert alle Config-Werte und gibt Warnings aus
|
||||||
*/
|
*/
|
||||||
public void validate() {
|
public void validate() {
|
||||||
|
ensureDefault("prefix", "&8[&6Nexus&8] ");
|
||||||
validateSpawn();
|
validateSpawn();
|
||||||
validateLobbySettings();
|
validateLobbySettings();
|
||||||
validateTablist();
|
validateTablist();
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class DoubleJump implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onMove(PlayerMoveEvent event) {
|
public void onMove(PlayerMoveEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if (player.getGameMode() != GameMode.CREATIVE && player.getLocation().subtract(0, 0.1, 0).getBlock().getType() != Material.AIR) {
|
if (player.getGameMode() != GameMode.CREATIVE && player.getGameMode() != GameMode.SPECTATOR && player.getLocation().subtract(0, 0.1, 0).getBlock().getType() != Material.AIR) {
|
||||||
if (NexusLobby.getInstance().getConfig().getBoolean("doublejump.enabled", true)) {
|
if (NexusLobby.getInstance().getConfig().getBoolean("doublejump.enabled", true)) {
|
||||||
player.setAllowFlight(true);
|
player.setAllowFlight(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package de.nexuslobby.utils;
|
package de.nexuslobby.utils;
|
||||||
|
|
||||||
|
import de.nexuslobby.NexusLobby;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
|
|
||||||
@@ -27,6 +29,15 @@ public class LangManager {
|
|||||||
if (langMap == null) return key;
|
if (langMap == null) return key;
|
||||||
Map<String, String> translations = langMap.get(key);
|
Map<String, String> translations = langMap.get(key);
|
||||||
if (translations == null) return key;
|
if (translations == null) return key;
|
||||||
return translations.getOrDefault(currentLang, key);
|
return translations.getOrDefault(currentLang, key)
|
||||||
|
.replace("§8[§6Nexus§8] ", getPrefix());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getPrefix() {
|
||||||
|
NexusLobby plugin = NexusLobby.getInstance();
|
||||||
|
String prefix = plugin == null
|
||||||
|
? "&8[&6Nexus&8] "
|
||||||
|
: plugin.getConfig().getString("prefix", "&8[&6Nexus&8] ");
|
||||||
|
return ChatColor.translateAlternateColorCodes('&', prefix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
@@ -84,4 +85,9 @@ public class PlayerHider implements Listener {
|
|||||||
private String colorize(String s) {
|
private String colorize(String s) {
|
||||||
return s == null ? "" : s.replace("&", "§");
|
return s == null ? "" : s.replace("&", "§");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onQuit(PlayerQuitEvent event) {
|
||||||
|
hidden.remove(event.getPlayer().getUniqueId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,18 @@
|
|||||||
package de.nexuslobby.utils;
|
package de.nexuslobby.utils;
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
|
||||||
import com.google.gson.JsonParser;
|
|
||||||
import com.google.gson.JsonSyntaxException;
|
|
||||||
import de.nexuslobby.NexusLobby;
|
import de.nexuslobby.NexusLobby;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStream;
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.util.Scanner;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class UpdateChecker {
|
public class UpdateChecker {
|
||||||
|
|
||||||
private final NexusLobby plugin;
|
private final NexusLobby plugin;
|
||||||
private static final String API_URL = "https://git.viper.ipv64.net/api/v1/repos/M_Viper/NexusLobby/releases/latest";
|
private static final int RESOURCE_ID = 132388;
|
||||||
private static final int TIMEOUT_MS = 5000;
|
|
||||||
|
|
||||||
public UpdateChecker(NexusLobby plugin) {
|
public UpdateChecker(NexusLobby plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
@@ -26,60 +20,17 @@ public class UpdateChecker {
|
|||||||
|
|
||||||
public void getVersion(final Consumer<String> consumer) {
|
public void getVersion(final Consumer<String> consumer) {
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
|
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
|
||||||
HttpURLConnection connection = null;
|
try (InputStream is = new URL(
|
||||||
try {
|
"https://api.spigotmc.org/legacy/update.php?resource=" + RESOURCE_ID + "/~").openStream();
|
||||||
URL url = new URL(API_URL);
|
Scanner scanner = new Scanner(is)) {
|
||||||
connection = (HttpURLConnection) url.openConnection();
|
|
||||||
connection.setRequestMethod("GET");
|
|
||||||
connection.setConnectTimeout(TIMEOUT_MS);
|
|
||||||
connection.setReadTimeout(TIMEOUT_MS);
|
|
||||||
connection.setRequestProperty("Accept", "application/json");
|
|
||||||
connection.setRequestProperty("User-Agent", "NexusLobby-UpdateChecker");
|
|
||||||
|
|
||||||
int responseCode = connection.getResponseCode();
|
if (scanner.hasNext()) {
|
||||||
if (responseCode != HttpURLConnection.HTTP_OK) {
|
consumer.accept(scanner.next());
|
||||||
plugin.getLogger().warning("Update-Check fehlgeschlagen: HTTP " + responseCode);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try (BufferedReader reader = new BufferedReader(
|
|
||||||
new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) {
|
|
||||||
|
|
||||||
StringBuilder response = new StringBuilder();
|
|
||||||
String line;
|
|
||||||
while ((line = reader.readLine()) != null) {
|
|
||||||
response.append(line);
|
|
||||||
}
|
|
||||||
|
|
||||||
parseAndNotify(response.toString(), consumer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
plugin.getLogger().warning("Update-Check fehlgeschlagen: " + e.getMessage());
|
plugin.getLogger().warning("Update-Check fehlgeschlagen: " + e.getMessage());
|
||||||
} finally {
|
|
||||||
if (connection != null) {
|
|
||||||
connection.disconnect();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseAndNotify(String jsonResponse, Consumer<String> consumer) {
|
|
||||||
try {
|
|
||||||
JsonObject json = JsonParser.parseString(jsonResponse).getAsJsonObject();
|
|
||||||
|
|
||||||
if (json.has("tag_name")) {
|
|
||||||
String version = json.get("tag_name").getAsString();
|
|
||||||
// Entferne 'v' Präfix falls vorhanden (z.B. v1.0.0 -> 1.0.0)
|
|
||||||
if (version.startsWith("v")) {
|
|
||||||
version = version.substring(1);
|
|
||||||
}
|
|
||||||
consumer.accept(version);
|
|
||||||
} else {
|
|
||||||
plugin.getLogger().warning("Update-Check: 'tag_name' nicht in API-Response gefunden");
|
|
||||||
}
|
|
||||||
} catch (JsonSyntaxException e) {
|
|
||||||
plugin.getLogger().warning("Update-Check: Ungültiges JSON-Format - " + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,8 @@ package de.nexuslobby.utils;
|
|||||||
import de.nexuslobby.NexusLobby;
|
import de.nexuslobby.NexusLobby;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@@ -17,7 +19,21 @@ public class VoidProtection implements Listener {
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if (player.getLocation().getY() < 0) {
|
if (player.getLocation().getY() < 0) {
|
||||||
if (NexusLobby.getInstance().getConfig().getBoolean("void_protection.teleport_to_spawn", true)) {
|
if (NexusLobby.getInstance().getConfig().getBoolean("void_protection.teleport_to_spawn", true)) {
|
||||||
Location spawn = player.getWorld().getSpawnLocation();
|
FileConfiguration config = NexusLobby.getInstance().getConfig();
|
||||||
|
Location spawn;
|
||||||
|
if (config.contains("spawn.world")) {
|
||||||
|
String worldName = config.getString("spawn.world");
|
||||||
|
World world = Bukkit.getWorld(worldName);
|
||||||
|
if (world != null) {
|
||||||
|
spawn = new Location(world,
|
||||||
|
config.getDouble("spawn.x"), config.getDouble("spawn.y"), config.getDouble("spawn.z"),
|
||||||
|
(float) config.getDouble("spawn.yaw"), (float) config.getDouble("spawn.pitch"));
|
||||||
|
} else {
|
||||||
|
spawn = player.getWorld().getSpawnLocation();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
spawn = player.getWorld().getSpawnLocation();
|
||||||
|
}
|
||||||
player.teleport(spawn);
|
player.teleport(spawn);
|
||||||
String msg = de.nexuslobby.utils.LangManager.get("void_protection_message");
|
String msg = de.nexuslobby.utils.LangManager.get("void_protection_message");
|
||||||
if (msg != null && !msg.isEmpty()) {
|
if (msg != null && !msg.isEmpty()) {
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
|
# _ __ __ __ __
|
||||||
|
# / | / /__ _ ____ _______/ / ____ / /_ / /_ __ __
|
||||||
|
# / |/ / _ \| |/_/ / / / ___/ / / __ \/ __ \/ __ \/ / / /
|
||||||
|
# / /| / __/> </ /_/ (__ ) /___/ /_/ / /_/ / /_/ / /_/ /
|
||||||
|
# /_/ |_/\___/_/|_|\__,_/____/_____/\____/_.___/_.___/\__, /
|
||||||
|
# /____/
|
||||||
|
#
|
||||||
|
# -----------------------------------------------------
|
||||||
# ArmorStandTools Configuration
|
# ArmorStandTools Configuration
|
||||||
# -----------------------------
|
# -----------------------------------------------------
|
||||||
|
|
||||||
# Nachrichten
|
# Nachrichten
|
||||||
prefix: "§8[§6ArmorStand§8] §7"
|
prefix: "§8[§6ArmorStand§8] §7"
|
||||||
|
|||||||
+391
-80
@@ -1,86 +1,255 @@
|
|||||||
# ==========================
|
# _ __ __ __ __
|
||||||
# NexusLobby Konfiguration
|
# / | / /__ _ ____ _______/ / ____ / /_ / /_ __ __
|
||||||
# ==========================
|
# / |/ / _ \| |/_/ / / / ___/ / / __ \/ __ \/ __ \/ / / /
|
||||||
|
# / /| / __/> </ /_/ (__ ) /___/ /_/ / /_/ / /_/ / /_/ /
|
||||||
|
# /_/ |_/\___/_/|_|\__,_/____/_____/\____/_.___/_.___/\__, /
|
||||||
|
# /____/
|
||||||
|
#
|
||||||
|
# =============================================================
|
||||||
|
# NEXUSLOBBY - HAUPTKONFIGURATION
|
||||||
|
# =============================================================
|
||||||
|
#
|
||||||
|
# Diese Konfigurationsdatei steuert alle Aspekte deiner Lobby.
|
||||||
|
# Farben werden mit & formatiert (z.B. &a = grün, &c = rot, &e = gelb)
|
||||||
|
# Vollständige Farbcode-Liste: https://minecraft.fandom.com/wiki/Formatting_codes
|
||||||
|
|
||||||
# --- Spawn Einstellungen ---
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# SPRACHE
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Spracheinstellung für alle Texte und Nachrichten im Plugin
|
||||||
|
# Verfügbare Optionen: de (Deutsch), en (Englisch), fr (Französisch)
|
||||||
|
language: de
|
||||||
|
|
||||||
|
# Prefix vor Plugin-Nachrichten im Chat (&-Farbcodes sind erlaubt)
|
||||||
|
prefix: "&8[&6Nexus&8] "
|
||||||
|
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# SPAWN EINSTELLUNGEN
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Definiert den Spawn-Punkt der Lobby, zu dem Spieler beim Join teleportiert werden
|
||||||
|
# Tipp: Nutze den Befehl /nexus setspawn um diese Werte automatisch zu setzen
|
||||||
spawn:
|
spawn:
|
||||||
world: "world" # Name der Standardwelt
|
# Name der Welt, in der sich der Spawn befindet
|
||||||
x: 0.5 # X-Koordinate des Spawns
|
world: "world"
|
||||||
y: 64.0 # Y-Koordinate des Spawns
|
|
||||||
z: 0.5 # Z-Koordinate des Spawns
|
|
||||||
yaw: 0.0 # Blickrichtung
|
|
||||||
pitch: 0.0 # Blickrichtung
|
|
||||||
|
|
||||||
|
# X-Koordinate des Spawn-Punktes (Ost-West)
|
||||||
|
x: 0.5
|
||||||
|
|
||||||
|
# Y-Koordinate des Spawn-Punktes (Höhe)
|
||||||
|
y: 64.0
|
||||||
|
|
||||||
|
# Z-Koordinate des Spawn-Punktes (Nord-Süd)
|
||||||
|
z: 0.5
|
||||||
|
|
||||||
|
# Horizontale Blickrichtung beim Spawn (0-360 Grad)
|
||||||
|
# 0 = Süden, 90 = Westen, 180 = Norden, 270 = Osten
|
||||||
|
yaw: 0.0
|
||||||
|
|
||||||
|
# Vertikale Blickrichtung beim Spawn (-90 bis 90 Grad)
|
||||||
|
# -90 = Direkt nach oben, 0 = Geradeaus, 90 = Direkt nach unten
|
||||||
|
pitch: 0.0
|
||||||
|
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# WELTGRENZE (WORLD BORDER)
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Erstellt eine unsichtbare Barriere um die Lobby herum
|
||||||
worldborder:
|
worldborder:
|
||||||
|
# Aktiviert die Weltgrenze (true = an, false = aus)
|
||||||
enabled: true
|
enabled: true
|
||||||
type: "SQUARE" # oder "CIRCLE"
|
|
||||||
radius: 50.0
|
|
||||||
center:
|
|
||||||
pos1:
|
|
||||||
pos2:
|
|
||||||
|
|
||||||
# --- Lobby Einstellungen ---
|
# Form der Weltgrenze
|
||||||
|
# Optionen: "SQUARE" (Quadrat), "CIRCLE" (Kreis)
|
||||||
|
type: "SQUARE"
|
||||||
|
|
||||||
|
# Radius der Weltgrenze in Blöcken
|
||||||
|
# Bei SQUARE: Kantenlänge = radius * 2
|
||||||
|
# Bei CIRCLE: Durchmesser = radius * 2
|
||||||
|
radius: 50.0
|
||||||
|
|
||||||
|
# Zentrum der Weltgrenze (optional, kann leer bleiben)
|
||||||
|
# Wenn nicht gesetzt, wird der Spawn-Punkt als Zentrum verwendet
|
||||||
|
# center wird automatisch über /border circle gesetzt
|
||||||
|
|
||||||
|
# Alternative: Definiere Eckpunkte (für rechteckige Border)
|
||||||
|
# Format: x,y,z
|
||||||
|
# pos1 wird automatisch über /border square gesetzt
|
||||||
|
# pos2 wird automatisch über /border square gesetzt
|
||||||
|
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# LOBBY EINSTELLUNGEN
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Grundlegende Verhaltensregeln und Einstellungen für die Lobby
|
||||||
lobby:
|
lobby:
|
||||||
allow-fly: false # Spieler dürfen fliegen
|
# Erlaubt Spielern das Fliegen in der Lobby
|
||||||
pvp-enabled: false # PvP in der Lobby
|
# true = Spieler können fliegen, false = Fliegen ist deaktiviert
|
||||||
build-enabled: false # Bau im Lobby-Bereich
|
allow-fly: false
|
||||||
|
|
||||||
|
# Aktiviert PvP (Player vs Player) in der Lobby
|
||||||
|
# true = Spieler können sich gegenseitig angreifen, false = kein PvP
|
||||||
|
pvp-enabled: false
|
||||||
|
|
||||||
|
# Erlaubt Spielern das Platzieren und Abbauen von Blöcken
|
||||||
|
# true = Bauen erlaubt, false = Bauen verboten (außer für Berechtigte)
|
||||||
|
build-enabled: false
|
||||||
|
|
||||||
|
# Standard-Spielmodus für alle Spieler in der Lobby
|
||||||
|
# Optionen: Survival, Creative, Adventure, Spectator
|
||||||
default-gamemode: Adventure
|
default-gamemode: Adventure
|
||||||
|
|
||||||
|
# Leert das Inventar von Spielern beim Betreten der Lobby
|
||||||
|
# true = Inventar wird geleert, false = Inventar bleibt erhalten
|
||||||
|
# Empfohlen: true für ein sauberes Lobby-Erlebnis
|
||||||
clear-inventory-on-join: true
|
clear-inventory-on-join: true
|
||||||
|
|
||||||
# Mapping für den Server-Status-Ping der ArmorStands
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
# Der Name (z.B. survival) muss exakt dem Bungee-Servernamen entsprechen
|
# SCOREBOARD EINSTELLUNGEN
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Steuert das Scoreboard (rechte Seitenleiste) in der Lobby
|
||||||
|
# Standardmäßig sichtbar? Spieler können es per Befehl ein-/ausblenden
|
||||||
|
# true = Scoreboard wird beim Join angezeigt, false = standardmäßig ausgeblendet
|
||||||
|
scoreboard-default-visible: true
|
||||||
|
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# SERVER-STATUS PING (FÜR ARMORSTANDS)
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Mapping für den Server-Status-Ping der ArmorStands in der Lobby
|
||||||
|
# Diese Einstellungen ermöglichen es, den Status anderer Server zu überprüfen
|
||||||
|
# WICHTIG: Der Name (z.B. "survival") muss EXAKT dem BungeeCord-Servernamen entsprechen
|
||||||
servers:
|
servers:
|
||||||
|
# Erster Server: Survival
|
||||||
survival:
|
survival:
|
||||||
|
# IP-Adresse des Survival-Servers
|
||||||
|
# 127.0.0.1 = Localhost (Server läuft auf derselben Maschine)
|
||||||
ip: "127.0.0.1"
|
ip: "127.0.0.1"
|
||||||
|
|
||||||
|
# Port des Survival-Servers
|
||||||
port: 25566
|
port: 25566
|
||||||
|
|
||||||
|
# Zweiter Server: Skyblock
|
||||||
skyblock:
|
skyblock:
|
||||||
|
# IP-Adresse des Skyblock-Servers
|
||||||
ip: "127.0.0.1"
|
ip: "127.0.0.1"
|
||||||
|
|
||||||
|
# Port des Skyblock-Servers
|
||||||
port: 25567
|
port: 25567
|
||||||
|
|
||||||
# --- Tablist Einstellungen ---
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# TABLISTE (TAB-LISTE) EINSTELLUNGEN
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Anpassung der Player-Liste (TAB-Taste)
|
||||||
tablist:
|
tablist:
|
||||||
|
# Aktiviert die angepasste Tabliste
|
||||||
|
# true = Custom Tablist wird verwendet, false = Standard Minecraft Tablist
|
||||||
enabled: true
|
enabled: true
|
||||||
header: "&6Willkommen auf &eNexusLobby"
|
|
||||||
footer: "&7Viel Spaß!"
|
|
||||||
refresh-interval: 40 # Ticks
|
|
||||||
|
|
||||||
# --- Items Modul Einstellungen ---
|
# Kopfzeile über den Spielernamen
|
||||||
|
# Unterstützt Farbcodes (&-Codes) und mehrzeiligen Text mit |
|
||||||
|
header: "&6Willkommen auf &eNexusLobby"
|
||||||
|
|
||||||
|
# Fußzeile unter den Spielernamen
|
||||||
|
# Unterstützt Farbcodes (&-Codes) und mehrzeiligen Text mit |
|
||||||
|
footer: "&7Viel Spaß!"
|
||||||
|
|
||||||
|
# Aktualisierungsintervall in Ticks (20 Ticks = 1 Sekunde)
|
||||||
|
# Niedrigere Werte = häufigere Updates (mehr Performance-Last)
|
||||||
|
# Höhere Werte = seltenere Updates (weniger Performance-Last)
|
||||||
|
refresh-interval: 40
|
||||||
|
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# ITEMS MODUL EINSTELLUNGEN
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Konfiguration der Items, die Spieler in der Lobby erhalten
|
||||||
items:
|
items:
|
||||||
|
# Container für alle Lobby-Werkzeuge
|
||||||
lobby-tools:
|
lobby-tools:
|
||||||
|
# Kompass (Server-Auswahl / Teleporter)
|
||||||
compass:
|
compass:
|
||||||
enabled: true
|
# Aktiviert das Kompass-Item (true = an, false = aus)
|
||||||
displayname: "&eTeleporter"
|
|
||||||
slot: 4
|
|
||||||
build-toggle:
|
|
||||||
enabled: true
|
|
||||||
displayname: "&aBaumodus"
|
|
||||||
slot: 0
|
|
||||||
gadget:
|
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# Anzeigename des Items (unterstützt Farbcodes)
|
||||||
|
displayname: "&eTeleporter"
|
||||||
|
|
||||||
|
# Slot im Inventar (0-8, wobei 0 ganz links ist und 8 ganz rechts)
|
||||||
|
slot: 4
|
||||||
|
|
||||||
|
# Baumodus-Umschalter (nur für berechtigte Spieler)
|
||||||
|
build-toggle:
|
||||||
|
# Aktiviert das Baumodus-Item (true = an, false = aus)
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
# Anzeigename des Items (unterstützt Farbcodes)
|
||||||
|
displayname: "&aBaumodus"
|
||||||
|
|
||||||
|
# Slot im Inventar (0-8)
|
||||||
|
slot: 0
|
||||||
|
|
||||||
|
# Gadget-Menü (Spezialeffekte und Extras)
|
||||||
|
gadget:
|
||||||
|
# Aktiviert das Gadget-Item (true = an, false = aus)
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
# Anzeigename des Items (unterstützt Farbcodes)
|
||||||
displayname: "&bGadgets"
|
displayname: "&bGadgets"
|
||||||
|
|
||||||
|
# Slot im Inventar (0-8)
|
||||||
slot: 8
|
slot: 8
|
||||||
|
|
||||||
# --- Portal Einstellungen ---
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# PORTAL EINSTELLUNGEN
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Konfiguration für Teleportations-Portale in der Lobby
|
||||||
portals:
|
portals:
|
||||||
|
# Standard-Partikeleffekt für alle Portale
|
||||||
|
# Optionen: PORTAL, FLAME, VILLAGER_HAPPY, REDSTONE, ENCHANTMENT_TABLE, etc.
|
||||||
|
# Vollständige Liste: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Particle.html
|
||||||
default-particle: "PORTAL"
|
default-particle: "PORTAL"
|
||||||
portal-cooldown: 40 # Ticks, 2 Sekunden
|
|
||||||
|
# Cooldown zwischen Portal-Nutzungen in Ticks (20 Ticks = 1 Sekunde)
|
||||||
|
# Verhindert Spam und ungewollte Mehrfach-Teleports
|
||||||
|
portal-cooldown: 40
|
||||||
|
|
||||||
|
# Dateiname für die Speicherung der Portal-Positionen
|
||||||
|
# Wird automatisch im Plugin-Ordner erstellt
|
||||||
save-file: "portals.yml"
|
save-file: "portals.yml"
|
||||||
|
|
||||||
# -----------------------------------------------------
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
# COMPASS MENU
|
# COMPASS MENU (SERVER SWITCHER)
|
||||||
# -----------------------------------------------------
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# GUI-Menü das sich öffnet, wenn ein Spieler auf den Kompass klickt
|
||||||
compass:
|
compass:
|
||||||
|
# Titel des Inventar-Menüs (unterstützt Farbcodes)
|
||||||
title: "&eServer Switcher"
|
title: "&eServer Switcher"
|
||||||
|
|
||||||
|
# Größe des Inventars (muss ein Vielfaches von 9 sein)
|
||||||
|
# Optionen: 9, 18, 27, 36, 45, 54
|
||||||
size: 27
|
size: 27
|
||||||
|
|
||||||
|
# Server-Einträge im Menü
|
||||||
servers:
|
servers:
|
||||||
|
# Erster Server: PvP
|
||||||
pvp:
|
pvp:
|
||||||
|
# Anzeigename des Items im Menü (unterstützt Farbcodes)
|
||||||
name: "&cPvP Arena"
|
name: "&cPvP Arena"
|
||||||
|
|
||||||
|
# Material des Items (muss ein gültiger Minecraft-Material-Name sein)
|
||||||
|
# Liste: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
|
||||||
material: "DIAMOND_SWORD"
|
material: "DIAMOND_SWORD"
|
||||||
|
|
||||||
|
# Befehl der beim Klick ausgeführt wird
|
||||||
|
# Für BungeeCord: "server <servername>"
|
||||||
|
# Für Teleport: "spawn <name>" oder andere Custom-Befehle
|
||||||
command: "server pvp"
|
command: "server pvp"
|
||||||
|
|
||||||
|
# Position des Items im Inventar (0 = oben links)
|
||||||
slot: 11
|
slot: 11
|
||||||
|
|
||||||
|
# Beschreibung des Items (wird beim Darüberfahren angezeigt)
|
||||||
lore:
|
lore:
|
||||||
- "&7Klicke hier um dich"
|
- "&7Klicke hier um dich"
|
||||||
- "&7zum PvP Server zu teleportieren."
|
- "&7zum PvP Server zu teleportieren."
|
||||||
|
|
||||||
|
# Zweiter Server: Survival
|
||||||
survival:
|
survival:
|
||||||
name: "&aSurvival"
|
name: "&aSurvival"
|
||||||
material: "GRASS_BLOCK"
|
material: "GRASS_BLOCK"
|
||||||
@@ -89,6 +258,8 @@ compass:
|
|||||||
lore:
|
lore:
|
||||||
- "&7Das normale Survival."
|
- "&7Das normale Survival."
|
||||||
- "&7Viel Spaß beim Bauen!"
|
- "&7Viel Spaß beim Bauen!"
|
||||||
|
|
||||||
|
# Dritter Server: BuildBattle
|
||||||
buildbattle:
|
buildbattle:
|
||||||
name: "&bBuildBattle"
|
name: "&bBuildBattle"
|
||||||
material: "BEDROCK"
|
material: "BEDROCK"
|
||||||
@@ -97,82 +268,222 @@ compass:
|
|||||||
lore:
|
lore:
|
||||||
- "&7Zeige was du kannst!"
|
- "&7Zeige was du kannst!"
|
||||||
|
|
||||||
# -----------------------------------------------------
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
# PLAYER INSPECT (Statistiken per Rechtsklick)
|
# PLAYER INSPECT (STATISTIKEN PER RECHTSKLICK)
|
||||||
# -----------------------------------------------------
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Ermöglicht das Anzeigen von Spieler-Statistiken durch Rechtsklick auf einen Spieler
|
||||||
player_inspect:
|
player_inspect:
|
||||||
|
# Aktiviert die Player-Inspect-Funktion (true = an, false = aus)
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
# Titel des GUI-Fensters das sich öffnet
|
||||||
|
# Platzhalter: {PLAYER} = Name des angeklickten Spielers
|
||||||
gui_title: "&8Statistiken von &6{PLAYER}"
|
gui_title: "&8Statistiken von &6{PLAYER}"
|
||||||
|
|
||||||
# --- Suppressor / Global Chat Einstellungen ---
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# SUPPRESSOR / GLOBAL CHAT EINSTELLUNGEN
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Join/Quit-Nachrichten Unterdrückung und BungeeCord-Messaging
|
||||||
suppressor:
|
suppressor:
|
||||||
enabled: true
|
# Aktiviert das Suppressor-System (true = an, false = aus)
|
||||||
suppress-join-quit: true
|
|
||||||
suppress-duration-ticks: 40 # Zeit, bis Spieler wieder sichtbar
|
|
||||||
channels:
|
|
||||||
control: "global:control" # Channel für Join/Quit Suppression
|
|
||||||
chat: "global:chat" # Channel für globales Chat-Relay
|
|
||||||
|
|
||||||
# --- Logging Einstellungen ---
|
|
||||||
logging:
|
|
||||||
enable-debug: true # Aktiviert detaillierte Logs für Module
|
|
||||||
log-file: "logs/plugin.log" # Pfad für das Logfile
|
|
||||||
|
|
||||||
# --- Wartungsmodus ---
|
|
||||||
maintenance:
|
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
# Unterdrückt Join- und Quit-Nachrichten für neue Spieler temporär
|
||||||
|
# true = Nachrichten werden unterdrückt, false = normale Anzeige
|
||||||
|
# Nützlich um Spam zu vermeiden wenn viele Spieler gleichzeitig joinen/leaven
|
||||||
|
suppress-join-quit: true
|
||||||
|
|
||||||
|
# Dauer der Unterdrückung in Ticks (20 Ticks = 1 Sekunde)
|
||||||
|
# Nach dieser Zeit werden Join/Quit-Nachrichten wieder normal angezeigt
|
||||||
|
suppress-duration-ticks: 40
|
||||||
|
|
||||||
|
# BungeeCord Plugin-Messaging Channels
|
||||||
|
# Diese Channels werden für die Kommunikation zwischen Servern verwendet
|
||||||
|
channels:
|
||||||
|
# Channel für Join/Quit-Suppression-Control
|
||||||
|
control: "global:control"
|
||||||
|
|
||||||
|
# Channel für globales Chat-Relay über alle Server
|
||||||
|
chat: "global:chat"
|
||||||
|
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# LOGGING EINSTELLUNGEN
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Konfiguration der Plugin-Logs und Debug-Ausgaben
|
||||||
|
logging:
|
||||||
|
# Aktiviert detaillierte Debug-Logs in der Konsole
|
||||||
|
# true = Sehr ausführliche Logs (nur zur Fehlersuche empfohlen)
|
||||||
|
# false = Normale Logs
|
||||||
|
# WARNUNG: Bei true kann die Konsole sehr voll werden!
|
||||||
|
enable-debug: true
|
||||||
|
|
||||||
|
# Pfad zur Log-Datei des Plugins
|
||||||
|
# Relativ zum Plugin-Ordner
|
||||||
|
log-file: "logs/plugin.log"
|
||||||
|
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# WARTUNGSMODUS
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Sperrt den Server für normale Spieler während Wartungsarbeiten
|
||||||
|
maintenance:
|
||||||
|
# Aktiviert den Wartungsmodus (true = an, false = aus)
|
||||||
|
# Wenn aktiviert, können nur Spieler mit der Permission "nexuslobby.maintenance.bypass" joinen
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
# Nachricht die Spielern angezeigt wird, wenn sie gekickt werden
|
||||||
|
# Unterstützt Farbcodes und \n für Zeilenumbrüche
|
||||||
kick_message: "&cServer im Wartungsmodus! Du darfst nicht joinen."
|
kick_message: "&cServer im Wartungsmodus! Du darfst nicht joinen."
|
||||||
|
|
||||||
# -----------------------------------------------------
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
# VOID PROTECTION
|
# VOID PROTECTION (SCHUTZ VOR LEERE)
|
||||||
# -----------------------------------------------------
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
# Verhindert, dass Spieler in die Leere fallen
|
# Verhindert dass Spieler in die Leere fallen und im Void sterben
|
||||||
void_protection:
|
void_protection:
|
||||||
|
# Aktiviert den Void-Schutz (true = an, false = aus)
|
||||||
enabled: true
|
enabled: true
|
||||||
# Teleportiert den Spieler zum Welt-Spawn
|
|
||||||
|
# Teleportiert Spieler zum Spawn zurück wenn sie in die Leere fallen
|
||||||
|
# true = Teleport zum Spawn, false = Spieler nimmt Schaden/stirbt
|
||||||
teleport_to_spawn: true
|
teleport_to_spawn: true
|
||||||
# Nachricht beim Teleport (Leer lassen für keine Nachricht)
|
|
||||||
|
# Nachricht die dem Spieler beim Teleport angezeigt wird
|
||||||
|
# Leer lassen ("") für keine Nachricht
|
||||||
message: "&cDu bist in die Leere gefallen und wurdest teleportiert!"
|
message: "&cDu bist in die Leere gefallen und wurdest teleportiert!"
|
||||||
|
|
||||||
# -----------------------------------------------------
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
# DOUBLE JUMP
|
# DOUBLE JUMP (DOPPELSPRUNG)
|
||||||
# -----------------------------------------------------
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
# Erlaubt einen Doppelsprung in der Lobby
|
# Erlaubt Spielern einen Doppelsprung in der Luft
|
||||||
doublejump:
|
doublejump:
|
||||||
|
# Aktiviert die Doppelsprung-Funktion (true = an, false = aus)
|
||||||
enabled: true
|
enabled: true
|
||||||
# Stärke des Sprungs nach oben
|
|
||||||
|
# Stärke des Sprungs nach oben (vertikale Geschwindigkeit)
|
||||||
|
# Standardwert: 1.0
|
||||||
|
# Höhere Werte = höherer Sprung, niedrigere Werte = flacherer Sprung
|
||||||
|
# Empfohlener Bereich: 0.5 - 2.0
|
||||||
velocity: 1.0
|
velocity: 1.0
|
||||||
# Vorwärts-Schub beim Sprung
|
|
||||||
|
# Vorwärts-Schub beim Sprung (horizontale Geschwindigkeit)
|
||||||
|
# Standardwert: 0.2
|
||||||
|
# Höhere Werte = mehr Vorwärtsschub, 0.0 = kein Vorwärtsschub
|
||||||
|
# Empfohlener Bereich: 0.0 - 0.5
|
||||||
horizontal: 0.2
|
horizontal: 0.2
|
||||||
|
|
||||||
# -----------------------------------------------------
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
# PLAYER HIDER
|
# PLAYER HIDER (SPIELER VERSTECKEN)
|
||||||
# -----------------------------------------------------
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
# Item, um andere Spieler zu verstecken/anzuzeigen
|
# Item zum Verstecken/Anzeigen anderer Spieler in der Lobby
|
||||||
hider:
|
hider:
|
||||||
|
# Aktiviert die Player-Hider-Funktion (true = an, false = aus)
|
||||||
enabled: true
|
enabled: true
|
||||||
# Material-Name (Muss ein gültiger Bukkit-Material-Name sein)
|
|
||||||
|
# Material des Items im Inventar
|
||||||
|
# Kann je nach Status wechseln (z.B. grüner/roter Farbstoff)
|
||||||
|
# Liste: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
|
||||||
item: "REDSTONE"
|
item: "REDSTONE"
|
||||||
|
|
||||||
# Slot im Inventar (0-8)
|
# Slot im Inventar (0-8)
|
||||||
slot: 8
|
slot: 8
|
||||||
|
|
||||||
|
# Nachrichten für verschiedene Zustände
|
||||||
messages:
|
messages:
|
||||||
# Anzeigename des Items und Nachricht, wenn alle sichtbar sind
|
# Anzeigename und Nachricht wenn alle Spieler sichtbar sind
|
||||||
|
# Wird angezeigt wenn der Spieler auf das Item klickt und Spieler sichtbar sind
|
||||||
all: "&aAlle Spieler: &7Sichtbar"
|
all: "&aAlle Spieler: &7Sichtbar"
|
||||||
# Anzeigename des Items und Nachricht, wenn alle versteckt sind
|
|
||||||
|
# Anzeigename und Nachricht wenn alle Spieler versteckt sind
|
||||||
|
# Wird angezeigt wenn der Spieler auf das Item klickt und Spieler versteckt sind
|
||||||
none: "&cKeine Spieler: &7Versteckt"
|
none: "&cKeine Spieler: &7Versteckt"
|
||||||
|
|
||||||
# -----------------------------------------------------
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
# BALL / SOCCER EINSTELLUNGEN
|
# BALL / SOCCER EINSTELLUNGEN
|
||||||
# -----------------------------------------------------
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Aktiviert ein Fußball-System in der Lobby zum Spielen
|
||||||
ball:
|
ball:
|
||||||
|
# Aktiviert das Ball-System (true = an, false = aus)
|
||||||
enabled: true
|
enabled: true
|
||||||
# Der Spawnpunkt wird automatisch über /nexus ball setspawn hier gespeichert
|
|
||||||
|
# Spawn-Position des Balls
|
||||||
|
# Tipp: Nutze /nexuslobby ball setspawn um diese Position automatisch zu setzen
|
||||||
spawn:
|
spawn:
|
||||||
|
# Name der Welt in der der Ball spawnt
|
||||||
world: "world"
|
world: "world"
|
||||||
|
|
||||||
|
# X-Koordinate des Ball-Spawns
|
||||||
x: 10.5
|
x: 10.5
|
||||||
|
|
||||||
|
# Y-Koordinate des Ball-Spawns
|
||||||
y: 65.0
|
y: 65.0
|
||||||
|
|
||||||
|
# Z-Koordinate des Ball-Spawns
|
||||||
z: 10.5
|
z: 10.5
|
||||||
|
|
||||||
|
# Blickrichtung des Balls (normalerweise nicht relevant)
|
||||||
yaw: 0.0
|
yaw: 0.0
|
||||||
pitch: 0.0
|
pitch: 0.0
|
||||||
# Zeit in Sekunden, bis der Ball bei Inaktivität respawnt
|
|
||||||
|
# Zeit in Sekunden bis der Ball bei Inaktivität automatisch respawnt
|
||||||
|
# Nützlich wenn der Ball verloren geht oder stecken bleibt
|
||||||
|
# 0 = Kein automatischer Respawn
|
||||||
respawn_delay: 60
|
respawn_delay: 60
|
||||||
|
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════
|
||||||
|
# TOR-DEFINITIONEN
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════
|
||||||
|
# Tore werden automatisch per Befehl gesetzt und hier gespeichert.
|
||||||
|
# Manuell bearbeiten ist möglich, aber der Befehlsweg ist empfohlen.
|
||||||
|
#
|
||||||
|
# Anleitung zum Einrichten eines Tores:
|
||||||
|
# 1. Gehe zur INNEREN Ecke des Torrahmens (z.B. linke untere Ecke)
|
||||||
|
# /nexuslobby ball goal pos1
|
||||||
|
# 2. Gehe zur GEGENÜBERLIEGENDEN Ecke (rechte obere Ecke, auch 1-2 Blöcke
|
||||||
|
# hinter dem Tor in Schussrichtung für bessere Erkennung!)
|
||||||
|
# /nexuslobby ball goal pos2
|
||||||
|
# 3. Speichern (Team 1 = Blau, Team 2 = Rot):
|
||||||
|
# /nexuslobby ball goal save torBlau 1
|
||||||
|
#
|
||||||
|
# WICHTIG für zuverlässige Erkennung:
|
||||||
|
# - Die Box muss MINDESTENS 1.5 Blöcke Tiefe in Schussrichtung haben
|
||||||
|
# - Die Box muss MINDESTENS 3 Blöcke hoch sein (Y-Achse)
|
||||||
|
# - Nutze /nexuslobby ball goal show um die Box sichtbar zu machen
|
||||||
|
# - Nutze /nexuslobby ball goal debug um die Ball-Position live zu prüfen
|
||||||
|
#
|
||||||
|
# Beispiel-Eintrag (wird vom Plugin automatisch befüllt):
|
||||||
|
# goals:
|
||||||
|
# torBlau:
|
||||||
|
# pos1:
|
||||||
|
# world: world
|
||||||
|
# x: 100.0
|
||||||
|
# y: 64.0
|
||||||
|
# z: 198.0
|
||||||
|
# pos2:
|
||||||
|
# world: world
|
||||||
|
# x: 106.0
|
||||||
|
# y: 68.0
|
||||||
|
# z: 200.5 # <-- 2.5 Blöcke Tiefe in Z-Richtung!
|
||||||
|
# team: 1
|
||||||
|
# torRot:
|
||||||
|
# pos1:
|
||||||
|
# world: world
|
||||||
|
# x: 100.0
|
||||||
|
# y: 64.0
|
||||||
|
# z: -198.0
|
||||||
|
# pos2:
|
||||||
|
# world: world
|
||||||
|
# x: 106.0
|
||||||
|
# y: 68.0
|
||||||
|
# z: -200.5
|
||||||
|
# team: 2
|
||||||
|
#
|
||||||
|
# Tore werden hier automatisch eingetragen sobald du den save-Befehl nutzt:
|
||||||
|
goals: {}
|
||||||
|
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# Links
|
||||||
|
# ══════════════════════════════════════════════════════════════════════════════
|
||||||
|
#
|
||||||
|
# Benötigst du Hilfe oder Support?
|
||||||
|
# - Webseite: https://m-viper.de
|
||||||
|
# - Dokumentation: https://viper-network.de/wiki/NexusLobby/
|
||||||
|
# - Discord: https://discord.com/invite/FdRs4BRd8D
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
|
# _ __ __ __ __
|
||||||
|
# / | / /__ _ ____ _______/ / ____ / /_ / /_ __ __
|
||||||
|
# / |/ / _ \| |/_/ / / / ___/ / / __ \/ __ \/ __ \/ / / /
|
||||||
|
# / /| / __/> </ /_/ (__ ) /___/ /_/ / /_/ / /_/ / /_/ /
|
||||||
|
# /_/ |_/\___/_/|_|\__,_/____/_____/\____/_.___/_.___/\__, /
|
||||||
|
# /____/
|
||||||
|
#
|
||||||
# =============================================================
|
# =============================================================
|
||||||
# NexusLobby - Lebendige Dialoge v2
|
# Dialoge und Gespräche in der Lobby
|
||||||
# =============================================================
|
# =============================================================
|
||||||
|
|
||||||
conversations:
|
conversations:
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
|
# _ __ __ __ __
|
||||||
|
# / | / /__ _ ____ _______/ / ____ / /_ / /_ __ __
|
||||||
|
# / |/ / _ \| |/_/ / / / ___/ / / __ \/ __ \/ __ \/ / / /
|
||||||
|
# / /| / __/> </ /_/ (__ ) /___/ /_/ / /_/ / /_/ / /_/ /
|
||||||
|
# /_/ |_/\___/_/|_|\__,_/____/_____/\____/_.___/_.___/\__, /
|
||||||
|
# /____/
|
||||||
|
#
|
||||||
|
# =====================================================
|
||||||
|
# DEFAULT Language
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
soccer_module_not_loaded:
|
soccer_module_not_loaded:
|
||||||
de: "§cDas Fußball-Modul ist nicht geladen."
|
de: "§cDas Fußball-Modul ist nicht geladen."
|
||||||
en: "§cThe soccer module is not loaded."
|
en: "§cThe soccer module is not loaded."
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: NexusLobby
|
name: NexusLobby
|
||||||
main: de.nexuslobby.NexusLobby
|
main: de.nexuslobby.NexusLobby
|
||||||
version: "1.1.1"
|
version: "2.0"
|
||||||
api-version: "1.21"
|
api-version: "1.21"
|
||||||
author: M_Viper
|
author: M_Viper
|
||||||
description: Modular Lobby Plugin with an invisible Particle-Parkour system.
|
description: Modular Lobby Plugin with an invisible Particle-Parkour system.
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
|
# _ __ __ __ __
|
||||||
|
# / | / /__ _ ____ _______/ / ____ / /_ / /_ __ __
|
||||||
|
# / |/ / _ \| |/_/ / / / ___/ / / __ \/ __ \/ __ \/ / / /
|
||||||
|
# / /| / __/> </ /_/ (__ ) /___/ /_/ / /_/ / /_/ / /_/ /
|
||||||
|
# /_/ |_/\___/_/|_|\__,_/____/_____/\____/_.___/_.___/\__, /
|
||||||
|
# /____/
|
||||||
|
#
|
||||||
# =====================================================
|
# =====================================================
|
||||||
# NEXUSLOBBY – DEFAULT LOBBY GAMERULES
|
# DEFAULT LOBBY GAMERULES
|
||||||
# Minecraft 1.21.1
|
|
||||||
# =====================================================
|
# =====================================================
|
||||||
|
|
||||||
# -------------------------------------------------
|
# -------------------------------------------------
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
|
# _ __ __ __ __
|
||||||
|
# / | / /__ _ ____ _______/ / ____ / /_ / /_ __ __
|
||||||
|
# / |/ / _ \| |/_/ / / / ___/ / / __ \/ __ \/ __ \/ / / /
|
||||||
|
# / /| / __/> </ /_/ (__ ) /___/ /_/ / /_/ / /_/ / /_/ /
|
||||||
|
# /_/ |_/\___/_/|_|\__,_/____/_____/\____/_.___/_.___/\__, /
|
||||||
|
# /____/
|
||||||
|
#
|
||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# NEXUSLOBBY - VISUELLE EINSTELLUNGEN
|
# VISUELLE EINSTELLUNGEN
|
||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
|
|
||||||
# --- Tablist Einstellungen ---
|
# --- Tablist Einstellungen ---
|
||||||
|
|||||||
Reference in New Issue
Block a user