Added override for flint and steel blocking.

This commit is contained in:
Wizjany 2011-04-15 09:17:11 +08:00 committed by
parent af5d0c4b0e
commit 1e8c91e92f
2 changed files with 12 additions and 4 deletions

View File

@ -262,12 +262,12 @@ public void onBlockIgnite(BlockIgniteEvent event) {
event.setCancelled(true);
return;
}
/*
if (wcfg.blockLighter && cause == IgniteCause.FLINT_AND_STEEL) {
event.setCancelled(true);
return;
}
*/
if (wcfg.fireSpreadDisableToggle && isFireSpread) {
event.setCancelled(true);
return;

View File

@ -140,7 +140,14 @@ public void handleBlockRightClick(PlayerInteractEvent event) {
ConfigurationManager cfg = plugin.getGlobalConfiguration();
WorldConfiguration wcfg = cfg.get(world);
if (wcfg.blockLighter && item.getType() == Material.FLINT_AND_STEEL) {
if (!plugin.hasPermission(player, "worldguard.lighter.override")) {
event.setCancelled(true);
return;
}
}
if (wcfg.useRegions) {
Vector pt = toVector(block);
RegionManager mgr = plugin.getGlobalRegionManager().get(world);
@ -170,7 +177,8 @@ public void handleBlockRightClick(PlayerInteractEvent event) {
}
if (item.getType() == Material.FLINT_AND_STEEL) {
if (!set.allows(DefaultFlag.LIGHTER)) {
if (!set.allows(DefaultFlag.LIGHTER)
&& !plugin.hasPermission(player, "worldguard.lighter.override")) {
event.setCancelled(true);
return;
}