mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-27 11:37:38 +01:00
Correctly catch signs ignition
This commit is contained in:
parent
3d913f9fcc
commit
01861e5a64
@ -192,8 +192,13 @@ public class EssentialsSign
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean onBlockIgnite(final Block block, final IEssentials ess)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean onBlockPush(Block block, IEssentials ess)
|
||||
public boolean onBlockPush(final Block block, final IEssentials ess)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -313,6 +313,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)
|
||||
|
Loading…
Reference in New Issue
Block a user