Less hacks

This commit is contained in:
fullwall 2012-12-10 13:30:02 +08:00
parent 4858bf2958
commit f19e8181f1
2 changed files with 3 additions and 22 deletions

View File

@ -56,7 +56,6 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
private final CommandManager commands = new CommandManager(); private final CommandManager commands = new CommandManager();
private boolean compatible; private boolean compatible;
private Settings config; private Settings config;
private ClassLoader contextClassLoader;
private CitizensNPCRegistry npcRegistry; private CitizensNPCRegistry npcRegistry;
private NPCDataStore saves; private NPCDataStore saves;
private NPCSelector selector; private NPCSelector selector;
@ -281,16 +280,6 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
} }
} }
private void setupScripting() {
contextClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(getClassLoader());
// Workaround to fix scripts not loading plugin classes properly.
// The built in Sun Rhino Javascript engine uses the context classloader
// to search for class imports. Since the context classloader only has
// CraftBukkit classes, we replace it with a PluginClassLoader, which
// allows all plugin classes to be imported.
}
private void startMetrics() { private void startMetrics() {
try { try {
Metrics metrics = new Metrics(Citizens.this); Metrics metrics = new Metrics(Citizens.this);
@ -338,13 +327,5 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
return false; return false;
} }
private void tearDownScripting() {
if (contextClassLoader == null)
return;
if (Thread.currentThread().getContextClassLoader() == getClassLoader())
Thread.currentThread().setContextClassLoader(contextClassLoader);
contextClassLoader = null;
}
private static final String COMPATIBLE_MC_VERSION = "1.4"; private static final String COMPATIBLE_MC_VERSION = "1.4";
} }

View File

@ -1038,9 +1038,9 @@ public class NPCCommands {
@Command( @Command(
aliases = { "npc" }, aliases = { "npc" },
usage = "zombiemod (-b, -v)", usage = "zombiemod (-b(aby), -v(illager))",
desc = "Sets the modifiers of a zombie", desc = "Sets a zombie NPC to be a baby or villager",
modifiers = { "zombiemod" }, modifiers = { "zombie", "zombiemod" },
flags = "bv", flags = "bv",
min = 1, min = 1,
max = 1, max = 1,