diff --git a/pom.xml b/pom.xml index 13931d969..9d02bafae 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ UTF-8 UTF-8 - 1.8 + 1.10 1.7.4 @@ -126,7 +126,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.7.0 + 3.8.0 ${java.version} ${java.version} @@ -142,6 +142,7 @@ maven-jar-plugin 3.1.0 + org.apache.maven.plugins maven-source-plugin @@ -173,10 +174,11 @@ + org.apache.maven.plugins maven-install-plugin diff --git a/src/main/java/world/bentobox/bentobox/BentoBox.java b/src/main/java/world/bentobox/bentobox/BentoBox.java index 2cd6f6461..023446959 100644 --- a/src/main/java/world/bentobox/bentobox/BentoBox.java +++ b/src/main/java/world/bentobox/bentobox/BentoBox.java @@ -130,11 +130,12 @@ public void onEnable(){ instance.log("#############################################"); // Load metrics + /* if (settings.isMetrics()) { BStats bStats = new BStats(this); bStats.registerMetrics(); } - + */ // Fire plugin ready event Bukkit.getServer().getPluginManager().callEvent(new BentoBoxReadyEvent()); }); diff --git a/src/main/java/world/bentobox/bentobox/api/addons/AddonClassLoader.java b/src/main/java/world/bentobox/bentobox/api/addons/AddonClassLoader.java index 141b7db33..5689df7a0 100644 --- a/src/main/java/world/bentobox/bentobox/api/addons/AddonClassLoader.java +++ b/src/main/java/world/bentobox/bentobox/api/addons/AddonClassLoader.java @@ -113,20 +113,24 @@ public Class findClass(String name, boolean checkGlobal) { if (name.startsWith("world.bentobox.bentobox")) { return null; } + Class result = classes.get(name); + if (result == null) { + if (checkGlobal) { + result = loader.getClassByName(name); + } - Class result = classes.computeIfAbsent(name, k -> { - if (checkGlobal && loader.getClassByName(name) != null) { - return loader.getClassByName(name); - } else { + if (result == null) { try { - return super.findClass(name); + result = super.findClass(name); } catch (ClassNotFoundException e) { - return null; + result = null; + } + if (result != null) { + loader.setClass(name, result); + } } - }); - if (result != null) { - loader.setClass(name, result); + classes.put(name, result); } return result; }