diff --git a/sayanvanish-bukkit/build.gradle.kts b/sayanvanish-bukkit/build.gradle.kts index 4c4b1e2..5a4bd0b 100644 --- a/sayanvanish-bukkit/build.gradle.kts +++ b/sayanvanish-bukkit/build.gradle.kts @@ -10,7 +10,7 @@ plugins { stickynote { modules(StickyNoteModules.BUKKIT, StickyNoteModules.BUKKIT_NMS) - relocate(!gradle.startParameter.getTaskNames().any { it.startsWith("runServer") || it.startsWith("runFolia") || it.startsWith("runVelocity") }) +// relocate(!gradle.startParameter.getTaskNames().any { it.startsWith("runServer") || it.startsWith("runFolia") || it.startsWith("runVelocity") }) } dependencies { @@ -32,7 +32,7 @@ tasks.withType(xyz.jpenilla.runtask.task.AbstractRun::class) { vendor = JvmVendorSpec.JETBRAINS languageVersion = JavaLanguageVersion.of(21) } - jvmArgs("-XX:+AllowEnhancedClassRedefinition") + jvmArgs("-XX:+AllowEnhancedClassRedefinition", "-Dnet.kyori.adventure.text.warnWhenLegacyFormattingDetected=false") } tasks { @@ -72,10 +72,11 @@ tasks { // url("https://github.com/NEZNAMY/TAB/releases/download/4.1.6/TAB.v4.1.6.jar") // url("https://ci.lucko.me/job/spark/418/artifact/spark-bukkit/build/libs/spark-1.10.73-bukkit.jar") // url("https://github.com/Insprill/custom-join-messages/releases/download/v17.5.0/custom-join-messages-17.5.0.jar") - url("https://github.com/NEZNAMY/TAB-Bridge/releases/download/6.0.0/TAB-Bridge.v6.0.0.jar") + url("https://github.com/NEZNAMY/TAB-Bridge/releases/download/6.0.1/TAB-Bridge.v6.0.1.jar") url("https://github.com/EssentialsX/Essentials/releases/download/2.20.1/EssentialsX-2.20.1.jar") url("https://download.luckperms.net/1567/bukkit/loader/LuckPerms-Bukkit-5.4.150.jar") } + jvmArgs("-Dnet.kyori.adventure.text.warnWhenLegacyFormattingDetected=false") } runPaper { diff --git a/sayanvanish-bukkit/src/main/kotlin/org/sayandev/sayanvanish/bukkit/api/BukkitUser.kt b/sayanvanish-bukkit/src/main/kotlin/org/sayandev/sayanvanish/bukkit/api/BukkitUser.kt index 35e6a50..4b840c7 100644 --- a/sayanvanish-bukkit/src/main/kotlin/org/sayandev/sayanvanish/bukkit/api/BukkitUser.kt +++ b/sayanvanish-bukkit/src/main/kotlin/org/sayandev/sayanvanish/bukkit/api/BukkitUser.kt @@ -40,13 +40,16 @@ open class BukkitUser( } else { SayanVanishAPI.getInstance().database.hasBasicUser(uniqueId, true) } - override var vanishLevel: Int = 1 + override var vanishLevel: Int = 0 get() = if (Features.getFeature().levelMethod == FeatureLevel.LevelMethod.PERMISSION) { player()?.let { player -> player.effectivePermissions .filter { it.permission.startsWith("sayanvanish.level.") } - .maxOfOrNull { it.permission.substringAfter("sayanvanish.level.").toIntOrNull() ?: 1 } ?: 1 - } ?: 1 + .maxOfOrNull { it.permission.substringAfter("sayanvanish.level.").toIntOrNull() ?: field } + ?: if (hasPermission(Permission.VANISH)) 1 else { + if (isVanished) 1 else field + } + } ?: field } else { field } diff --git a/sayanvanish-proxy/sayanvanish-proxy-velocity/build.gradle.kts b/sayanvanish-proxy/sayanvanish-proxy-velocity/build.gradle.kts index 39b004d..cee6d01 100644 --- a/sayanvanish-proxy/sayanvanish-proxy-velocity/build.gradle.kts +++ b/sayanvanish-proxy/sayanvanish-proxy-velocity/build.gradle.kts @@ -17,12 +17,21 @@ dependencies { api(project(":sayanvanish-proxy")) } +tasks.withType(xyz.jpenilla.runtask.task.AbstractRun::class) { + javaLauncher = javaToolchains.launcherFor { + vendor = JvmVendorSpec.JETBRAINS + languageVersion = JavaLanguageVersion.of(21) + } + jvmArgs("-XX:+AllowEnhancedClassRedefinition", "-Dnet.kyori.adventure.text.warnWhenLegacyFormattingDetected=false") +} + + tasks { runVelocity { velocityVersion("3.4.0-SNAPSHOT") downloadPlugins { - url("https://github.com/NEZNAMY/TAB/releases/download/5.0.2/TAB.v5.0.2.jar") + url("https://github.com/NEZNAMY/TAB/releases/download/5.0.3/TAB.v5.0.3.jar") url("https://download.luckperms.net/1560/velocity/LuckPerms-Velocity-5.4.145.jar") // url("https://cdn.modrinth.com/data/Q10irTG0/versions/eXh7ktan/Velocitab-1.7.2-67931d8.jar") // url("https://github.com/Syrent/EnhancedVelocity/releases/download/1.3.3/EnhancedVelocity.v1.3.3.jar") diff --git a/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/api/VelocityUser.kt b/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/api/VelocityUser.kt index da49b9d..00e7616 100644 --- a/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/api/VelocityUser.kt +++ b/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/api/VelocityUser.kt @@ -2,6 +2,7 @@ package org.sayandev.sayanvanish.velocity.api import com.velocitypowered.api.proxy.Player import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver +import org.sayandev.sayanvanish.api.Permission import org.sayandev.sayanvanish.api.SayanVanishAPI import org.sayandev.sayanvanish.api.User import org.sayandev.sayanvanish.api.VanishOptions @@ -29,14 +30,16 @@ open class VelocityUser( override var currentOptions = VanishOptions.defaultOptions() override var isVanished = false override var isOnline: Boolean = SayanVanishAPI.getInstance().database.hasBasicUser(uniqueId, true) - override var vanishLevel: Int = 1 + override var vanishLevel: Int = 0 get() = player()?.let { player -> val luckPermsHook = Features.getFeature() if (luckPermsHook.isActive()) { luckPermsHook.getPermissions(uniqueId) .filter { it.startsWith("sayanvanish.level.") } .maxOfOrNull { it.substringAfter("sayanvanish.level.").toIntOrNull() ?: field } - ?: field + ?: if (hasPermission(Permission.VANISH)) 1 else { + if (isVanished) 1 else field + } } else { field } diff --git a/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/feature/features/hook/FeatureHookTAB.kt b/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/feature/features/hook/FeatureHookTAB.kt index 702095f..e12dab4 100644 --- a/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/feature/features/hook/FeatureHookTAB.kt +++ b/sayanvanish-proxy/sayanvanish-proxy-velocity/src/main/kotlin/org/sayandev/sayanvanish/velocity/feature/features/hook/FeatureHookTAB.kt @@ -15,21 +15,15 @@ import org.spongepowered.configurate.objectmapping.ConfigSerializable class FeatureHookTAB: HookFeature("hook_tab", "tab") { override fun enable() { - warn("checking for tab hook") if (hasPlugin()) { - warn("found tab. registering integration...") VanishIntegrationTAB().register() - warn("registered") } super.enable() } override fun disable() { - warn("checking for tab hook") if (hasPlugin()) { - warn("found tab. unregistering integration...") VanishIntegrationTAB().unregister() - warn("unregistered") } super.disable() }