mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-25 19:45:36 +01:00
Fix turning off default protection if protected externally (Fixes #445)
This commit is contained in:
parent
d3ed650b74
commit
5b214e09f5
@ -4,6 +4,7 @@ import com.Acrobot.ChestShop.Configuration.Properties;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import com.Acrobot.ChestShop.Events.Protection.ProtectionCheckEvent;
|
||||
@ -14,11 +15,9 @@ import nl.rutgerkok.blocklocker.BlockLockerAPIv2;
|
||||
* @author Acrobot
|
||||
*/
|
||||
public class BlockLocker implements Listener {
|
||||
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onProtectionCheck(ProtectionCheckEvent event) {
|
||||
if (event.getResult() == Event.Result.DENY) {
|
||||
if (event.getResult() == Event.Result.DENY && !Properties.TURN_OFF_DEFAULT_PROTECTION_WHEN_PROTECTED_EXTERNALLY) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -6,15 +6,16 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
* @author Acrobot
|
||||
*/
|
||||
public class Deadbolt implements Listener {
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public static void onProtectionCheck(ProtectionCheckEvent event) {
|
||||
if (event.getResult() == Event.Result.DENY) {
|
||||
if (event.getResult() == Event.Result.DENY && !Properties.TURN_OFF_DEFAULT_PROTECTION_WHEN_PROTECTED_EXTERNALLY) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -6,15 +6,16 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
* @author Acrobot
|
||||
*/
|
||||
public class Lockette implements Listener {
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public static void onProtectionCheck(ProtectionCheckEvent event) {
|
||||
if (event.getResult() == Event.Result.DENY) {
|
||||
if (event.getResult() == Event.Result.DENY && !Properties.TURN_OFF_DEFAULT_PROTECTION_WHEN_PROTECTED_EXTERNALLY) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -7,13 +7,13 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
public class LockettePro implements Listener {
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public static void onProtectionCheck(ProtectionCheckEvent event) {
|
||||
if (event.getResult() == Event.Result.DENY) {
|
||||
if (event.getResult() == Event.Result.DENY && !Properties.TURN_OFF_DEFAULT_PROTECTION_WHEN_PROTECTED_EXTERNALLY) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.Acrobot.ChestShop.Plugins;
|
||||
|
||||
import com.Acrobot.ChestShop.Configuration.Properties;
|
||||
import com.Acrobot.ChestShop.Events.Protection.ProtectionCheckEvent;
|
||||
import com.bekvon.bukkit.residence.Residence;
|
||||
import com.bekvon.bukkit.residence.api.ResidenceApi;
|
||||
@ -9,6 +10,7 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
@ -16,10 +18,9 @@ import org.bukkit.event.Listener;
|
||||
* @author Andrzej Pomirski
|
||||
*/
|
||||
public class ResidenceChestProtection implements Listener {
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public static void onProtectionCheck(ProtectionCheckEvent event) {
|
||||
if (event.getResult() == Event.Result.DENY) {
|
||||
if (event.getResult() == Event.Result.DENY && !Properties.TURN_OFF_DEFAULT_PROTECTION_WHEN_PROTECTED_EXTERNALLY) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
@ -20,9 +21,9 @@ public class SimpleChestLock implements Listener {
|
||||
this.scl = scl;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onProtectionCheck(ProtectionCheckEvent event) {
|
||||
if (event.getResult() == Event.Result.DENY) {
|
||||
if (event.getResult() == Event.Result.DENY && !Properties.TURN_OFF_DEFAULT_PROTECTION_WHEN_PROTECTED_EXTERNALLY) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user