Less hacks

This commit is contained in:
fullwall 2012-12-10 13:30:02 +08:00
parent de0594eade
commit c1672e9c8c
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 boolean compatible;
private Settings config;
private ClassLoader contextClassLoader;
private CitizensNPCRegistry npcRegistry;
private NPCDataStore saves;
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() {
try {
Metrics metrics = new Metrics(Citizens.this);
@ -338,13 +327,5 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
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";
}

View File

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