From fc3c134c2aa2762f1b3ede86cf7fa8ad7964abb4 Mon Sep 17 00:00:00 2001 From: Eredrim Date: Sat, 7 Jan 2017 23:14:27 +0100 Subject: [PATCH] Update residence comptibility --- pom.xml | 7 +++---- .../Plugins/ResidenceChestProtection.java | 14 +++++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index c33e41c..64344ac 100644 --- a/pom.xml +++ b/pom.xml @@ -237,11 +237,10 @@ - - net.t00thpick1 - residence - 3.0.0q-SNAPSHOT + com.bekvon.bukkit.residence + Residence + 4.5.3.0 provided diff --git a/src/main/java/com/Acrobot/ChestShop/Plugins/ResidenceChestProtection.java b/src/main/java/com/Acrobot/ChestShop/Plugins/ResidenceChestProtection.java index 183ac15..5abcceb 100644 --- a/src/main/java/com/Acrobot/ChestShop/Plugins/ResidenceChestProtection.java +++ b/src/main/java/com/Acrobot/ChestShop/Plugins/ResidenceChestProtection.java @@ -1,10 +1,10 @@ package com.Acrobot.ChestShop.Plugins; import com.Acrobot.ChestShop.Events.Protection.ProtectionCheckEvent; -import net.t00thpick1.residence.Residence; -import net.t00thpick1.residence.api.ResidenceAPI; -import net.t00thpick1.residence.api.areas.ResidenceArea; -import net.t00thpick1.residence.api.flags.FlagManager; +import com.bekvon.bukkit.residence.Residence; +import com.bekvon.bukkit.residence.api.ResidenceApi; +import com.bekvon.bukkit.residence.containers.Flags; +import com.bekvon.bukkit.residence.protection.ClaimedResidence; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.Event; @@ -25,10 +25,10 @@ public class ResidenceChestProtection implements Listener { Block block = event.getBlock(); Player player = event.getPlayer(); - ResidenceArea area = ResidenceAPI.getResidenceManager().getByLocation(block.getLocation()); + ClaimedResidence residence = ResidenceApi.getResidenceManager().getByLoc(block.getLocation()); - if (area != null) { - if (!area.allowAction(player.getName(), FlagManager.CONTAINER) && !Residence.getInstance().isAdminMode(player)) { + if (residence != null) { + if (!residence.getPermissions().playerHas(player, Flags.container, true) && !Residence.isResAdminOn(player)) { //Doesn't have permissions to that chest. event.setResult(Event.Result.DENY); }