diff options
Diffstat (limited to 'src/main/java/org/bukkit/plugin/SimplePluginManager.java')
-rw-r--r-- | src/main/java/org/bukkit/plugin/SimplePluginManager.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java index 3c9611ba..787dcfe5 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -131,6 +131,11 @@ public final class SimplePluginManager implements PluginManager { PluginDescriptionFile description = null; try { description = loader.getPluginDescription(file); + String name = description.getName(); + if (name.equalsIgnoreCase("bukkit") || name.equalsIgnoreCase("minecraft") || name.equalsIgnoreCase("mojang")) { + server.getLogger().log(Level.SEVERE, "Could not load '" + file.getPath() + "' in folder '" + directory.getPath() + "': Restricted Name"); + continue; + } } catch (InvalidDescriptionException ex) { server.getLogger().log(Level.SEVERE, "Could not load '" + file.getPath() + "' in folder '" + directory.getPath() + "'", ex); continue; @@ -337,7 +342,7 @@ public final class SimplePluginManager implements PluginManager { * @return Plugin if it exists, otherwise null */ public synchronized Plugin getPlugin(String name) { - return lookupNames.get(name); + return lookupNames.get(name.replace(' ', '_')); } public synchronized Plugin[] getPlugins() { |