Fix an issue with Gravity

This commit is contained in:
fullwall 2012-10-24 00:19:31 +08:00
parent 14931b32a9
commit 5c6509046e
2 changed files with 4 additions and 3 deletions

View File

@ -289,8 +289,9 @@ public class NPCCommands {
}
}
if (args.hasValueFlag("b")) {
npc.getTrait(Behaviour.class).addScripts(Splitter.on(",").split(args.getFlag("behaviour")));
if (args.hasValueFlag("b") || args.hasValueFlag("behaviours") || args.hasValueFlag("behaviors")) {
String behaviours = args.getFlag("b", args.getFlag("behaviours", args.getFlag("behaviors")));
npc.getTrait(Behaviour.class).addScripts(Splitter.on(',').split(behaviours));
msg += " with the specified behaviours";
}

View File

@ -9,7 +9,7 @@ public class Gravity extends Trait implements Toggleable {
@Persist
private boolean enabled;
public Gravity(String name) {
public Gravity() {
super("gravity");
}