public static final String reachedNPCLimitMessage = ChatColor.RED
+ "You have reached the NPC-creation limit.";
// Display a list of NPCs owned by a player
public static void displayNPCList(Player sender, Player toDisplay, HumanNPC npc, String passed) {
PageInstance paginate = PageUtils.newInstance(sender);
for (HumanNPC hnpc : NPCManager.getList().values()) {
if (hnpc.getOwner().equals(toDisplay.getName())) {
paginate.push(ChatColor.GRAY + "" + hnpc.getUID() + ChatColor.YELLOW + " " + hnpc.getName());
}
}
int page = Integer.parseInt(passed);
if (page == 0) {
page = 1;
}
if (page <= paginate.maxPages()) {
paginate.header(ChatColor.GREEN
+ StringUtils.listify("NPC List for " + StringUtils.wrap(toDisplay.getName())
+ " (%x/%y)"));
paginate.process(page);
} else {
sender.sendMessage(MessageUtils.getMaxPagesMessage(page, paginate.maxPages()));
}
}