mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-12 14:06:29 +00:00
Fix sign break bug
This commit is contained in:
parent
9a91c99391
commit
0937a35470
|
@ -44,6 +44,13 @@ public class SignBlockListener implements Listener
|
||||||
|
|
||||||
public boolean protectSignsAndBlocks(final Block block, final Player player)
|
public boolean protectSignsAndBlocks(final Block block, final Player player)
|
||||||
{
|
{
|
||||||
|
// prevent any signs be broken by destroying the block they are attached to
|
||||||
|
if (EssentialsSign.checkIfBlockBreaksSigns(block))
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
final int mat = block.getTypeId();
|
final int mat = block.getTypeId();
|
||||||
if (mat == SIGN_POST || mat == WALL_SIGN)
|
if (mat == SIGN_POST || mat == WALL_SIGN)
|
||||||
{
|
{
|
||||||
|
@ -58,12 +65,7 @@ public class SignBlockListener implements Listener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// prevent any signs be broken by destroying the block they are attached to
|
|
||||||
if (EssentialsSign.checkIfBlockBreaksSigns(block))
|
|
||||||
{
|
|
||||||
LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||||
{
|
{
|
||||||
if (sign.areHeavyEventRequired() && sign.getBlocks().contains(block.getType())
|
if (sign.areHeavyEventRequired() && sign.getBlocks().contains(block.getType())
|
||||||
|
|
Loading…
Reference in a new issue