28 lines
897 B
Java
28 lines
897 B
Java
package net.t2code.t2callayduplicate.Hooks;
|
|
|
|
import me.angeschossen.lands.api.flags.Flags;
|
|
import me.angeschossen.lands.api.integration.LandsIntegration;
|
|
import me.angeschossen.lands.api.land.Area;
|
|
import org.bukkit.Location;
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.plugin.Plugin;
|
|
|
|
import javax.annotation.Nullable;
|
|
|
|
public class LandsIntegratior {
|
|
private LandsIntegration landsIntegration;
|
|
public LandsIntegratior(Plugin yourPlugin) {
|
|
this.landsIntegration = new LandsIntegration(yourPlugin);
|
|
}
|
|
public boolean canInteract(Location location, Player player) {
|
|
if(!landsIntegration.isClaimed(location)){
|
|
return true;
|
|
}
|
|
final @Nullable Area area = landsIntegration.getAreaByLoc(location);
|
|
if (area != null) {
|
|
return area.hasFlag(player, Flags.INTERACT_GENERAL, false);
|
|
}
|
|
return true;
|
|
}
|
|
}
|