mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
Protect: Remove protection when attached block is destroyed
This commit is contained in:
parent
26c9b34744
commit
01f69b3f2b
1 changed files with 15 additions and 4 deletions
|
@ -208,7 +208,10 @@ public class EssentialsProtectBlockListener extends BlockListener
|
|||
BlockFace.NORTH,
|
||||
BlockFace.EAST,
|
||||
BlockFace.SOUTH,
|
||||
BlockFace.WEST
|
||||
BlockFace.WEST,
|
||||
BlockFace.UP,
|
||||
BlockFace.DOWN,
|
||||
BlockFace.SELF
|
||||
};
|
||||
|
||||
@Override
|
||||
|
@ -263,8 +266,12 @@ public class EssentialsProtectBlockListener extends BlockListener
|
|||
}
|
||||
else
|
||||
{
|
||||
storage.unprotectBlock(block);
|
||||
}
|
||||
for (BlockFace blockFace : faces)
|
||||
{
|
||||
final Block against = block.getFace(blockFace);
|
||||
storage.unprotectBlock(against);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -292,7 +299,11 @@ public class EssentialsProtectBlockListener extends BlockListener
|
|||
}
|
||||
else
|
||||
{
|
||||
storage.unprotectBlock(block);
|
||||
for (BlockFace blockFace : faces)
|
||||
{
|
||||
final Block against = block.getFace(blockFace);
|
||||
storage.unprotectBlock(against);
|
||||
}
|
||||
}
|
||||
}
|
||||
event.setCancelled(true);
|
||||
|
|
Loading…
Reference in a new issue