Added the option to disable the use of player move events. Note that this also disables features which use it such as the region entry/exit and greeting/farewell flags.

This commit is contained in:
Wizjany 2011-08-10 19:42:32 -04:00
parent 17741822c1
commit 4194b2ca86
3 changed files with 11 additions and 7 deletions

View File

@ -45,7 +45,7 @@ public class ConfigurationManager {
"#\r\n" +
"# This is the global configuration file. Anything placed into here will\r\n" +
"# be applied to all worlds. However, each world has its own configuration\r\n" +
"# file to allow you to replace any setting in here for that world only.\r\n" +
"# file to allow you to replace most settings in here for that world only.\r\n" +
"#\r\n" +
"# About editing this file:\r\n" +
"# - DO NOT USE TABS. You MUST use spaces or Bukkit will complain. If\r\n" +
@ -85,6 +85,7 @@ public class ConfigurationManager {
public boolean useRegionsScheduler;
public boolean activityHaltToggle = false;
public boolean autoGodMode;
public boolean usePlayerMove;
/**
* Construct the object.
@ -113,6 +114,8 @@ public void load() {
"regions.use-scheduler", true);
autoGodMode = config.getBoolean(
"auto-invincible-permission", false);
usePlayerMove = config.getBoolean(
"use-player-move-event", true);
// Load configurations for each world
for (World world : plugin.getServer().getWorlds()) {

View File

@ -106,8 +106,10 @@ public void registerEvents() {
registerEvent("PLAYER_RESPAWN", Priority.High);
registerEvent("PLAYER_ITEM_HELD", Priority.High);
registerEvent("PLAYER_BED_ENTER", Priority.High);
registerEvent("PLAYER_MOVE", Priority.High);
registerEvent("PLAYER_COMMAND_PREPROCESS", Priority.High);
if (plugin.getGlobalStateManager().usePlayerMove) {
registerEvent("PLAYER_MOVE", Priority.High);
}
}
/**
@ -175,7 +177,7 @@ public void onPlayerJoin(PlayerJoinEvent event) {
if (removed > 10) {
logger.info("WG Halt-Act: " + removed + " entities (>10) auto-removed from "
+ player.getWorld().toString());
+ player.getWorld().toString());
}
}

View File

@ -149,10 +149,9 @@ public void onEnable() {
(new PermissionsResolverServerListener(perms)).register(this);
flagStateManager = new FlagStateManager(this);
if (configuration.useRegionsScheduler) {
getServer().getScheduler().scheduleAsyncRepeatingTask(this,
flagStateManager, FlagStateManager.RUN_DELAY, FlagStateManager.RUN_DELAY);
if (configuration.useRegionsScheduler) {
getServer().getScheduler().scheduleAsyncRepeatingTask(this, flagStateManager, FlagStateManager.RUN_DELAY, FlagStateManager.RUN_DELAY);
}
if (configuration.suppressTickSyncWarnings) {