From f3e56d282ebcb4fa298a8cb2c3696ee013d1a9d5 Mon Sep 17 00:00:00 2001 From: chris Date: Wed, 20 Dec 2023 16:35:48 +0100 Subject: [PATCH] Gracefully fail on older spigot builds due to outdated netty (#4355) * Test for outdated netty to avoid https://github.com/GeyserMC/Geyser/issues/3814 * capitalization * bad spigot, go paper --- .../geyser/platform/spigot/GeyserSpigotPlugin.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotPlugin.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotPlugin.java index 02ea91cf2..62a1e3f02 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotPlugin.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotPlugin.java @@ -135,6 +135,17 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap { } } + try { + Class.forName("io.netty.util.internal.ObjectPool.ObjectCreator"); + } catch (ClassNotFoundException e) { + getLogger().severe("*********************************************"); + getLogger().severe(""); + getLogger().severe("This version of Spigot is using an outdated version of netty. Please use Paper instead!"); + getLogger().severe(""); + getLogger().severe("*********************************************"); + return; + } + // This is manually done instead of using Bukkit methods to save the config because otherwise comments get removed try { if (!getDataFolder().exists()) {