Update residence comptibility

This commit is contained in:
Eredrim 2017-01-07 23:14:27 +01:00
parent fa7a196bab
commit fc3c134c2a
2 changed files with 10 additions and 11 deletions

View File

@ -237,11 +237,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.t00thpick1</groupId>
<artifactId>residence</artifactId>
<version>3.0.0q-SNAPSHOT</version>
<groupId>com.bekvon.bukkit.residence</groupId>
<artifactId>Residence</artifactId>
<version>4.5.3.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>

View File

@ -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);
}