Skip to content

Commit

Permalink
3.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
toxicity188 committed Dec 6, 2024
1 parent b2f7034 commit 8802254
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 10 deletions.
13 changes: 7 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ allprojects {
apply(plugin = "kotlin")
apply(plugin = "org.jetbrains.dokka")
group = "kr.toxicity.healthbar"
version = "3.7"
version = "3.7.1"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
Expand Down Expand Up @@ -76,10 +76,11 @@ val dist = getApiDependencyProject("dist").spigot()
.dependency("io.lumine:Mythic-Dist:5.7.2")
.dependency("io.github.arcaneplugins:levelledmobs-plugin:4.0.3.1")
.dependency("me.clip:placeholderapi:2.11.6")
.dependency("io.github.toxicity188:BetterHud-standard-api:1.9.2")
.dependency("io.github.toxicity188:BetterHud-bukkit-api:1.9.2")
.dependency("com.alessiodp.parties:parties-bukkit:3.2.16")
.dependency("io.github.toxicity188:BetterHud-standard-api:1.10")
.dependency("io.github.toxicity188:BetterHud-bukkit-api:1.10")
.dependency("net.citizensnpcs:citizens-main:2.0.35-SNAPSHOT")
.dependency("com.github.SkriptLang:Skript:2.9.4")
.dependency("com.github.SkriptLang:Skript:2.9.5")
.also {
it.tasks.processResources {
filteringCharset = Charsets.UTF_8.name()
Expand Down Expand Up @@ -160,9 +161,9 @@ tasks {
version("1.21.1") //TODO set this to 'minecraft' when other plugins support the latest version.
pluginJars(fileTree("plugins"))
downloadPlugins {
hangar("BetterHud", "1.9.2.DEV-312")
hangar("BetterHud", "1.10")
hangar("PlaceholderAPI", "2.11.6")
hangar("Skript", "2.9.4")
hangar("Skript", "2.9.5")
}
}
shadowJar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ class CitizensCompatibility : Compatibility {
override fun accept() {
PlaceholderContainer.BOOL.addPlaceholder("citizens_npc", placeholder(0) {
Function {
val entity = it.entity.entity()
CitizensAPI.getNPCRegistries().any { r ->
r.isNPC(entity)
}
CitizensAPI.getNPCRegistry().getByUniqueIdGlobal(it.entity.entity().uniqueId) != null
}
})
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package kr.toxicity.healthbar.compatibility

import com.alessiodp.parties.bukkit.BukkitPartiesPlugin
import kr.toxicity.healthbar.api.placeholder.PlaceholderContainer
import kr.toxicity.healthbar.util.placeholder
import org.bukkit.Bukkit
import java.util.function.Function

class PartiesCompatibility : Compatibility {
override fun accept() {
val parties = Class.forName("com.alessiodp.parties.core.bukkit.bootstrap.ADPBukkitBootstrap").getDeclaredField("plugin").run {
isAccessible = true
get(Bukkit.getPluginManager().getPlugin("Parties"))
} as BukkitPartiesPlugin
PlaceholderContainer.BOOL.addPlaceholder("parties_is_leader", placeholder(0) {
Function get@ {
val uuid = it.entity.entity().uniqueId
val player = parties.playerManager.getPlayer(uuid) ?: return@get false
val party = parties.partyManager.getPartyOfPlayer(player) ?: return@get false
party.leader == player.playerUUID
}
})
PlaceholderContainer.BOOL.addPlaceholder("parties_is_member", placeholder(0) {
Function get@{
val my = parties.playerManager.getPlayer(it.player.player().uniqueId)?.partyId ?: return@get false
val other = parties.playerManager.getPlayer(it.entity.entity().uniqueId)?.partyId ?: return@get false
my == other
}
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ object CompatibilityManager : BetterHealthBerManager {
"Skript" to {
SkriptCompatibility()
},
"Parties" to {
PartiesCompatibility()
},
"LevelledMobs" to {
LevelledMobsCompatibility()
}
Expand Down
1 change: 1 addition & 0 deletions dist/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ softdepend:
- skript-placeholders
- skript-reflect
- LevelledMobs
- Parties
commands:
healthbar:
aliases: hb
Expand Down

0 comments on commit 8802254

Please sign in to comment.