Skip to content

Commit

Permalink
Remove -24000 limit of /npc age
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Mar 7, 2014
1 parent 0b405e7 commit e562890
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/main/java/net/citizensnpcs/commands/NPCCommands.java
Expand Up @@ -118,7 +118,7 @@ public void age(CommandContext args, CommandSender sender, NPC npc) throws Comma
int age = 0;
try {
age = args.getInteger(1);
if (age < -24000 || age > 0) {
if (age > 0) {
throw new CommandException(Messages.INVALID_AGE);
}
Messaging.sendTr(sender, Messages.AGE_SET_NORMAL, npc.getName(), age);
Expand Down Expand Up @@ -265,7 +265,7 @@ public void copy(CommandContext args, CommandSender sender, NPC npc) throws Comm
}

CommandSenderCreateNPCEvent event = sender instanceof Player ? new PlayerCreateNPCEvent((Player) sender, copy)
: new CommandSenderCreateNPCEvent(sender, copy);
: new CommandSenderCreateNPCEvent(sender, copy);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
event.getNPC().destroy();
Expand Down Expand Up @@ -337,7 +337,7 @@ public void create(CommandContext args, CommandSender sender, NPC npc) throws Co
spawnLoc = args.getSenderLocation();
}
CommandSenderCreateNPCEvent event = sender instanceof Player ? new PlayerCreateNPCEvent((Player) sender, npc)
: new CommandSenderCreateNPCEvent(sender, npc);
: new CommandSenderCreateNPCEvent(sender, npc);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
npc.destroy();
Expand Down Expand Up @@ -1009,7 +1009,7 @@ public void pose(CommandContext args, CommandSender sender, NPC npc) throws Comm
@Requirements(selected = true, ownership = true, types = { EntityType.CREEPER })
public void power(CommandContext args, CommandSender sender, NPC npc) {
Messaging
.sendTr(sender, npc.getTrait(Powered.class).toggle() ? Messages.POWERED_SET : Messages.POWERED_STOPPED);
.sendTr(sender, npc.getTrait(Powered.class).toggle() ? Messages.POWERED_SET : Messages.POWERED_STOPPED);
}

@Command(
Expand Down
Expand Up @@ -31,8 +31,9 @@ public int getDelay() {

@Override
public void onWaypointReached(NPC npc, Location waypoint) {
if (delay > 0)
if (delay > 0) {
scheduleTask(npc.getTrait(Waypoints.class).getCurrentProvider());
}
}

private void scheduleTask(final WaypointProvider provider) {
Expand Down
Expand Up @@ -42,8 +42,9 @@ public String getPromptText(ConversationContext context) {
context.setSessionData(WaypointTriggerPrompt.CREATED_TRIGGER_KEY, null);
Messaging.sendTr((CommandSender) context.getForWhom(), Messages.WAYPOINT_TRIGGER_ADDED_SUCCESSFULLY,
returned.description());
} else
} else {
Messaging.sendErrorTr((CommandSender) context.getForWhom(), Messages.WAYPOINT_TRIGGER_EDITOR_INACTIVE);
}
}
if (context.getSessionData("said") == Boolean.TRUE)
return "";
Expand Down

0 comments on commit e562890

Please sign in to comment.