Compare commits

..

5 Commits

Author SHA1 Message Date
Auxilor
4102be1201 Updated to 6.50.1 2023-01-27 17:47:21 +00:00
Will FP
f6bdb9cc65 Merge pull request #236 from 0ft3n/develop
Fixed fix
2023-01-27 17:46:19 +00:00
Will FP
c8282d1acf Merge branch 'develop' into develop 2023-01-27 17:46:13 +00:00
_OfTeN_
b056b537ef Fixed fix x2 2023-01-27 20:31:00 +03:00
_OfTeN_
f69b458731 Fixed fix 2023-01-27 19:48:28 +03:00
4 changed files with 21 additions and 45 deletions

View File

@@ -3,9 +3,7 @@ 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.enums.FlagTarget
import me.angeschossen.lands.api.flags.enums.RoleFlagCategory
import me.angeschossen.lands.api.flags.type.RoleFlag
import me.angeschossen.lands.api.flags.type.Flags
import org.bukkit.Location
import org.bukkit.Material
import org.bukkit.block.Block
@@ -21,10 +19,7 @@ class AntigriefLands(private val plugin: EcoPlugin) : AntigriefIntegration {
block: Block
): Boolean {
val area = landsIntegration.getArea(block.location) ?: return true
return area.hasRoleFlag(player, RoleFlag.of(landsIntegration,
FlagTarget.PLAYER,
RoleFlagCategory.ACTION,
"BLOCK_BREAK"), block.type, false)
return area.hasRoleFlag(player, Flags.BLOCK_BREAK, block.type, false)
}
override fun canCreateExplosion(
@@ -32,13 +27,8 @@ class AntigriefLands(private val plugin: EcoPlugin) : AntigriefIntegration {
location: Location
): Boolean {
val area = landsIntegration.getArea(location) ?: return true
return area.hasRoleFlag(player, RoleFlag.of(landsIntegration,
FlagTarget.PLAYER,
RoleFlagCategory.ACTION,
"ATTACK_PLAYER"), Material.AIR, false) && area.hasRoleFlag(player, RoleFlag.of(landsIntegration,
FlagTarget.PLAYER,
RoleFlagCategory.ACTION,
"ATTACK_ANIMAL"), Material.AIR, false)
return area.hasRoleFlag(player, Flags.ATTACK_PLAYER, Material.AIR, false)
&& area.hasRoleFlag(player, Flags.ATTACK_ANIMAL, Material.AIR, false)
}
override fun canPlaceBlock(
@@ -46,10 +36,7 @@ class AntigriefLands(private val plugin: EcoPlugin) : AntigriefIntegration {
block: Block
): Boolean {
val area = landsIntegration.getArea(block.location) ?: return true
return area.hasRoleFlag(player, RoleFlag.of(landsIntegration,
FlagTarget.PLAYER,
RoleFlagCategory.ACTION,
"BLOCK_PLACE"), Material.AIR, false)
return area.hasRoleFlag(player, Flags.BLOCK_PLACE, Material.AIR, false)
}
override fun canInjure(
@@ -60,28 +47,16 @@ class AntigriefLands(private val plugin: EcoPlugin) : AntigriefIntegration {
val area = landsIntegration.getArea(victim.location) ?: return true
return when(victim) {
is Player -> area.hasRoleFlag(player, RoleFlag.of(landsIntegration,
FlagTarget.PLAYER,
RoleFlagCategory.ACTION,
"ATTACK_PLAYER"), Material.AIR, false)
is Monster -> area.hasRoleFlag(player, RoleFlag.of(landsIntegration,
FlagTarget.PLAYER,
RoleFlagCategory.ACTION,
"ATTACK_MONSTER"), Material.AIR, false)
is Animals -> area.hasRoleFlag(player, RoleFlag.of(landsIntegration,
FlagTarget.PLAYER,
RoleFlagCategory.ACTION,
"ATTACK_ANIMAL"), Material.AIR, false)
is Player -> area.hasRoleFlag(player, Flags.ATTACK_PLAYER, Material.AIR, false)
is Monster -> area.hasRoleFlag(player, Flags.ATTACK_MONSTER, Material.AIR, false)
is Animals -> area.hasRoleFlag(player, Flags.ATTACK_ANIMAL, Material.AIR, false)
else -> area.isTrusted(player.uniqueId)
}
}
override fun canPickupItem(player: Player, location: Location): Boolean {
val area = landsIntegration.getArea(location) ?: return true
return area.hasRoleFlag(player, RoleFlag.of(landsIntegration,
FlagTarget.PLAYER,
RoleFlagCategory.ACTION,
"ITEM_PICKUP"), Material.AIR, false)
return area.hasRoleFlag(player, Flags.ITEM_PICKUP, Material.AIR, false)
}
override fun getPluginName(): String {

View File

@@ -36,22 +36,22 @@ class ShopEconomyShopGUI : ShopIntegration {
object EconomyShopGUISellEventListeners : Listener {
private val sellTypes = listOf(
Transaction.Type.SELL_GUI_SCREEN,
Transaction.Type.SELL_SCREEN,
Transaction.Type.SELL_ALL_SCREEN,
Transaction.Type.SELL_ALL_COMMAND,
Transaction.Type.QUICK_SELL,
Transaction.Type.AUTO_SELL_CHEST,
"SELL_GUI_SCREEN",
"SELL_SCREEN",
"SELL_ALL_SCREEN",
"SELL_ALL_COMMAND",
"QUICK_SELL",
"AUTO_SELL_CHEST",
)
private val sellAllTypes = listOf(
Transaction.Type.SELL_GUI_SCREEN,
Transaction.Type.SELL_ALL_COMMAND,
"SELL_GUI_SCREEN",
"SELL_ALL_COMMAND",
)
@EventHandler
fun shopEventToEcoEvent(event: PreTransactionEvent) {
if (event.transactionType !in sellTypes) {
if (event.transactionType.name.uppercase() !in sellTypes) {
return
}
@@ -59,7 +59,7 @@ class ShopEconomyShopGUI : ShopIntegration {
return
}
val prices = if (event.transactionType in sellAllTypes) {
val prices = if (event.transactionType.name.uppercase() in sellAllTypes) {
event.items!!
} else {
mapOf(event.shopItem to event.amount)

View File

@@ -45,6 +45,7 @@ softdepend:
- ExecutableItems
- RPGHorses
- EconomyShopGUI
- EconomyShopGUI-Premium
- zShop
- DeluxeSellwands
- Scyther

View File

@@ -1,3 +1,3 @@
version = 6.50.0
version = 6.50.1
plugin-name = eco
kotlin.code.style = official