From a95f7316d6bb7d4ee84827313e990b3e83aa5487 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Tue, 7 May 2019 16:13:56 +0100 Subject: [PATCH] Fix ProtectionCheckEvent not being used when accessing shop --- .../Acrobot/ChestShop/Listeners/Player/PlayerInteract.java | 3 +-- .../Acrobot/ChestShop/Listeners/Player/PlayerInventory.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInteract.java b/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInteract.java index d2172ea..526eaef 100644 --- a/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInteract.java +++ b/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInteract.java @@ -11,7 +11,6 @@ import com.Acrobot.ChestShop.Events.ItemParseEvent; import com.Acrobot.ChestShop.Events.PreTransactionEvent; import com.Acrobot.ChestShop.Events.TransactionEvent; import com.Acrobot.ChestShop.Permission; -import com.Acrobot.ChestShop.Plugins.ChestShop; import com.Acrobot.ChestShop.Security; import com.Acrobot.ChestShop.Signs.ChestShopSign; import com.Acrobot.ChestShop.Utils.uBlock; @@ -67,7 +66,7 @@ public class PlayerInteract implements Listener { return; } - if (!ChestShop.canAccess(player, block)) { + if (!Security.canAccess(player, block)) { player.sendMessage(Messages.prefix(Messages.ACCESS_DENIED)); event.setCancelled(true); } diff --git a/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInventory.java b/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInventory.java index 67f646c..942a511 100644 --- a/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInventory.java +++ b/src/main/java/com/Acrobot/ChestShop/Listeners/Player/PlayerInventory.java @@ -2,7 +2,7 @@ package com.Acrobot.ChestShop.Listeners.Player; import com.Acrobot.ChestShop.Configuration.Messages; import com.Acrobot.ChestShop.Configuration.Properties; -import com.Acrobot.ChestShop.Plugins.ChestShop; +import com.Acrobot.ChestShop.Security; import org.bukkit.block.Block; import org.bukkit.block.BlockState; import org.bukkit.block.Chest; @@ -43,7 +43,7 @@ public class PlayerInventory implements Listener { chest = ((DoubleChest) event.getInventory().getHolder()).getLocation().getBlock(); } - if (!ChestShop.canAccess(player, chest)) { + if (!Security.canAccess(player, chest)) { player.sendMessage(Messages.prefix(Messages.ACCESS_DENIED)); event.setCancelled(true); }