mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-12-03 15:33:22 +01:00
Instead of generating a new protection, use the new method
This commit is contained in:
parent
bb9f970148
commit
7f8fe5e6c1
@ -42,7 +42,7 @@ public class playerInteract implements Listener {
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
if (Config.getBoolean(Property.USE_BUILT_IN_PROTECTION) && block.getType() == Material.CHEST) {
|
if (Config.getBoolean(Property.USE_BUILT_IN_PROTECTION) && block.getType() == Material.CHEST) {
|
||||||
Default protection = new Default();
|
Default protection = Security.getDefaultProtection();
|
||||||
if (!hasAdminPermissions(player) && (protection.isProtected(block) && !protection.canAccess(player, block))) {
|
if (!hasAdminPermissions(player) && (protection.isProtected(block) && !protection.canAccess(player, block))) {
|
||||||
player.sendMessage(Config.getLocal(Language.ACCESS_DENIED));
|
player.sendMessage(Config.getLocal(Language.ACCESS_DENIED));
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user