Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a75a7db33 | ||
|
|
be78c34222 | ||
|
|
2460691df2 | ||
|
|
46dc0cbe05 | ||
|
|
79fed93d20 | ||
|
|
c3a8f15f6d | ||
|
|
b46af01475 | ||
|
|
8fe8f2b1af | ||
|
|
ce6847e58e | ||
|
|
95b0e2f971 | ||
|
|
045a5f2b1b | ||
| 8a2c3b4277 | |||
| 38bbba4c8b | |||
| d92d0d5328 | |||
| a27c174daa |
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>de.nexuslobby</groupId>
|
<groupId>de.nexuslobby</groupId>
|
||||||
<artifactId>NexusLobby</artifactId>
|
<artifactId>NexusLobby</artifactId>
|
||||||
<version>1.1.4</version>
|
<version>1.9</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>NexusLobby</name>
|
<name>NexusLobby</name>
|
||||||
|
|||||||
@@ -204,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());
|
||||||
@@ -323,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);
|
||||||
@@ -492,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class LobbyTabCompleter implements TabCompleter {
|
|||||||
if (sender.hasPermission("nexuslobby.admin")) {
|
if (sender.hasPermission("nexuslobby.admin")) {
|
||||||
suggestions.addAll(Arrays.asList(
|
suggestions.addAll(Arrays.asList(
|
||||||
"setstart", "setfinish", "setcheckpoint",
|
"setstart", "setfinish", "setcheckpoint",
|
||||||
"reset", "clear", "removeall", "info"
|
"holo", "reset", "clear", "removeall", "info"
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
// Normale Spieler können nur ihren Run abbrechen
|
// Normale Spieler können nur ihren Run abbrechen
|
||||||
@@ -77,7 +77,8 @@ public class LobbyTabCompleter implements TabCompleter {
|
|||||||
String parkSub = args[1].toLowerCase();
|
String parkSub = args[1].toLowerCase();
|
||||||
if (parkSub.equals("setstart")
|
if (parkSub.equals("setstart")
|
||||||
|| parkSub.equals("setfinish")
|
|| parkSub.equals("setfinish")
|
||||||
|| parkSub.equals("setcheckpoint")) {
|
|| parkSub.equals("setcheckpoint")
|
||||||
|
|| parkSub.equals("holo")) {
|
||||||
suggestions.addAll(Arrays.asList("1", "2"));
|
suggestions.addAll(Arrays.asList("1", "2"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -206,6 +207,25 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
player.sendMessage(pm.getTrackInfo());
|
player.sendMessage(pm.getTrackInfo());
|
||||||
break;
|
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:
|
default:
|
||||||
player.sendMessage(de.nexuslobby.utils.LangManager.get("unknown_subcommand"));
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("unknown_subcommand"));
|
||||||
break;
|
break;
|
||||||
@@ -318,6 +338,7 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
player.sendMessage("§e/nexus parkour setstart <1|2> §7- Start setzen");
|
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 setcheckpoint <1|2> §7- Checkpoint setzen");
|
||||||
player.sendMessage("§e/nexus parkour setfinish <1|2> §7- Ziel 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 reset §7- Eigenen Run abbrechen");
|
||||||
player.sendMessage("§e/nexus parkour clear §7- §cTop-10 Liste löschen");
|
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"));
|
||||||
|
|||||||
@@ -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,6 +10,7 @@ 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.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -105,25 +107,56 @@ public class ScoreboardModule implements Module, Listener {
|
|||||||
player.setScoreboard(board);
|
player.setScoreboard(board);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Altes Objective entfernen, damit wir die Zeilen aktualisieren können
|
// Altes Objective entfernen
|
||||||
// Dasboard selbst bleibt bestehen (wichtig für Tablist-Teams!)
|
|
||||||
Objective oldObj = board.getObjective("lobby");
|
Objective oldObj = board.getObjective("lobby");
|
||||||
if (oldObj != null) {
|
if (oldObj != null) oldObj.unregister();
|
||||||
oldObj.unregister();
|
|
||||||
|
// 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
Objective obj = board.registerNewObjective("lobby", "dummy",
|
// Paper 1.21: Objective mit Component-Titel registrieren
|
||||||
translate(player, title));
|
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);
|
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
|
||||||
|
|
||||||
for (int i = 0; i < lines.size(); i++) {
|
// Zahlen global für dieses Objective ausblenden (Paper 1.20.4+ API)
|
||||||
String line = translate(player, lines.get(i));
|
obj.numberFormat(NumberFormat.blank());
|
||||||
|
|
||||||
if (line.isEmpty() || line.isBlank()) {
|
for (int i = 0; i < lines.size(); i++) {
|
||||||
line = ChatColor.values()[i % ChatColor.values().length].toString();
|
String lineText = translate(player, lines.get(i));
|
||||||
|
|
||||||
|
// Eindeutiger unsichtbarer Entry pro Zeile via Farb-Code
|
||||||
|
String entry = ChatColor.values()[i % ChatColor.values().length].toString()
|
||||||
|
+ 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("");
|
||||||
}
|
}
|
||||||
|
|
||||||
obj.getScore(line).setScore(lines.size() - i);
|
// Score setzen + Zahl pro Eintrag zusätzlich ausblenden
|
||||||
|
org.bukkit.scoreboard.Score score = obj.getScore(entry);
|
||||||
|
score.setScore(lines.size() - i);
|
||||||
|
score.numberFormat(NumberFormat.blank());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Kein player.setScoreboard(board) nötig, da wir das Objekt 'board'
|
// Kein player.setScoreboard(board) nötig, da wir das Objekt 'board'
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -119,6 +158,9 @@ public class ASTListener implements Listener {
|
|||||||
if (!title.equals("Nexus ArmorStand Editor") &&
|
if (!title.equals("Nexus ArmorStand Editor") &&
|
||||||
!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;
|
||||||
@@ -136,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("§8[§6Nexus§8] §7Gib den neuen §eNamen §7in den Chat ein. §8(&-Farb-Codes erlaubt)");
|
||||||
|
player.sendMessage("§8[§6Nexus§8] §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("§8[§6Nexus§8] §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("§8[§6Nexus§8] §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());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,9 +51,9 @@ 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
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -50,6 +52,14 @@ public class ConversationManager {
|
|||||||
* zu breit und hätte auch legitime Marker-ArmorStands anderer Systeme gelöscht.
|
* 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)) {
|
||||||
@@ -228,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 ---
|
||||||
@@ -275,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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.SkullMeta;
|
import org.bukkit.inventory.meta.SkullMeta;
|
||||||
import org.bukkit.profile.PlayerProfile;
|
import org.bukkit.profile.PlayerProfile;
|
||||||
@@ -47,6 +48,9 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
private static final double VOID_THRESHOLD = -5.0;
|
private static final double VOID_THRESHOLD = -5.0;
|
||||||
private static final double CLEANUP_RADIUS = 5.0;
|
private static final double CLEANUP_RADIUS = 5.0;
|
||||||
|
|
||||||
|
// Verhindert dass Dribbling einen Kick sofort überschreibt.
|
||||||
|
private static final long KICK_DRIBBLE_LOCK_MS = 300L;
|
||||||
|
|
||||||
private static final double PARTICLE_SPEED_HIGH = 0.85;
|
private static final double PARTICLE_SPEED_HIGH = 0.85;
|
||||||
private static final double PARTICLE_SPEED_MEDIUM = 0.45;
|
private static final double PARTICLE_SPEED_MEDIUM = 0.45;
|
||||||
private static final double PARTICLE_SPEED_MIN = 0.05;
|
private static final double PARTICLE_SPEED_MIN = 0.05;
|
||||||
@@ -70,6 +74,7 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
private Location spawnLocation;
|
private Location spawnLocation;
|
||||||
private long lastMoveTime;
|
private long lastMoveTime;
|
||||||
private long lastGoalTime = 0L;
|
private long lastGoalTime = 0L;
|
||||||
|
private long lastKickTime = 0L;
|
||||||
|
|
||||||
// ── Tor-Erkennung: Position aus dem VORHERIGEN Tick ───────────────────────
|
// ── Tor-Erkennung: Position aus dem VORHERIGEN Tick ───────────────────────
|
||||||
//
|
//
|
||||||
@@ -134,12 +139,11 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
handleDribbling();
|
handleDribbling();
|
||||||
|
|
||||||
// ── SCHRITT 3: Nach Physik die neue Position lesen ─────────────────
|
// ── SCHRITT 3: Nach Physik die neue Position lesen ─────────────────
|
||||||
// Minecraft hat jetzt die Position um vel verschoben.
|
// Minecraft wendet nach setVelocity noch Drag (0.98 horizontal, Gravity ~0.08
|
||||||
// Da getLocation() einen Tick verzögert ist, lesen wir hier noch
|
// + 0.98 vertikal) an. Wir approximieren: newPos = currentPos + vel * 0.98
|
||||||
// currentPos – aber über den Velocity-Vektor wissen wir die neue Pos.
|
// Das ist deutlich genauer als currentPos + vel und vermeidet 1-Tick-Versatz
|
||||||
// Wir nutzen deshalb: newPos = currentPos + velocity (vor Drag)
|
// bei der Tor-Erkennung nach schnellen Kicks.
|
||||||
// Das ist die tatsächliche neue Ballposition nach diesem Tick.
|
Location newPos = currentPos.clone().add(vel.clone().multiply(0.98));
|
||||||
Location newPos = currentPos.clone().add(vel);
|
|
||||||
|
|
||||||
// ── SCHRITT 4: Segment prüfen ─────────────────────────────────────
|
// ── SCHRITT 4: Segment prüfen ─────────────────────────────────────
|
||||||
// Das Segment prevPos → newPos deckt den vollständigen Weg ab den
|
// Das Segment prevPos → newPos deckt den vollständigen Weg ab den
|
||||||
@@ -277,6 +281,7 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
|
|
||||||
private void handleDribbling() {
|
private void handleDribbling() {
|
||||||
if (ball == null || !ball.isValid()) return;
|
if (ball == null || !ball.isValid()) return;
|
||||||
|
if (System.currentTimeMillis() - lastKickTime < KICK_DRIBBLE_LOCK_MS) return;
|
||||||
for (Entity nearby : ball.getNearbyEntities(DRIBBLE_DETECTION_RADIUS, DRIBBLE_HEIGHT, DRIBBLE_DETECTION_RADIUS)) {
|
for (Entity nearby : ball.getNearbyEntities(DRIBBLE_DETECTION_RADIUS, DRIBBLE_HEIGHT, DRIBBLE_DETECTION_RADIUS)) {
|
||||||
if (nearby instanceof Player player) {
|
if (nearby instanceof Player player) {
|
||||||
Vector dir = ball.getLocation().toVector().subtract(player.getLocation().toVector());
|
Vector dir = ball.getLocation().toVector().subtract(player.getLocation().toVector());
|
||||||
@@ -290,8 +295,16 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleWallBounce(Vector vel) {
|
private void handleWallBounce(Vector vel) {
|
||||||
if (vel.lengthSquared() < 0.001) return;
|
// Nur prüfen wenn genug horizontale Bewegung vorhanden ist.
|
||||||
|
// Y-Komponente absichtlich ignoriert – der Bounce gilt nur für Wände (X/Z),
|
||||||
|
// nicht für Boden/Decke. So verhindert man dass liegende Boden-Blöcke
|
||||||
|
// fälschlicherweise als Wand erkannt werden und den Ball dauerhaft blockieren.
|
||||||
|
double hSpeed = vel.getX() * vel.getX() + vel.getZ() * vel.getZ();
|
||||||
|
if (hSpeed < 0.001) return;
|
||||||
|
|
||||||
Location loc = ball.getLocation();
|
Location loc = ball.getLocation();
|
||||||
|
// Y + 0.5 anheben damit wir auf Wand-Höhe prüfen, nicht auf Boden-Ebene.
|
||||||
|
// Ohne den Offset würde loc.getY() (Boden des ArmorStands) den Bodenblock selbst treffen.
|
||||||
Block nx = loc.clone().add(vel.getX() * WALL_CHECK_DISTANCE, 0.5, 0).getBlock();
|
Block nx = loc.clone().add(vel.getX() * WALL_CHECK_DISTANCE, 0.5, 0).getBlock();
|
||||||
Block nz = loc.clone().add(0, 0.5, vel.getZ() * WALL_CHECK_DISTANCE).getBlock();
|
Block nz = loc.clone().add(0, 0.5, vel.getZ() * WALL_CHECK_DISTANCE).getBlock();
|
||||||
boolean bounced = false;
|
boolean bounced = false;
|
||||||
@@ -437,7 +450,7 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
ball.setInvisible(true); ball.setGravity(true); ball.setBasePlate(false);
|
ball.setInvisible(true); ball.setGravity(true); ball.setBasePlate(false);
|
||||||
ball.setSmall(true); ball.setInvulnerable(false); ball.setArms(false);
|
ball.setSmall(true); ball.setInvulnerable(false); ball.setArms(false);
|
||||||
ball.setCustomNameVisible(false); ball.setCustomName(BALL_NAME);
|
ball.setCustomNameVisible(false); ball.setCustomName(BALL_NAME);
|
||||||
ball.setPersistent(false); ball.addScoreboardTag(BALL_TAG);
|
ball.setPersistent(true); ball.addScoreboardTag(BALL_TAG);
|
||||||
if (ball.getEquipment() != null) ball.getEquipment().setHelmet(getSoccerHead());
|
if (ball.getEquipment() != null) ball.getEquipment().setHelmet(getSoccerHead());
|
||||||
prevPos = spawnLocation.clone();
|
prevPos = spawnLocation.clone();
|
||||||
lastMoveTime = System.currentTimeMillis();
|
lastMoveTime = System.currentTimeMillis();
|
||||||
@@ -531,6 +544,7 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
// prevPos auf aktuelle Position setzen bevor der Ball sich bewegt –
|
// prevPos auf aktuelle Position setzen bevor der Ball sich bewegt –
|
||||||
// so startet das nächste Segment am richtigen Punkt.
|
// so startet das nächste Segment am richtigen Punkt.
|
||||||
prevPos = ball.getLocation().clone();
|
prevPos = ball.getLocation().clone();
|
||||||
|
lastKickTime = System.currentTimeMillis();
|
||||||
ball.setVelocity(dir);
|
ball.setVelocity(dir);
|
||||||
|
|
||||||
ball.getWorld().playSound(ball.getLocation(), Sound.ENTITY_ZOMBIE_ATTACK_IRON_DOOR, 0.6f, 1.5f);
|
ball.getWorld().playSound(ball.getLocation(), Sound.ENTITY_ZOMBIE_ATTACK_IRON_DOOR, 0.6f, 1.5f);
|
||||||
@@ -542,6 +556,45 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
if (ball != null && event.getRightClicked().equals(ball)) event.setCancelled(true);
|
if (ball != null && event.getRightClicked().equals(ball)) event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
|
// Wenn ein Spieler joinт: Ball-State prüfen und ggf. resynchronisieren.
|
||||||
|
// Passiert z.B. nach Server-Wechsel via BungeeCord: der Chunk wird neu geladen,
|
||||||
|
// alte Ball-Entities tauchen wieder auf, die interne Referenz zeigt evtl. auf
|
||||||
|
// die falsche oder eine ungültige Instanz.
|
||||||
|
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), () -> {
|
||||||
|
if (spawnLocation == null || spawnLocation.getWorld() == null) return;
|
||||||
|
|
||||||
|
// Alle alten nexusball-Entities in der Welt suchen
|
||||||
|
boolean foundValid = false;
|
||||||
|
for (Entity e : spawnLocation.getWorld().getEntities()) {
|
||||||
|
if (!(e instanceof ArmorStand as)) continue;
|
||||||
|
if (!isBallEntity(as)) continue;
|
||||||
|
|
||||||
|
if (ball != null && ball.isValid() && as.getUniqueId().equals(ball.getUniqueId())) {
|
||||||
|
// Referenz ist noch korrekt und gültig – alles gut
|
||||||
|
foundValid = true;
|
||||||
|
} else if (ball == null || !ball.isValid()) {
|
||||||
|
// Unsere Referenz ist verloren – die gefundene Entity übernehmen
|
||||||
|
ball = as;
|
||||||
|
prevPos = as.getLocation().clone();
|
||||||
|
lastMoveTime = System.currentTimeMillis();
|
||||||
|
foundValid = true;
|
||||||
|
Bukkit.getLogger().info("[Soccer] Ball-Referenz nach Join wiederhergestellt.");
|
||||||
|
} else {
|
||||||
|
// Duplikat – entfernen
|
||||||
|
as.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!foundValid) {
|
||||||
|
// Kein Ball in der Welt – neu spawnen
|
||||||
|
respawnBall();
|
||||||
|
Bukkit.getLogger().info("[Soccer] Ball nach Join neu gespawnt.");
|
||||||
|
}
|
||||||
|
}, 20L); // 1s warten damit der Chunk sicher geladen ist
|
||||||
|
}
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// COMMANDS
|
// COMMANDS
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|||||||
@@ -1,79 +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);
|
|
||||||
// Tag damit GadgetModule Rechtsklicks auf den Ballon abfangen kann
|
|
||||||
this.balloonEntity.addScoreboardTag("nexus_balloon");
|
|
||||||
|
|
||||||
// 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.)
|
|
||||||
this.headStand.setHelmet(new ItemStack(balloonMaterial));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void update() {
|
if (this.headStand != null) {
|
||||||
Player player = org.bukkit.Bukkit.getPlayer(playerUUID);
|
this.headStand.remove();
|
||||||
|
}
|
||||||
|
|
||||||
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,54 +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());
|
||||||
|
|
||||||
// FIX: Verhindert, dass ein Spieler den Regen mehrfach gleichzeitig starten kann.
|
public static void start(final Player player) {
|
||||||
// Ohne diese Prüfung konnten beliebig viele parallele Tasks gestartet werden,
|
if (!activeRains.contains(player.getUniqueId())) {
|
||||||
// was zu hunderten gespawnten Entities in Sekunden führte.
|
activeRains.add(player.getUniqueId());
|
||||||
private static final java.util.Set<java.util.UUID> activeRains =
|
(new BukkitRunnable() {
|
||||||
java.util.Collections.synchronizedSet(new java.util.HashSet<>());
|
|
||||||
|
|
||||||
public static void start(Player player) {
|
|
||||||
if (activeRains.contains(player.getUniqueId())) return; // bereits aktiv
|
|
||||||
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) {
|
||||||
activeRains.remove(player.getUniqueId());
|
if (this.ticks % 2 == 0) {
|
||||||
this.cancel();
|
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);
|
||||||
return;
|
Chicken chicken = (Chicken)spawnLoc.getWorld().spawnEntity(spawnLoc, EntityType.CHICKEN);
|
||||||
}
|
chicken.setBaby();
|
||||||
|
chicken.setInvulnerable(true);
|
||||||
// Alle 2 Ticks ein Huhn spawnen
|
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), () -> {
|
||||||
if (ticks % 2 == 0) {
|
|
||||||
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,104 +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 {
|
||||||
|
private static final Set<UUID> frozenPlayers = new HashSet();
|
||||||
|
|
||||||
private static final Set<UUID> frozenPlayers = new HashSet<>();
|
public static boolean isFrozen(UUID uuid) {
|
||||||
|
return frozenPlayers.contains(uuid);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isFrozen(UUID uuid) { return frozenPlayers.contains(uuid); }
|
public static void unfreeze(UUID uuid) {
|
||||||
|
frozenPlayers.remove(uuid);
|
||||||
|
}
|
||||||
|
|
||||||
/** Beim Disconnect aufrufen, damit kein Ghost-Eintrag bleibt. */
|
public static void shoot(Player shooter) {
|
||||||
public static void unfreeze(UUID uuid) { frozenPlayers.remove(uuid); }
|
Location start = shooter.getEyeLocation();
|
||||||
|
Vector direction = start.getDirection();
|
||||||
|
shooter.getWorld().playSound(start, Sound.ENTITY_SNOW_GOLEM_SHOOT, 1.0F, 1.5F);
|
||||||
|
|
||||||
public static void shoot(Player shooter) {
|
for(double d = (double)0.0F; d < (double)15.0F; d += 0.3) {
|
||||||
Location start = shooter.getEyeLocation();
|
Location point = start.clone().add(direction.clone().multiply(d));
|
||||||
Vector direction = start.getDirection();
|
point.getWorld().spawnParticle(Particle.SNOWFLAKE, point, 1, (double)0.0F, (double)0.0F, (double)0.0F, (double)0.0F);
|
||||||
|
|
||||||
shooter.getWorld().playSound(start, Sound.ENTITY_SNOW_GOLEM_SHOOT, 1.0f, 1.5f);
|
for(Entity entity : point.getWorld().getNearbyEntities(point, 0.8, 0.8, 0.8)) {
|
||||||
|
if (entity instanceof Player target) {
|
||||||
|
if (target != shooter) {
|
||||||
|
if (GadgetShield.isProtected(target)) {
|
||||||
|
String reason = GadgetShield.isAdminShielded(target) ? "Dieser Spieler hat Gadget-Schutz aktiviert." : "Dieser Spieler ist gerade im Parkour.";
|
||||||
|
shooter.sendMessage("§8[§6Nexus§8] §7" + reason);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (double d = 0; d < 15; d += 0.3) {
|
applyFreeze(target);
|
||||||
Location point = start.clone().add(direction.clone().multiply(d));
|
return;
|
||||||
|
}
|
||||||
point.getWorld().spawnParticle(Particle.SNOWFLAKE, point, 1, 0, 0, 0, 0);
|
|
||||||
|
|
||||||
for (Entity entity : point.getWorld().getNearbyEntities(point, 0.8, 0.8, 0.8)) {
|
|
||||||
if (entity instanceof Player target && target != shooter) {
|
|
||||||
// Schutz: Parkour-Spieler und Admins mit aktivem Gadget-Schutz
|
|
||||||
if (GadgetShield.isProtected(target)) {
|
|
||||||
String reason = GadgetShield.isAdminShielded(target)
|
|
||||||
? "Dieser Spieler hat Gadget-Schutz aktiviert."
|
|
||||||
: "Dieser Spieler ist gerade im Parkour.";
|
|
||||||
shooter.sendMessage("§8[§6Nexus§8] §7" + reason);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
applyFreeze(target);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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) {
|
||||||
final Location freezeLocation = target.getLocation();
|
if (!frozenPlayers.contains(target.getUniqueId())) {
|
||||||
|
frozenPlayers.add(target.getUniqueId());
|
||||||
target.sendMessage("§8[§6Nexus§8] §bDu wurdest eingefroren!");
|
final Location freezeLocation = target.getLocation();
|
||||||
target.getWorld().playSound(target.getLocation(), Sound.BLOCK_GLASS_BREAK, 1.0f, 0.5f);
|
target.sendMessage("§8[§6Nexus§8] §bDu wurdest eingefroren!");
|
||||||
|
target.getWorld().playSound(target.getLocation(), Sound.BLOCK_GLASS_BREAK, 1.0F, 0.5F);
|
||||||
new org.bukkit.scheduler.BukkitRunnable() {
|
(new BukkitRunnable() {
|
||||||
int ticks = 0;
|
int ticks = 0;
|
||||||
@Override
|
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!target.isOnline() || ticks >= 60) {
|
if (target.isOnline() && this.ticks < 60) {
|
||||||
frozenPlayers.remove(target.getUniqueId());
|
if (GadgetShield.isProtected(target)) {
|
||||||
this.cancel();
|
FreezeRay.frozenPlayers.remove(target.getUniqueId());
|
||||||
return;
|
this.cancel();
|
||||||
}
|
} 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);
|
||||||
|
}
|
||||||
|
|
||||||
// Falls der Spieler während des Einfrierens geschützt wird → sofort freigeben
|
Location loc = target.getLocation();
|
||||||
if (GadgetShield.isProtected(target)) {
|
|
||||||
frozenPlayers.remove(target.getUniqueId());
|
|
||||||
this.cancel();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
target.setVelocity(new Vector(0, 0, 0));
|
for(int i = 0; i < 8; ++i) {
|
||||||
|
double angle = (double)i * Math.PI / (double)4.0F;
|
||||||
|
double x = Math.cos(angle) * 0.7;
|
||||||
|
double z = Math.sin(angle) * 0.7;
|
||||||
|
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);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
Location current = target.getLocation();
|
this.ticks += 2;
|
||||||
if (current.getX() != freezeLocation.getX() || current.getZ() != freezeLocation.getZ()) {
|
}
|
||||||
freezeLocation.setYaw(current.getYaw());
|
} else {
|
||||||
freezeLocation.setPitch(current.getPitch());
|
FreezeRay.frozenPlayers.remove(target.getUniqueId());
|
||||||
target.teleport(freezeLocation);
|
this.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
Location loc = target.getLocation();
|
|
||||||
for (int i = 0; i < 8; i++) {
|
|
||||||
double angle = i * Math.PI / 4;
|
|
||||||
double x = Math.cos(angle) * 0.7;
|
|
||||||
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
@@ -2,58 +2,44 @@ package de.nexuslobby.modules.gadgets;
|
|||||||
|
|
||||||
import de.nexuslobby.NexusLobby;
|
import de.nexuslobby.NexusLobby;
|
||||||
import de.nexuslobby.modules.parkour.ParkourManager;
|
import de.nexuslobby.modules.parkour.ParkourManager;
|
||||||
import org.bukkit.Sound;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
/**
|
|
||||||
* Verwaltet den Gadget-Schutz für Admins und Parkour-Spieler.
|
|
||||||
* Eigenständige Klasse – kein Eingriff in GadgetModule nötig.
|
|
||||||
*/
|
|
||||||
public class GadgetShield {
|
public class GadgetShield {
|
||||||
|
private static final Set<UUID> shielded = new HashSet();
|
||||||
|
|
||||||
/** UUIDs der Admins, die ihren Gadget-Schutz aktiviert haben */
|
public static boolean toggle(Player player) {
|
||||||
private static final Set<UUID> shielded = new HashSet<>();
|
UUID uuid = player.getUniqueId();
|
||||||
|
if (shielded.contains(uuid)) {
|
||||||
|
shielded.remove(uuid);
|
||||||
|
player.sendMessage("§8[§6Nexus§8] §cGadget-Schutz §7deaktiviert.");
|
||||||
|
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_BASS, 1.0F, 1.0F);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
shielded.add(uuid);
|
||||||
|
player.sendMessage("§8[§6Nexus§8] §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) {
|
||||||
* Schaltet den Gadget-Schutz ein oder aus.
|
return shielded.contains(player.getUniqueId());
|
||||||
* Gibt true zurück wenn der Schutz jetzt aktiv ist.
|
}
|
||||||
*/
|
|
||||||
public static boolean toggle(Player player) {
|
|
||||||
UUID uuid = player.getUniqueId();
|
|
||||||
if (shielded.contains(uuid)) {
|
|
||||||
shielded.remove(uuid);
|
|
||||||
player.sendMessage("§8[§6Nexus§8] §cGadget-Schutz §7deaktiviert.");
|
|
||||||
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_BASS, 1f, 1f);
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
shielded.add(uuid);
|
|
||||||
player.sendMessage("§8[§6Nexus§8] §aGadget-Schutz §7aktiviert. §8Du bist nun immun gegen Gadgets.");
|
|
||||||
player.playSound(player.getLocation(), Sound.BLOCK_AMETHYST_BLOCK_CHIME, 1f, 1.5f);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Gibt zurück ob ein Spieler explizit durch den Admin-Schutz geschützt ist. */
|
public static boolean isProtected(Player player) {
|
||||||
public static boolean isAdminShielded(Player player) {
|
if (shielded.contains(player.getUniqueId())) {
|
||||||
return shielded.contains(player.getUniqueId());
|
return true;
|
||||||
}
|
} else {
|
||||||
|
ParkourManager pm = NexusLobby.getInstance().getParkourManager();
|
||||||
|
return pm != null && pm.isIngame(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
public static void clear() {
|
||||||
* Gibt zurück ob ein Spieler durch irgendeinen Schutz immun gegen Gadgets ist
|
shielded.clear();
|
||||||
* (Admin-Schutz ODER aktiver Parkour-Run).
|
}
|
||||||
*/
|
}
|
||||||
public static boolean isProtected(Player player) {
|
|
||||||
if (shielded.contains(player.getUniqueId())) return true;
|
|
||||||
ParkourManager pm = NexusLobby.getInstance().getParkourManager();
|
|
||||||
return pm != null && pm.isIngame(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Beim Server-Stop / Plugin-Disable aufrufen */
|
|
||||||
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("§8[§6Nexus§8] §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
|
|
||||||
player.getInventory().setHelmet(hat);
|
|
||||||
player.sendMessage("§8[§6Nexus§8] §aDu trägst nun: " + name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void removeHat(Player player) {
|
public static void removeHat(Player player) {
|
||||||
player.getInventory().setHelmet(null);
|
player.getInventory().setHelmet((ItemStack)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,51 +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("§8[§6Nexus§8] §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(), () -> {
|
|
||||||
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) {
|
||||||
// Schutz: Admins mit Gadget-Schutz und Parkour-Spieler werden nicht weggeschleudert
|
if (GadgetShield.isProtected(p)) {
|
||||||
if (GadgetShield.isProtected(p)) {
|
if (GadgetShield.isAdminShielded(p)) {
|
||||||
if (GadgetShield.isAdminShielded(p)) {
|
p.sendMessage("§8[§6Nexus§8] §7Dein Gadget-Schutzschild hat den Meteoriten abgelenkt!");
|
||||||
p.sendMessage("§8[§6Nexus§8] §7Dein Gadget-Schutzschild hat den Meteoriten abgelenkt!");
|
} else {
|
||||||
} else {
|
p.sendMessage("§8[§6Parkour§8] §7Dein Parkour-Schutzschild hat den Meteoriten abgelenkt!");
|
||||||
p.sendMessage("§8[§6Parkour§8] §7Dein Parkour-Schutzschild hat den Meteoriten abgelenkt!");
|
}
|
||||||
}
|
} else {
|
||||||
continue;
|
Vector v = p.getLocation().toVector().subtract(finalTarget.toVector()).normalize().multiply((double)1.5F).setY((double)0.5F);
|
||||||
}
|
p.setVelocity(v);
|
||||||
Vector v = p.getLocation().toVector()
|
p.sendMessage("§cBUMM!");
|
||||||
.subtract(finalTarget.toVector())
|
}
|
||||||
.normalize()
|
}
|
||||||
.multiply(1.5)
|
|
||||||
.setY(0.5);
|
|
||||||
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
|
|
||||||
private static final Material[] COLORS = {
|
|
||||||
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
|
|
||||||
};
|
|
||||||
|
|
||||||
public static void shoot(Player shooter) {
|
public static void shoot(Player shooter) {
|
||||||
Location start = shooter.getEyeLocation();
|
Location start = shooter.getEyeLocation();
|
||||||
Vector direction = start.getDirection();
|
Vector direction = start.getDirection();
|
||||||
Material randomColor = COLORS[random.nextInt(COLORS.length)];
|
Material randomColor = COLORS[random.nextInt(COLORS.length)];
|
||||||
|
shooter.getWorld().playSound(start, Sound.ENTITY_CHICKEN_EGG, 1.0F, 2.0F);
|
||||||
|
|
||||||
shooter.getWorld().playSound(start, Sound.ENTITY_CHICKEN_EGG, 1.0f, 2.0f);
|
for(double d = (double)0.0F; d < (double)25.0F; d += (double)0.5F) {
|
||||||
|
Location point = start.clone().add(direction.clone().multiply(d));
|
||||||
|
point.getWorld().spawnParticle(Particle.ITEM_SNOWBALL, point, 1, (double)0.0F, (double)0.0F, (double)0.0F, (double)0.0F);
|
||||||
|
Block block = point.getBlock();
|
||||||
|
if (block.getType().isSolid()) {
|
||||||
|
impact(block, randomColor);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (double d = 0; d < 25; d += 0.5) {
|
}
|
||||||
Location point = start.clone().add(direction.clone().multiply(d));
|
|
||||||
|
|
||||||
// Flug-Partikel (kleiner Rauch oder Schneeball)
|
|
||||||
point.getWorld().spawnParticle(Particle.ITEM_SNOWBALL, point, 1, 0, 0, 0, 0);
|
|
||||||
|
|
||||||
Block block = point.getBlock();
|
private static void impact(Block centerBlock, Material color) {
|
||||||
if (block.getType().isSolid()) {
|
Location centerLoc = centerBlock.getLocation();
|
||||||
impact(block, randomColor);
|
centerLoc.getWorld().playSound(centerLoc, Sound.ENTITY_SLIME_SQUISH, 1.0F, 1.2F);
|
||||||
break;
|
int radius = 2;
|
||||||
|
|
||||||
|
for(int x = -radius; x <= radius; ++x) {
|
||||||
|
for(int y = -radius; y <= radius; ++y) {
|
||||||
|
for(int z = -radius; z <= radius; ++z) {
|
||||||
|
if ((double)(x * x + y * y + z * z) <= (double)(radius * radius) + (double)0.5F) {
|
||||||
|
Block target = centerLoc.clone().add((double)x, (double)y, (double)z).getBlock();
|
||||||
|
if (target.getType().isSolid()) {
|
||||||
|
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
|
|
||||||
|
|
||||||
// Wir gehen alle Blöcke im Würfel um den Einschlag durch
|
private static void applyColor(Block block, Material color) {
|
||||||
for (int x = -radius; x <= radius; x++) {
|
Location loc = block.getLocation();
|
||||||
for (int y = -radius; y <= radius; y++) {
|
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());
|
||||||
for (int z = -radius; z <= radius; z++) {
|
|
||||||
|
|
||||||
// Berechne Distanz für eine Kugelform (statt Würfel)
|
|
||||||
if (x * x + y * y + z * z <= radius * radius + 0.5) {
|
|
||||||
Block target = centerLoc.clone().add(x, y, z).getBlock();
|
|
||||||
|
|
||||||
// Nur solide Blöcke färben (keine Luft/Gras)
|
|
||||||
if (target.getType().isSolid()) {
|
|
||||||
applyColor(target, color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void applyColor(Block block, Material color) {
|
for(Player online : Bukkit.getOnlinePlayers()) {
|
||||||
Location loc = block.getLocation();
|
online.sendBlockChange(loc, color.createBlockData());
|
||||||
|
}
|
||||||
// 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
|
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), () -> {
|
||||||
for (Player online : Bukkit.getOnlinePlayers()) {
|
for(Player online : Bukkit.getOnlinePlayers()) {
|
||||||
online.sendBlockChange(loc, color.createBlockData());
|
online.sendBlockChange(loc, block.getBlockData());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Nach 10 Sekunden zurücksetzen
|
}, 400L);
|
||||||
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), () -> {
|
}
|
||||||
for (Player online : Bukkit.getOnlinePlayers()) {
|
|
||||||
online.sendBlockChange(loc, block.getBlockData());
|
static {
|
||||||
}
|
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};
|
||||||
}, 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,158 +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());
|
||||||
|
}
|
||||||
|
|
||||||
// Singleton-Instanz, damit registerEvents() nur einmal aufgerufen wird
|
public static void register() {
|
||||||
private static PetManager instance;
|
if (instance == null) {
|
||||||
|
instance = new PetManager();
|
||||||
|
}
|
||||||
|
|
||||||
public PetManager() {
|
}
|
||||||
Bukkit.getPluginManager().registerEvents(this, NexusLobby.getInstance());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
public static void unregister() {
|
||||||
* Registriert den PetManager als Listener, falls noch nicht geschehen.
|
if (instance != null) {
|
||||||
* Muss einmalig beim Plugin-Start aufgerufen werden (z.B. aus GadgetModule.onEnable).
|
HandlerList.unregisterAll(instance);
|
||||||
*/
|
instance = null;
|
||||||
public static void register() {
|
}
|
||||||
if (instance == null) {
|
|
||||||
instance = new PetManager();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void unregister() {
|
}
|
||||||
if (instance != null) {
|
|
||||||
org.bukkit.event.HandlerList.unregisterAll(instance);
|
|
||||||
instance = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
public static void spawnEntityPet(Player player, String type) {
|
||||||
* Spawnt ein echtes Tier-Entity für den Spieler.
|
spawnEntityPet(player, type, false);
|
||||||
*/
|
}
|
||||||
public static void spawnEntityPet(Player player, String type) {
|
|
||||||
removePet(player);
|
|
||||||
|
|
||||||
EntityType entityType;
|
public static void spawnEntityPet(Player player, String type, boolean baby) {
|
||||||
try {
|
spawnEntityPet(player, type, baby, (String)null);
|
||||||
entityType = EntityType.valueOf(type);
|
}
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
player.sendMessage("§cFehler: Tier-Typ nicht gefunden.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Location loc = player.getLocation();
|
public static void spawnEntityPet(Player player, String type, boolean baby, String variantName) {
|
||||||
Entity pet = player.getWorld().spawnEntity(loc, entityType);
|
removePet(player);
|
||||||
|
|
||||||
pet.setCustomName("§d" + player.getName() + "'s " + capitalize(type.toLowerCase()));
|
EntityType entityType;
|
||||||
pet.setCustomNameVisible(true);
|
try {
|
||||||
pet.setInvulnerable(true);
|
entityType = EntityType.valueOf(type);
|
||||||
pet.setPersistent(false);
|
} catch (IllegalArgumentException var12) {
|
||||||
|
player.sendMessage("§cFehler: Tier-Typ nicht gefunden.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (pet instanceof LivingEntity) {
|
Location loc = player.getLocation();
|
||||||
LivingEntity le = (LivingEntity) pet;
|
Entity pet = player.getWorld().spawnEntity(loc, entityType);
|
||||||
le.setRemoveWhenFarAway(false);
|
String agePrefix = baby ? "§bBaby " : "";
|
||||||
|
String petName = buildPetDisplayName(type, variantName);
|
||||||
// Verhindert, dass das Pet andere angreift
|
pet.setCustomName(agePrefix + petName);
|
||||||
if (le instanceof Tameable) {
|
pet.setCustomNameVisible(true);
|
||||||
((Tameable) le).setTamed(true);
|
pet.setInvulnerable(true);
|
||||||
((Tameable) le).setOwner(player);
|
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
|
|
||||||
Location lookAt = pet.getLocation();
|
|
||||||
lookAt.setDirection(owner.getLocation().toVector().subtract(pet.getLocation().toVector()));
|
|
||||||
pet.teleport(lookAt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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 onPetTarget(EntityTargetEvent event) {
|
||||||
pet.remove();
|
if (activePets.containsValue(event.getEntity())) {
|
||||||
}
|
event.setCancelled(true);
|
||||||
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 onQuit(PlayerQuitEvent event) {
|
||||||
@EventHandler
|
removePet(event.getPlayer());
|
||||||
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,53 +1,41 @@
|
|||||||
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;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
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) {
|
||||||
* Cooldown: Ein Spieler darf nur alle 3 Sekunden weggedrückt werden.
|
for(double i = (double)0.0F; i < (Math.PI * 2D); i += (Math.PI / 8D)) {
|
||||||
* Verhindert das permanente "Kleben" am Schutzschild-Träger.
|
double x = Math.cos(i) * 2.2;
|
||||||
*/
|
double z = Math.sin(i) * 2.2;
|
||||||
private static final Map<UUID, Long> pushCooldowns = new HashMap<>();
|
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);
|
||||||
private static final long PUSH_COOLDOWN_MS = 3_000L;
|
}
|
||||||
|
|
||||||
public static void handleShield(Player owner) {
|
long now = System.currentTimeMillis();
|
||||||
// Erzeuge einen Partikel-Ring um den Spieler
|
|
||||||
for (double i = 0; i < Math.PI * 2; i += Math.PI / 8) {
|
|
||||||
double x = Math.cos(i) * 2.2;
|
|
||||||
double z = Math.sin(i) * 2.2;
|
|
||||||
owner.getWorld().spawnParticle(Particle.WITCH, owner.getLocation().add(x, 0.5, z), 1, 0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
long now = System.currentTimeMillis();
|
for(Entity entity : owner.getNearbyEntities(2.2, (double)2.0F, 2.2)) {
|
||||||
|
if (entity instanceof Player target) {
|
||||||
|
if (entity != owner && !GadgetShield.isProtected(target)) {
|
||||||
|
long lastPush = (Long)pushCooldowns.getOrDefault(target.getUniqueId(), 0L);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Stoße andere Spieler weg
|
}
|
||||||
for (Entity entity : owner.getNearbyEntities(2.2, 2.0, 2.2)) {
|
}
|
||||||
if (!(entity instanceof Player target) || entity == owner) continue;
|
|
||||||
|
|
||||||
// FIX: OP-Admins mit aktivem Gadget-Schutz und Parkour-Spieler sind immun
|
|
||||||
if (GadgetShield.isProtected(target)) continue;
|
|
||||||
|
|
||||||
// FIX: 3-Sekunden-Cooldown – jedes Ziel wird max. 1x alle 3s weggedrückt
|
|
||||||
long lastPush = pushCooldowns.getOrDefault(target.getUniqueId(), 0L);
|
|
||||||
if (now - lastPush < PUSH_COOLDOWN_MS) continue;
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ public class HoloCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
module.removeHologram(args[1]);
|
module.removeHologram(args[1]);
|
||||||
player.sendMessage("§8[§6Nexus§8] §cHologramm §e" + args[1] + " §agelöscht.");
|
player.sendMessage("§8[§6Nexus§8] §cHologramm §e" + args[1] + " §agelöscht.");
|
||||||
|
}
|
||||||
|
else if (args[0].equalsIgnoreCase("reload")) {
|
||||||
|
module.reloadHolograms();
|
||||||
|
player.sendMessage("§8[§6Nexus§8] §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
|
||||||
} catch (IOException e) {
|
// 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) {
|
||||||
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
|
||||||
|
|||||||
@@ -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,7 +52,7 @@ 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
|
||||||
@@ -53,30 +61,79 @@ public class IntroModule implements Module, Listener, CommandExecutor {
|
|||||||
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
|
||||||
try {
|
config.set("end-title", endTitle);
|
||||||
config.save(configFile);
|
config.set("end-subtitle", endSubtitle);
|
||||||
} catch (IOException e) {
|
|
||||||
|
// 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 {
|
||||||
|
config.save(configFile);
|
||||||
|
} catch (IOException e) {
|
||||||
NexusLobby.getInstance().getLogger().severe("Fehler beim Speichern der Intro-Config: " + e.getMessage());
|
NexusLobby.getInstance().getLogger().severe("Fehler beim Speichern der Intro-Config: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
// 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) {
|
||||||
@@ -84,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) {
|
||||||
@@ -97,26 +151,52 @@ 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("§8[§6Nexus§8] §aPunkt §e#" + points.size() + " §awurde gesetzt.");
|
||||||
|
} else {
|
||||||
|
p.sendMessage("§8[§6Nexus§8] §aPunkt §e#" + points.size() + " §amit Text §e\"" + pointLabel + "\" §agesetzt.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case "clear" -> {
|
case "clear" -> {
|
||||||
points.clear();
|
points.clear();
|
||||||
savePoints();
|
labels.clear();
|
||||||
|
saveConfig();
|
||||||
p.sendMessage("§8[§6Nexus§8] §cAlle Intro-Punkte wurden gelöscht.");
|
p.sendMessage("§8[§6Nexus§8] §cAlle Intro-Punkte wurden gelöscht.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "list" -> {
|
||||||
|
if (points.isEmpty()) {
|
||||||
|
p.sendMessage("§8[§6Nexus§8] §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("§8[§6Nexus§8] §cDu brauchst mindestens 2 Punkte für eine Fahrt.");
|
||||||
@@ -124,18 +204,69 @@ public class IntroModule implements Module, Listener, CommandExecutor {
|
|||||||
startIntro(p);
|
startIntro(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /intro setendtitle <Text> — setzt den großen Abschluss-Titel
|
||||||
|
case "setendtitle" -> {
|
||||||
|
if (args.length < 2) {
|
||||||
|
p.sendMessage("§8[§6Nexus§8] §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("§8[§6Nexus§8] §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("§8[§6Nexus§8] §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("§8[§6Nexus§8] §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() {
|
||||||
@@ -146,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
|
|
||||||
double smoothT = progress * progress * (3 - 2 * progress);
|
player.teleport(interpolate(start, end, smoothT));
|
||||||
|
|
||||||
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 endYaw = end.getYaw();
|
|
||||||
// Verhindert ruckartige 360-Grad Dreher
|
|
||||||
float diff = (endYaw - startYaw) % 360;
|
|
||||||
if (diff > 180) diff -= 360;
|
|
||||||
if (diff < -180) diff += 360;
|
|
||||||
float yaw = startYaw + diff * (float)t;
|
|
||||||
|
|
||||||
|
float startYaw = start.getYaw();
|
||||||
|
float endYaw = end.getYaw();
|
||||||
|
float diff = (endYaw - startYaw) % 360;
|
||||||
|
if (diff > 180) diff -= 360;
|
||||||
|
if (diff < -180) diff += 360;
|
||||||
|
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("&", "§");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,9 @@ public class ParkourListener implements Listener {
|
|||||||
Location loc = player.getLocation();
|
Location loc = player.getLocation();
|
||||||
|
|
||||||
// --- 1. ABSTURZ-CHECK ---
|
// --- 1. ABSTURZ-CHECK ---
|
||||||
if (loc.getY() < 50) {
|
// Absturz-Y aus config lesen (Standard: 50), damit Maps unter Y=50 korrekt funktionieren
|
||||||
|
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);
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ public class ParkourManager {
|
|||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +83,44 @@ public class ParkourManager {
|
|||||||
config = YamlConfiguration.loadConfiguration(file);
|
config = YamlConfiguration.loadConfiguration(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Migriert Bestzeiten vom alten Format (besttimes.<uuid>) ins neue Format
|
||||||
|
* (besttimes.<track>.<uuid>). Alte Zeiten werden Track 1 zugeordnet, da vor
|
||||||
|
* 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++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (migrated > 0) {
|
||||||
|
save();
|
||||||
|
plugin.getLogger().info("[Parkour] Migration: " + migrated
|
||||||
|
+ " Bestzeit(en) von altem Format nach Strecke 1 übertragen.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void save() {
|
private void save() {
|
||||||
try {
|
try {
|
||||||
config.save(file);
|
config.save(file);
|
||||||
@@ -325,7 +364,8 @@ public class ParkourManager {
|
|||||||
// ─────────────────────────────────────────────────────────────────────────
|
// ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
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);
|
||||||
@@ -346,21 +386,51 @@ public class ParkourManager {
|
|||||||
save();
|
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");
|
||||||
|
|||||||
@@ -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("§8[§6Nexus§8] §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("§8[§6Nexus§8] §7Verbinde mit §e" + serverName + "§7...");
|
||||||
|
} catch (java.io.IOException ex) {
|
||||||
|
player.sendMessage("§8[§6Nexus§8] §cFehler beim Verbinden: " + ex.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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()) {
|
||||||
|
|||||||
@@ -482,6 +482,5 @@ ball:
|
|||||||
#
|
#
|
||||||
# Benötigst du Hilfe oder Support?
|
# Benötigst du Hilfe oder Support?
|
||||||
# - Webseite: https://m-viper.de
|
# - Webseite: https://m-viper.de
|
||||||
# - Dokumentation: https://git.viper.ipv64.net/M_Viper/NexusLobby/wiki
|
# - Dokumentation: https://viper-network.de/wiki/NexusLobby/
|
||||||
# - Discord: https://discord.com/invite/FdRs4BRd8D
|
# - Discord: https://discord.com/invite/FdRs4BRd8D
|
||||||
# - GitHub: https://git.viper.ipv64.net/M_Viper/NexusLobby
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
name: NexusLobby
|
name: NexusLobby
|
||||||
main: de.nexuslobby.NexusLobby
|
main: de.nexuslobby.NexusLobby
|
||||||
version: "1.1.4"
|
version: "1.9"
|
||||||
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.
|
||||||
|
|||||||
Reference in New Issue
Block a user