@Override public void enable() { config = configure(new LocalConfiguration()); CommandBook.registerEvents(this); registerCommands(Commands.class); }
@Override public void enable() { config = new LocalConfiguration(); loadMessages(); CommandBook.registerEvents(this); registerCommands(Commands.class); }
@Override public void enable() { CommandBook.registerEvents(this); registerCommands(Commands.class); config = configure(new LocalConfiguration()); }
@EventHandler public void playerWhois(InfoComponent.PlayerWhoisEvent event) { if (event.getPlayer() instanceof Player) { if (CommandBook.inst().hasPermission(event.getSource(), "commandbook.god.check")) { event.addWhoisInformation(null, "Player " + (hasGodMode((Player) event.getPlayer()) ? "has" : "does not have") + " god mode"); } } }
@Override public void enable() { config = configure(new LocalConfiguration()); registerCommands(Commands.class); // Check god mode for existing players, if any for (Player player : CommandBook.server().getOnlinePlayers()) { checkAutoEnable(player); } CommandBook.registerEvents(this); }
/** * Determines if a player can be protected. * * @param player the player to check * @return true if the player can be protected */ public boolean canProtect(Player player) { AFKSession session = sessions.getSession(AFKSession.class, player); return (session.isRequested() && canProtect(true)) || (isAfk(session.getLastUpdate()) && canProtect(false)); }
/** * Determines if a player can be set to ignored for the sleep check. * * @param player the player to check * @return true if the player can be set to ignored for the sleep check */ public boolean canIgnoreSleep(Player player) { AFKSession session = sessions.getSession(AFKSession.class, player); return (session.isRequested() && canIgnoreSleep(true)) || (isAfk(session.getLastUpdate()) && canIgnoreSleep(false)); }
@Override public void enable() { config = configure(new LocalConfiguration()); CommandBook.registerEvents(this); if (config.useMovementEvent) { CommandBook.registerEvents(new MovementListener()); } registerCommands(Commands.class); server.getScheduler().runTaskTimer(inst, this, 20, 20); }
@Override public void enable() { this.config = configure(new LocalConfiguration()); CommandBook.registerEvents(this); registerCommands(Commands.class); }
@Override public void enable() { config = configure(new LocalConfiguration()); registerCommands(Commands.class); CommandBook.registerEvents(this); }
@Override public void enable() { config = configure(new LocalConfiguration()); CommandBook.registerEvents(this); registerCommands(Commands.class); scheduler.scheduleAtFixedRate(this, 1, 1, TimeUnit.SECONDS); }
private boolean checkAutoEnable(Player player) { if (config.autoEnable && (CommandBook.inst().getPermissionsResolver() .inGroup(player, "cb-invincible") || CommandBook.inst().hasPermission(player, "commandbook.god.auto-invincible"))) { enableGodMode(player); return true; } return false; }
@Override public void enable() { config = configure(new LocalConfiguration()); registerCommands(Commands.class); }
/** * Determines if a player should be kicked for being AFK. * * @param player the player to check * @return true if the player should be kicked */ public boolean shouldKick(Player player) { return shouldKick(sessions.getSession(AFKSession.class, player).getLastUpdate()); }
@Override public void enable() { // Jingle note manager jingleNoteManager = new JingleNoteManager(); registerCommands(Commands.class); CommandBook.registerEvents(this); }
@Override public boolean hasPermission(CommandSender player, String perm) { return plugin.hasPermission(player, perm); } };
@Override public void enable() { registerCommands(Commands.class); }
@Override public void enable() { registerCommands(Commands.class); }
@Override public void enable() { registerCommands(Commands.class); }
@Override public void enable() { registerCommands(Commands.class); }