mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-30 13:09:10 +01:00
Less hacks
This commit is contained in:
parent
4858bf2958
commit
f19e8181f1
@ -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";
|
||||
}
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user