diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java index fdb51cec3..96c0245b3 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java @@ -416,6 +416,16 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin { return PlatformType.BUKKIT; } + @Override + public String getServerName() { + return getServer().getName(); + } + + @Override + public String getServerVersion() { + return getServer().getVersion(); + } + @Override public File getMainDir() { return getDataFolder(); diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java index 88d098c61..b0f3d211b 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java @@ -223,6 +223,16 @@ public class LPBungeePlugin extends Plugin implements LuckPermsPlugin { return PlatformType.BUNGEE; } + @Override + public String getServerName() { + return getProxy().getName(); + } + + @Override + public String getServerVersion() { + return getProxy().getVersion(); + } + @Override public File getMainDir() { return getDataFolder(); diff --git a/common/src/main/java/me/lucko/luckperms/common/LuckPermsPlugin.java b/common/src/main/java/me/lucko/luckperms/common/LuckPermsPlugin.java index 3dcdd0c3b..85e2c5ead 100644 --- a/common/src/main/java/me/lucko/luckperms/common/LuckPermsPlugin.java +++ b/common/src/main/java/me/lucko/luckperms/common/LuckPermsPlugin.java @@ -215,6 +215,18 @@ public interface LuckPermsPlugin { */ PlatformType getType(); + /** + * Gets the name or "brand" of the running platform + * @return the server brand + */ + String getServerName(); + + /** + * Gets the version of the running platform + * @return the server version + */ + String getServerVersion(); + /** * Gets the plugins main directory * diff --git a/common/src/main/java/me/lucko/luckperms/common/dependencies/DependencyManager.java b/common/src/main/java/me/lucko/luckperms/common/dependencies/DependencyManager.java index fa5a3fe9d..61f74b6f0 100644 --- a/common/src/main/java/me/lucko/luckperms/common/dependencies/DependencyManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/dependencies/DependencyManager.java @@ -130,7 +130,7 @@ public class DependencyManager { private static void loadJar(LuckPermsPlugin plugin, File file, String baseClass) throws Exception { URLClassLoader classLoader = (URLClassLoader) plugin.getClass().getClassLoader(); - if (plugin.getType() != PlatformType.SPONGE) { + if (plugin.getType() != PlatformType.SPONGE && !plugin.getServerName().equals("KCauldron")) { classLoader = (URLClassLoader) classLoader.getParent(); } diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java index f01e7f325..d7b7934b5 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java @@ -374,6 +374,16 @@ public class LPSpongePlugin implements LuckPermsPlugin { return PlatformType.SPONGE; } + @Override + public String getServerName() { + return getGame().getPlatform().getType().name(); + } + + @Override + public String getServerVersion() { + return getGame().getPlatform().getApi().getVersion().orElse("null") + " - " + getGame().getPlatform().getImplementation().getVersion().orElse("null"); + } + @Override public int getPlayerCount() { return game.getServer().getOnlinePlayers().size();