Fixes to EssentialsProtect that will remove conflicts with WorldGuard and other protection plugins.

This commit is contained in:
snowleo 2011-07-16 17:04:25 +02:00
parent 088f50ce8a
commit 48230f615d
3 changed files with 16 additions and 0 deletions

View File

@ -97,6 +97,10 @@ public class EssentialsProtectBlockListener extends BlockListener
@Override @Override
public void onBlockIgnite(BlockIgniteEvent event) public void onBlockIgnite(BlockIgniteEvent event)
{ {
if (event.isCancelled())
{
return;
}
Block block = event.getBlock(); Block block = event.getBlock();
if (block.getType() == Material.RAILS if (block.getType() == Material.RAILS
&& prot.getSettingBool(ProtectConfig.protect_rails)) && prot.getSettingBool(ProtectConfig.protect_rails))
@ -185,6 +189,10 @@ public class EssentialsProtectBlockListener extends BlockListener
@Override @Override
public void onBlockBurn(final BlockBurnEvent event) public void onBlockBurn(final BlockBurnEvent event)
{ {
if (event.isCancelled())
{
return;
}
final Block block = event.getBlock(); final Block block = event.getBlock();
if (block.getType() == Material.RAILS && prot.getSettingBool(ProtectConfig.protect_rails)) if (block.getType() == Material.RAILS && prot.getSettingBool(ProtectConfig.protect_rails))
{ {

View File

@ -292,6 +292,10 @@ public class EssentialsProtectEntityListener extends EntityListener
@Override @Override
public void onEntityTarget(final EntityTargetEvent event) public void onEntityTarget(final EntityTargetEvent event)
{ {
if (event.isCancelled())
{
return;
}
if (!(event.getTarget() instanceof Player)) if (!(event.getTarget() instanceof Player))
{ {
return; return;

View File

@ -24,6 +24,10 @@ public class EssentialsProtectPlayerListener extends PlayerListener
@Override @Override
public void onPlayerInteract(final PlayerInteractEvent event) public void onPlayerInteract(final PlayerInteractEvent event)
{ {
if (event.isCancelled())
{
return;
}
final User user = ess.getUser(event.getPlayer()); final User user = ess.getUser(event.getPlayer());
if (prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild()) if (prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild())