mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-30 03:43:51 -07:00
@@ -42,7 +42,7 @@ public final class SimplePluginManager implements PluginManager {
|
||||
private final Map<Pattern, PluginLoader> fileAssociations = new HashMap<Pattern, PluginLoader>();
|
||||
private final List<Plugin> plugins = new ArrayList<Plugin>();
|
||||
private final Map<String, Plugin> lookupNames = new HashMap<String, Plugin>();
|
||||
private static File updateDirectory = null;
|
||||
private File updateDirectory;
|
||||
private final SimpleCommandMap commandMap;
|
||||
private final Map<String, Permission> permissions = new HashMap<String, Permission>();
|
||||
private final Map<Boolean, Set<Permission>> defaultPerms = new LinkedHashMap<Boolean, Set<Permission>>();
|
||||
@@ -187,10 +187,11 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
||||
while (!plugins.isEmpty()) {
|
||||
boolean missingDependency = true;
|
||||
Iterator<String> pluginIterator = plugins.keySet().iterator();
|
||||
Iterator<Map.Entry<String, File>> pluginIterator = plugins.entrySet().iterator();
|
||||
|
||||
while (pluginIterator.hasNext()) {
|
||||
String plugin = pluginIterator.next();
|
||||
Map.Entry<String, File> entry = pluginIterator.next();
|
||||
String plugin = entry.getKey();
|
||||
|
||||
if (dependencies.containsKey(plugin)) {
|
||||
Iterator<String> dependencyIterator = dependencies.get(plugin).iterator();
|
||||
@@ -205,14 +206,13 @@ public final class SimplePluginManager implements PluginManager {
|
||||
// We have a dependency not found
|
||||
} else if (!plugins.containsKey(dependency)) {
|
||||
missingDependency = false;
|
||||
File file = plugins.get(plugin);
|
||||
pluginIterator.remove();
|
||||
softDependencies.remove(plugin);
|
||||
dependencies.remove(plugin);
|
||||
|
||||
server.getLogger().log(
|
||||
Level.SEVERE,
|
||||
"Could not load '" + file.getPath() + "' in folder '" + directory.getPath() + "'",
|
||||
"Could not load '" + entry.getValue().getPath() + "' in folder '" + directory.getPath() + "'",
|
||||
new UnknownDependencyException(dependency));
|
||||
break;
|
||||
}
|
||||
@@ -257,15 +257,16 @@ public final class SimplePluginManager implements PluginManager {
|
||||
if (missingDependency) {
|
||||
// We now iterate over plugins until something loads
|
||||
// This loop will ignore soft dependencies
|
||||
pluginIterator = plugins.keySet().iterator();
|
||||
pluginIterator = plugins.entrySet().iterator();
|
||||
|
||||
while (pluginIterator.hasNext()) {
|
||||
String plugin = pluginIterator.next();
|
||||
Map.Entry<String, File> entry = pluginIterator.next();
|
||||
String plugin = entry.getKey();
|
||||
|
||||
if (!dependencies.containsKey(plugin)) {
|
||||
softDependencies.remove(plugin);
|
||||
missingDependency = false;
|
||||
File file = plugins.get(plugin);
|
||||
File file = entry.getValue();
|
||||
pluginIterator.remove();
|
||||
|
||||
try {
|
||||
@@ -358,7 +359,7 @@ public final class SimplePluginManager implements PluginManager {
|
||||
}
|
||||
|
||||
public synchronized Plugin[] getPlugins() {
|
||||
return plugins.toArray(new Plugin[0]);
|
||||
return plugins.toArray(new Plugin[plugins.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -68,7 +68,7 @@ public class StandardMessenger implements Messenger {
|
||||
Set<String> channels = outgoingByPlugin.get(plugin);
|
||||
|
||||
if (channels != null) {
|
||||
String[] toRemove = channels.toArray(new String[0]);
|
||||
String[] toRemove = channels.toArray(new String[channels.size()]);
|
||||
|
||||
outgoingByPlugin.remove(plugin);
|
||||
|
||||
@@ -138,7 +138,7 @@ public class StandardMessenger implements Messenger {
|
||||
Set<PluginMessageListenerRegistration> registrations = incomingByPlugin.get(plugin);
|
||||
|
||||
if (registrations != null) {
|
||||
PluginMessageListenerRegistration[] toRemove = registrations.toArray(new PluginMessageListenerRegistration[0]);
|
||||
PluginMessageListenerRegistration[] toRemove = registrations.toArray(new PluginMessageListenerRegistration[registrations.size()]);
|
||||
|
||||
for (PluginMessageListenerRegistration registration : toRemove) {
|
||||
if (registration.getChannel().equals(channel)) {
|
||||
@@ -154,7 +154,7 @@ public class StandardMessenger implements Messenger {
|
||||
Set<PluginMessageListenerRegistration> registrations = incomingByPlugin.get(plugin);
|
||||
|
||||
if (registrations != null) {
|
||||
PluginMessageListenerRegistration[] toRemove = registrations.toArray(new PluginMessageListenerRegistration[0]);
|
||||
PluginMessageListenerRegistration[] toRemove = registrations.toArray(new PluginMessageListenerRegistration[registrations.size()]);
|
||||
|
||||
incomingByPlugin.remove(plugin);
|
||||
|
||||
|
Reference in New Issue
Block a user