diff --git a/core/src/main/java/com/rexcantor64/triton/SpigotMLP.java b/core/src/main/java/com/rexcantor64/triton/SpigotMLP.java index a5899abf..5742c950 100644 --- a/core/src/main/java/com/rexcantor64/triton/SpigotMLP.java +++ b/core/src/main/java/com/rexcantor64/triton/SpigotMLP.java @@ -104,7 +104,7 @@ public void onEnable() { } if (getConf().isBungeecord()) { - if (!isSpigotProxyMode() && !isPaperProxyMode()) { + if (!isSpigotProxyMode() && !isPaperProxyMode() && !isLegacyPaperProxyMode()) { getLogger().logError("DANGER! DANGER! DANGER!"); getLogger().logError("Proxy mode is enabled on Triton but disabled on Spigot!"); getLogger().logError("A malicious player can run ANY command as the server."); @@ -260,7 +260,7 @@ public UUID getPlayerUUIDFromString(String input) { /** * Use reflection to check if this Spigot server has "bungeecord" mode enabled on spigot.yml. - * This is used to show a warning if Spigot is in proxy mode, but the server is not. + * This is used to show a warning if Triton is in proxy mode, but the server is not. * * @return Whether this Spigot server has bungeecord enabled on spigot.yml. */ @@ -283,9 +283,9 @@ public boolean isSpigotProxyMode() { /** * Use reflection to check if this Paper server has velocity modern forwarding enabled on paper-global.yml. - * This is used to show a warning if Paper is in proxy mode, but the server is not. + * This is used to show a warning if Triton is in proxy mode, but the server is not. * - * @return Whether this Spigot server has velocity forwarding enabled on paper-global.yml. + * @return Whether this Paper server has velocity forwarding enabled on paper-global.yml. */ public boolean isPaperProxyMode() { try { @@ -303,4 +303,24 @@ public boolean isPaperProxyMode() { return false; } } + + /** + * Use reflection to check if this (legacy) Paper server has velocity modern forwarding enabled on paper.yml. + * This is used to show a warning if Triton is in proxy mode, but the server is not. + * + * @return Whether this (legacy) Paper server has velocity forwarding enabled on paper-global.yml. + */ + public boolean isLegacyPaperProxyMode() { + try { + Class paperConfigClass = Class.forName("com.destroystokyo.paper.PaperConfig"); + + Object velocityEnabled = paperConfigClass.getField("velocitySupport").get(null); + if (velocityEnabled == null) { + return false; + } + return (boolean) velocityEnabled; + } catch (Exception e) { + return false; + } + } }