Optional disable of TNT Listener

This commit is contained in:
boy0001 2015-04-01 19:25:58 +11:00
parent 6927351bfb
commit 6005501320
4 changed files with 16 additions and 18 deletions

View file

@ -110,9 +110,9 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
Bukkit.getServer().unloadWorld(world, true); Bukkit.getServer().unloadWorld(world, true);
} }
} }
getServer().getPluginManager().registerEvents(new TNTListener(), this);
} }
@Override @Override
public void onDisable() { public void onDisable() {
MAIN.disable(); MAIN.disable();
@ -371,4 +371,9 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
public EventUtil initEventUtil() { public EventUtil initEventUtil() {
return new BukkitEventUtil(); return new BukkitEventUtil();
} }
@Override
public void registerTNTListener() {
getServer().getPluginManager().registerEvents(new TNTListener(), this);
}
} }

View file

@ -39,6 +39,8 @@ public interface IPlotMain {
public void registerWorldEditEvents(); public void registerWorldEditEvents();
public void registerTNTListener();
public Economy getEconomy(); public Economy getEconomy();
public BlockManager initBlockManager(); public BlockManager initBlockManager();

View file

@ -763,12 +763,10 @@ public class PlotSquared {
final Map<String, Object> options = new HashMap<>(); final Map<String, Object> options = new HashMap<>();
options.put("teleport.delay", 0); options.put("teleport.delay", 0);
options.put("auto_update", false); options.put("auto_update", false);
options.put("confirmation.clear", Settings.CONFIRM_CLEAR); options.put("confirmation.clear", Settings.CONFIRM_CLEAR);
options.put("confirmation.delete", Settings.CONFIRM_DELETE); options.put("confirmation.delete", Settings.CONFIRM_DELETE);
options.put("confirmation.unlink", Settings.CONFIRM_UNLINK); options.put("confirmation.unlink", Settings.CONFIRM_UNLINK);
options.put("protection.tnt-listener.enabled", Settings.TNT_LISTENER);
options.put("clusters.enabled", Settings.ENABLE_CLUSTERS); options.put("clusters.enabled", Settings.ENABLE_CLUSTERS);
options.put("clear.fastmode", Settings.ENABLE_CLUSTERS); options.put("clear.fastmode", Settings.ENABLE_CLUSTERS);
options.put("plotme-alias", Settings.USE_PLOTME_ALIAS); options.put("plotme-alias", Settings.USE_PLOTME_ALIAS);
@ -788,9 +786,7 @@ public class PlotSquared {
options.put("max_plots", Settings.MAX_PLOTS); options.put("max_plots", Settings.MAX_PLOTS);
options.put("schematics.save_path", Settings.SCHEMATIC_SAVE_PATH); options.put("schematics.save_path", Settings.SCHEMATIC_SAVE_PATH);
options.put("uuid.read-from-disk", Settings.UUID_FROM_DISK); options.put("uuid.read-from-disk", Settings.UUID_FROM_DISK);
options.put("cache.permissions", Settings.PERMISSION_CACHING); options.put("cache.permissions", Settings.PERMISSION_CACHING);
options.put("titles", Settings.TITLES); options.put("titles", Settings.TITLES);
options.put("teleport.on_login", Settings.TELEPORT_ON_LOGIN); options.put("teleport.on_login", Settings.TELEPORT_ON_LOGIN);
options.put("worldedit.require-selection-in-mask", Settings.REQUIRE_SELECTION); options.put("worldedit.require-selection-in-mask", Settings.REQUIRE_SELECTION);
@ -804,13 +800,12 @@ public class PlotSquared {
if (Settings.DEBUG) { if (Settings.DEBUG) {
log(C.PREFIX.s() + "&6Debug Mode Enabled (Default). Edit the config to turn this off."); log(C.PREFIX.s() + "&6Debug Mode Enabled (Default). Edit the config to turn this off.");
} }
Settings.TNT_LISTENER = config.getBoolean("protection.tnt-listener.enabled");
Settings.PERMISSION_CACHING = config.getBoolean("cache.permissions"); Settings.PERMISSION_CACHING = config.getBoolean("cache.permissions");
Settings.CONFIRM_CLEAR = config.getBoolean("confirmation.clear"); Settings.CONFIRM_CLEAR = config.getBoolean("confirmation.clear");
Settings.CONFIRM_DELETE = config.getBoolean("confirmation.delete"); Settings.CONFIRM_DELETE = config.getBoolean("confirmation.delete");
Settings.CONFIRM_UNLINK = config.getBoolean("confirmation.unlink"); Settings.CONFIRM_UNLINK = config.getBoolean("confirmation.unlink");
Settings.FAST_CLEAR = config.getBoolean("clear.fastmode"); Settings.FAST_CLEAR = config.getBoolean("clear.fastmode");
Settings.TELEPORT_DELAY = config.getInt("teleport.delay"); Settings.TELEPORT_DELAY = config.getInt("teleport.delay");
Settings.CONSOLE_COLOR = config.getBoolean("console.color"); Settings.CONSOLE_COLOR = config.getBoolean("console.color");
Settings.TELEPORT_ON_LOGIN = config.getBoolean("teleport.on_login"); Settings.TELEPORT_ON_LOGIN = config.getBoolean("teleport.on_login");

View file

@ -36,13 +36,17 @@ public class Settings {
public static boolean PERMISSION_CACHING = false; public static boolean PERMISSION_CACHING = false;
public static boolean UUID_FROM_DISK = false; public static boolean UUID_FROM_DISK = false;
/** /**
* * PlotMe settings
*/ */
public static boolean CONVERT_PLOTME = true; public static boolean CONVERT_PLOTME = true;
public static boolean CACHE_PLOTME = false; public static boolean CACHE_PLOTME = false;
public static boolean USE_PLOTME_ALIAS = false; public static boolean USE_PLOTME_ALIAS = false;
/** /**
* * TNT listener
*/
public static boolean TNT_LISTENER = false;
/**
* Max auto claiming size
*/ */
public static int MAX_AUTO_SIZE = 4; public static int MAX_AUTO_SIZE = 4;
/** /**
@ -61,14 +65,6 @@ public class Settings {
* Teleport to path on login * Teleport to path on login
*/ */
public static boolean TELEPORT_ON_LOGIN = false; public static boolean TELEPORT_ON_LOGIN = false;
/**
* Mob Cap Enabled
*/
// public static boolean MOB_CAP_ENABLED = false;
/**
* The Mob Cap
*/
// public static int MOB_CAP = 20;
/** /**
* Display titles * Display titles
*/ */