Configuration setting to allow ender chests

This commit is contained in:
cmastudios 2013-12-07 00:48:03 -06:00
parent 99bfbc5e58
commit 21f91a00fc
3 changed files with 5 additions and 3 deletions

View File

@ -206,7 +206,8 @@ public class War extends JavaPlugin {
warzoneDefaultConfig.put(WarzoneConfig.SCOREBOARD, ScoreboardType.NONE);
warzoneDefaultConfig.put(WarzoneConfig.XPKILLMETER, false);
warzoneDefaultConfig.put(WarzoneConfig.SOUPHEALING, false);
warzoneDefaultConfig.put(WarzoneConfig.ALLOWENDER, true);
teamDefaultConfig.put(TeamConfig.FLAGMUSTBEHOME, true);
teamDefaultConfig.put(TeamConfig.FLAGPOINTSONLY, false);
teamDefaultConfig.put(TeamConfig.FLAGRETURN, FlagReturn.BOTH);

View File

@ -24,7 +24,8 @@ public enum WarzoneConfig {
AUTOJOIN (Boolean.class),
SCOREBOARD (ScoreboardType.class),
XPKILLMETER (Boolean.class),
SOUPHEALING (Boolean.class);
SOUPHEALING (Boolean.class),
ALLOWENDER (Boolean.class);
private final Class<?> configType;

View File

@ -229,7 +229,7 @@ public class WarPlayerListener implements Listener {
// another player.
player.playSound(player.getLocation(), Sound.ITEM_BREAK, 1, 0);
}
if (zone != null && event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.ENDER_CHEST) {
if (zone != null && event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.ENDER_CHEST && !zone.getWarzoneConfig().getBoolean(WarzoneConfig.ALLOWENDER)) {
event.setCancelled(true);
War.war.badMsg(player, "use.ender");
}