1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-11 17:15:07 +02:00

Correctly catch signs ignition

This commit is contained in:
snowleo
2011-08-25 17:37:41 +02:00
parent ef857bfe96
commit d0cb64bddc
3 changed files with 30 additions and 2 deletions

View File

@@ -193,7 +193,12 @@ public class EssentialsSign
return true;
}
public boolean onBlockPush(Block block, IEssentials ess)
public boolean onBlockIgnite(final Block block, final IEssentials ess)
{
return true;
}
public boolean onBlockPush(final Block block, final IEssentials ess)
{
return true;
}

View File

@@ -184,9 +184,24 @@ public class SignBlockListener extends BlockListener
return;
}
if (protectSignsAndBlocks(event.getBlock(), event.getPlayer()))
final Block block = event.getBlock();
if (((block.getType() == Material.WALL_SIGN
|| block.getType() == Material.SIGN_POST)
&& EssentialsSign.isValidSign(new EssentialsSign.BlockSign(block)))
|| EssentialsSign.checkIfBlockBreaksSigns(block))
{
event.setCancelled(true);
return;
}
for (Signs signs : Signs.values())
{
final EssentialsSign sign = signs.getSign();
if (sign.getBlocks().contains(block.getType())
&& !sign.onBlockIgnite(block, ess))
{
event.setCancelled(true);
return;
}
}
}

View File

@@ -314,6 +314,14 @@ public class SignProtection extends EssentialsSign
return state == SignProtectionState.NOSIGN;
}
@Override
public boolean onBlockIgnite(final Block block, final IEssentials ess)
{
final SignProtectionState state = isBlockProtected(block, null, null, false);
return state == SignProtectionState.NOSIGN;
}
@Override
public boolean onBlockPush(final Block block, final IEssentials ess)
{