Merge branch 'MisterFrans_master' into develop

This commit is contained in:
Auxilor
2023-01-17 17:44:35 +00:00
2 changed files with 9 additions and 8 deletions

View File

@@ -31,7 +31,8 @@ dependencies {
compileOnly('com.github.TownyAdvanced:Towny:0.97.2.6') {
exclude group: 'com.zaxxer', module: 'HikariCP'
}
compileOnly 'com.github.angeschossen:LandsAPI:5.15.2'
compileOnly 'com.github.angeschossen:LandsAPI:6.26.7'
compileOnly 'com.github.angeschossen:PluginFrameworkAPI:1.0.0'
compileOnly 'fr.neatmonster:nocheatplus:3.16.1-SNAPSHOT'
compileOnly 'com.github.jiangdashao:matrix-api-repo:317d4635fd'
compileOnly 'com.gmail.nossr50.mcMMO:mcMMO:2.1.202'

View File

@@ -2,8 +2,8 @@ package com.willfp.eco.internal.spigot.integrations.antigrief
import com.willfp.eco.core.EcoPlugin
import com.willfp.eco.core.integrations.antigrief.AntigriefIntegration
import me.angeschossen.lands.api.LandsIntegration
import me.angeschossen.lands.api.flags.Flags
import me.angeschossen.lands.api.integration.LandsIntegration
import org.bukkit.Location
import org.bukkit.block.Block
import org.bukkit.entity.Animals
@@ -12,12 +12,12 @@ import org.bukkit.entity.Monster
import org.bukkit.entity.Player
class AntigriefLands(private val plugin: EcoPlugin) : AntigriefIntegration {
private val landsIntegration = LandsIntegration(this.plugin)
private val landsIntegration = LandsIntegration.of(this.plugin)
override fun canBreakBlock(
player: Player,
block: Block
): Boolean {
val area = landsIntegration.getAreaByLoc(block.location) ?: return true
val area = landsIntegration.getArea(block.location) ?: return true
return area.hasFlag(player, Flags.BLOCK_BREAK, false)
}
@@ -25,7 +25,7 @@ class AntigriefLands(private val plugin: EcoPlugin) : AntigriefIntegration {
player: Player,
location: Location
): Boolean {
val area = landsIntegration.getAreaByLoc(location) ?: return true
val area = landsIntegration.getArea(location) ?: return true
return area.hasFlag(player, Flags.ATTACK_PLAYER, false) && area.hasFlag(player, Flags.ATTACK_ANIMAL, false)
}
@@ -33,7 +33,7 @@ class AntigriefLands(private val plugin: EcoPlugin) : AntigriefIntegration {
player: Player,
block: Block
): Boolean {
val area = landsIntegration.getAreaByLoc(block.location) ?: return true
val area = landsIntegration.getArea(block.location) ?: return true
return area.hasFlag(player, Flags.BLOCK_PLACE, false)
}
@@ -42,7 +42,7 @@ class AntigriefLands(private val plugin: EcoPlugin) : AntigriefIntegration {
victim: LivingEntity
): Boolean {
val area = landsIntegration.getAreaByLoc(victim.location) ?: return true
val area = landsIntegration.getArea(victim.location) ?: return true
return when(victim) {
is Player -> area.hasFlag(player, Flags.ATTACK_PLAYER, false)
@@ -53,7 +53,7 @@ class AntigriefLands(private val plugin: EcoPlugin) : AntigriefIntegration {
}
override fun canPickupItem(player: Player, location: Location): Boolean {
val area = landsIntegration.getAreaByLoc(location) ?: return true
val area = landsIntegration.getArea(location) ?: return true
return area.hasFlag(player, Flags.ITEM_PICKUP, false)
}