public void loadFactorySettings() { getConfigData().setString("join-message-format", "&8(&6$nonline&8) &3$n &7joined"); getConfigData().setString("leave-message-format", "&8(&6$nonline&8) &3$n &7left"); getConfigData().setString("kick-message-format", "&8(&6$nonline&8) &3$n &4was kicked out"); getConfigData().setBoolean("permissions-multigroup", false); getConfigData().setBoolean("permissions-multiworld", false); getConfigData().setBoolean("permissions-default-op", false); getConfigData().setBoolean("enable-ram-clear-cycle", false); getConfigData().setInt("ram-clear-cycle-time", 60); for (Module module : ModuleManager.getManager().getModules()) { if (module.getConfiguration() != null) module.getConfiguration().reset(); } getConfigData().setString("reset", "no"); log("| ========================================== |"); log("| * VOXELGUEST 4 |"); log("| * |"); log("| * The premiere server adminstration suite |"); log("| * |"); log("| * Built by: psanker & VoxelPlugineering |"); log("| * Licensed by the BSD License - 2012 |"); log("| ========================================== |"); log("Factory settings loaded"); }
private int getFakequitSize() { try { VanishModule module = (VanishModule) ModuleManager.getManager().getModule(VanishModule.class); return module.getFakequitSize(); } catch (ModuleException ex) { return 0; } }
private boolean isInFakeQuit(Player p) { try { VanishModule module = (VanishModule) ModuleManager.getManager().getModule(VanishModule.class); return module.isInFakequit(p); } catch (ModuleException ex) { return false; } }
private boolean isAFK(Player p) { try { AFKModule module = (AFKModule) ModuleManager.getManager().getModule(AFKModule.class); return module.isAFK(p); } catch (ModuleException ex) { return false; } }
@Override public void onEnable() { instance = this; perms = new PermissionsManager(this.getServer(), "[VoxelGuest]", config); groupManager = new GroupManager(); moduleManager = new ModuleManager(this, commandsManager); registerPluginIds(); // Register system / miscellaneous commands commandsManager.registerCommands(MiscellaneousCommands.class); commandsManager.registerCommands(ServerAdministrationCommands.class); // Load system event listeners Bukkit.getPluginManager().registerEvents(listener, this); Bukkit.getPluginManager().registerEvents(perms, this); // Load permissions system perms.registerActiveHandler(); // Load players for (Player player : Bukkit.getOnlinePlayers()) { GuestPlayer gp = new GuestPlayer(player); if (isPlayerRegistered(gp)) { continue; } groupManager.verifyPlayerGroupExistence(player); guestPlayers.add(gp); // KEEP THIS LAST ONLINE_MEMBERS++; } // Load modules ModuleManager.setActiveModuleManager(moduleManager); moduleManager.loadModules(availableModules); // Load module events into the system listener listener.registerModuleEvents(); if (getConfigData().getString("reset") == null || getConfigData().getString("reset").equalsIgnoreCase("yes")) { loadFactorySettings(); } }
@Override public void onDisable() { ListIterator<GuestPlayer> it = guestPlayers.listIterator(); while (it.hasNext()) { GuestPlayer gp = it.next(); gp.saveData(getPluginId(this)); } guestPlayers.clear(); groupManager.saveGroupConfigurations(); moduleManager.shutDownModules(); getConfigData().save(); }