mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-24 11:45:31 +01:00
Reverted f3d7bf2af3
It breaks the addon class loading and using lamda functions doesn't end up being neater because it must be able to throw a ClassNotFoundExcepetion to the Bukkit code.
This commit is contained in:
parent
25b4f674bb
commit
49764c151d
@ -90,25 +90,18 @@ public class AddonClassLoader extends URLClassLoader {
|
||||
if (name.startsWith("us.tastybento.")) {
|
||||
throw new ClassNotFoundException(name);
|
||||
}
|
||||
return classes.computeIfAbsent(name, k -> createFor(k, checkGlobal));
|
||||
}
|
||||
|
||||
private Class<?> createFor(String name, boolean checkGlobal) {
|
||||
Class<?> result = null;
|
||||
Class<?> result = classes.get(name);
|
||||
if (result == null) {
|
||||
if (checkGlobal) {
|
||||
result = loader.getClassByName(name);
|
||||
}
|
||||
|
||||
if (result == null) {
|
||||
try {
|
||||
result = super.findClass(name);
|
||||
} catch (ClassNotFoundException e) {
|
||||
Bukkit.getLogger().severe("Could not find class! " + e.getMessage());
|
||||
}
|
||||
|
||||
if (result != null) {
|
||||
loader.setClass(name, result);
|
||||
}
|
||||
classes.put(name, result);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -6,13 +6,11 @@ import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.PluginIdentifiableCommand;
|
||||
|
@ -1,12 +1,12 @@
|
||||
package us.tastybento.bskyblock.commands.island;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import us.tastybento.bskyblock.Constants;
|
||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
||||
import us.tastybento.bskyblock.api.commands.User;
|
||||
import us.tastybento.bskyblock.commands.IslandCommand;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Poslovitch
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user