diff --git a/gradle.properties b/gradle.properties index 0346b8e..5c5ad90 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,7 +12,7 @@ makeevrserg.java.ktarget=21 # Project makeevrserg.project.name=AspeKt makeevrserg.project.group=ru.astrainteractive.aspekt -makeevrserg.project.version.string=2.22.0 +makeevrserg.project.version.string=2.22.1 makeevrserg.project.description=Essentials plugin for EmpireProjekt makeevrserg.project.developers=makeevrserg|Makeev Roman|makeevrserg@gmail.com makeevrserg.project.url=https://empireprojekt.ru diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index eccc8a0..061f072 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -25,6 +25,9 @@ minecraft-vault = "1.7.1" # https://github.com/MilkBowl/VaultAPI minecraft-astralibs = "3.12.0" # https://github.com/Astra-Interactive/AstraLibs minecraft-bstats = "3.0.2" # https://github.com/Bastian/bStats minecraft-mockbukkit = "3.96.1" #https://github.com/MockBukkit/MockBukkit +minecraft-luckperms = "5.4" # https://github.com/LuckPerms/LuckPerms +minecraft-essentialsx = "2.20.1" # https://github.com/EssentialsX/Essentials +minecraft-towny = "0.100.3.11" # https://github.com/TownyAdvanced/Towny # Shadow gradle-shadow = "8.0.0" # https://github.com/johnrengelman/shadow @@ -84,6 +87,10 @@ minecraft-mockbukkit = { module = "com.github.MockBukkit:MockBukkit", version.re minecraft-discordsrv = { module = "com.discordsrv:discordsrv", version.ref = "discordsrv" } +minecraft-luckperms = { module = "net.luckperms:api", version.ref = "minecraft-luckperms" } +minecraft-essentialsx = { module = "net.essentialsx:EssentialsX", version.ref = "minecraft-essentialsx" } +minecraft-towny = { module = "com.palmergames.bukkit.towny:towny", version.ref = "minecraft-towny" } + # klibs klibs-mikro-core = { module = "ru.astrainteractive.klibs:mikro-core", version.ref = "klibs-mikro" } klibs-kdi = { module = "ru.astrainteractive.klibs:kdi", version.ref = "klibs-kdi" } diff --git a/modules/adminprivate/src/main/kotlin/ru/astrainteractive/aspekt/module/adminprivate/event/AdminPrivateEvent.kt b/modules/adminprivate/src/main/kotlin/ru/astrainteractive/aspekt/module/adminprivate/event/AdminPrivateEvent.kt index bcac0d9..e7d5b63 100644 --- a/modules/adminprivate/src/main/kotlin/ru/astrainteractive/aspekt/module/adminprivate/event/AdminPrivateEvent.kt +++ b/modules/adminprivate/src/main/kotlin/ru/astrainteractive/aspekt/module/adminprivate/event/AdminPrivateEvent.kt @@ -1,7 +1,9 @@ package ru.astrainteractive.aspekt.module.adminprivate.event import io.papermc.paper.event.player.PlayerItemFrameChangeEvent +import org.bukkit.Location import org.bukkit.Material +import org.bukkit.block.BlockState import org.bukkit.entity.ArmorStand import org.bukkit.entity.Enemy import org.bukkit.entity.Monster @@ -24,6 +26,7 @@ import org.bukkit.event.hanging.HangingBreakByEntityEvent import org.bukkit.event.player.PlayerArmorStandManipulateEvent import org.bukkit.event.player.PlayerBucketEmptyEvent import org.bukkit.event.player.PlayerInteractEvent +import org.bukkit.event.world.PortalCreateEvent import ru.astrainteractive.aspekt.module.adminprivate.debounce.EventDebounce import ru.astrainteractive.aspekt.module.adminprivate.debounce.RetractKey import ru.astrainteractive.aspekt.module.adminprivate.event.di.AdminPrivateDependencies @@ -46,8 +49,9 @@ internal class AdminPrivateEvent( flag: ChunkFlag ) where T : Event, T : Cancellable { if (!adminPrivateController.isEnabled) return - if (player?.toPermissible()?.hasPermission(PluginPermission.AdminClaim) == true) return + if (e.isCancelled) return + debounce.debounceEvent(retractKey, e) { val isAble = adminPrivateController.isAble(adminChunk, flag) val isCancelled = !isAble @@ -241,4 +245,22 @@ internal class AdminPrivateEvent( flag = ChunkFlag.HOSTILE_MOB_SPAWN ) } + val portalCreateEvent = DSLEvent(eventListener, plugin) { e -> + val chunks = e.blocks + .map(BlockState::getLocation) + .distinctBy(Location::getChunk) + .map(Location::getChunk) + chunks.forEach { chunk -> + handleDefault( + retractKey = RetractKey.Vararg( + chunks, + "portalCreateEvent" + ), + e = e, + adminChunk = chunk.adminChunk, + player = null, + flag = ChunkFlag.PLACE + ) + } + } } diff --git a/modules/discordlink/build.gradle.kts b/modules/discordlink/build.gradle.kts index eb9655a..1ed4392 100644 --- a/modules/discordlink/build.gradle.kts +++ b/modules/discordlink/build.gradle.kts @@ -18,9 +18,9 @@ dependencies { implementation(libs.minecraft.astralibs.core.bukkit) implementation(libs.minecraft.vaultapi) // Spigot - compileOnly("net.luckperms:api:5.4") compileOnly(libs.minecraft.discordsrv) - compileOnly("net.essentialsx:EssentialsX:2.20.1") + compileOnly(libs.minecraft.luckperms) + compileOnly(libs.minecraft.essentialsx) // Test testImplementation(libs.bundles.testing.kotlin) testImplementation(libs.tests.kotlin.test) diff --git a/modules/moneydrop/build.gradle.kts b/modules/moneydrop/build.gradle.kts index e5632c9..f28ad30 100644 --- a/modules/moneydrop/build.gradle.kts +++ b/modules/moneydrop/build.gradle.kts @@ -17,7 +17,7 @@ dependencies { implementation(libs.minecraft.astralibs.core.bukkit) implementation(libs.minecraft.vaultapi) // Spigot - compileOnly("net.essentialsx:EssentialsX:2.20.1") + compileOnly(libs.minecraft.essentialsx) // Test testImplementation(libs.bundles.testing.kotlin) testImplementation(libs.tests.kotlin.test) diff --git a/modules/towny-discord/build.gradle.kts b/modules/towny-discord/build.gradle.kts index 24d783b..510ac61 100644 --- a/modules/towny-discord/build.gradle.kts +++ b/modules/towny-discord/build.gradle.kts @@ -18,10 +18,10 @@ dependencies { implementation(libs.minecraft.astralibs.core.bukkit) implementation(libs.minecraft.vaultapi) // Spigot - compileOnly("net.luckperms:api:5.4") + compileOnly(libs.minecraft.luckperms) compileOnly(libs.minecraft.discordsrv) - compileOnly("net.essentialsx:EssentialsX:2.20.1") - compileOnly("com.palmergames.bukkit.towny:towny:0.100.3.11") + compileOnly(libs.minecraft.essentialsx) + compileOnly(libs.minecraft.towny) // Test testImplementation(libs.bundles.testing.kotlin) testImplementation(libs.tests.kotlin.test) diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 6e80761..a52dcf8 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -21,9 +21,9 @@ dependencies { implementation(libs.minecraft.astralibs.core.bukkit) implementation(libs.minecraft.vaultapi) // Spigot - compileOnly("net.luckperms:api:5.4") + compileOnly(libs.minecraft.luckperms) compileOnly(libs.minecraft.discordsrv) - compileOnly("net.essentialsx:EssentialsX:2.20.1") + compileOnly(libs.minecraft.essentialsx) // Test testImplementation(libs.bundles.testing.kotlin) testImplementation(libs.tests.kotlin.test)