fancynpcs, fancyholograms: Use sets of Version Strings for checking if a version is valid (#142)

* use set for checking if a version is valid

* use Paper PR for snapshot reference

---------

Co-authored-by: TheosRee <theosree@users.noreply.github.com>
This commit is contained in:
TheosRee
2025-11-08 13:20:25 +01:00
committed by Oliver
parent d36af3cd00
commit 24c1907eec
5 changed files with 12 additions and 5 deletions

View File

@@ -292,7 +292,7 @@ public final class FancyHolograms extends JavaPlugin implements FancyHologramsPl
private void registerListeners() {
getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
getServer().getPluginManager().registerEvents(new WorldListener(), this);
if (Bukkit.getMinecraftVersion().equals("1.21.4") || Bukkit.getMinecraftVersion().equals("1.21.5") || Bukkit.getMinecraftVersion().equals("1.21.6") || Bukkit.getMinecraftVersion().equals("1.21.7") || Bukkit.getMinecraftVersion().equals("1.21.8")) {
if (Set.of("1.21.4", "1.21.5", "1.21.6", "1.21.7", "1.21.8").contains(Bukkit.getMinecraftVersion())) {
getServer().getPluginManager().registerEvents(new PlayerLoadedListener(), this);
}