mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Fix KCauldron dependency loading - closes #121
This commit is contained in:
parent
7042c45deb
commit
055d181c67
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
*
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user