Skip to content

Commit

Permalink
[2.2.0-beta3] Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsFlicker committed Sep 15, 2024
1 parent b2a485e commit 2b71ff6
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 38 deletions.
31 changes: 13 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ subprojects {
"bukkit-hook",
"bukkit-util",
"bukkit-ui",
"bukkit-ui-12100",
"bukkit-ui-legacy",
"bukkit-ui-modern",
"bukkit-xseries",
"bukkit-xseries-item"
)
install("database-sql")
install(
"database",
"database-alkaid-redis",
"database-player"
)
install(
"minecraft-chat",
"minecraft-command-helper",
Expand All @@ -35,26 +39,18 @@ subprojects {
"minecraft-metrics"
)
install(
"nms",
"nms-util",
"nms-util-stable",
"nms-util-unstable",
"nms-util-tag",
"nms-util-tag-12005",
"nms-util-tag-legacy",
)
install(
"database-alkaid-redis",
"database-player",
"script-javascript"
"bukkit-nms",
"bukkit-nms-stable",
"bukkit-nms-tag",
"bukkit-nms-tag-12005",
"bukkit-nms-tag-legacy",
)
install("script-javascript")
install(BUKKIT, BUNGEE, VELOCITY)
install("platform-bukkit-impl")
forceDownloadInDev = false
repoTabooLib = "http://mcitd.cn:8081/repository/releases"
}
version {
taboolib = "6.2.0-beta5-dev"
taboolib = "6.2.0-beta5"
coroutines = null
// isSkipKotlin = true
// isSkipKotlinRelocate = true
Expand All @@ -65,7 +61,6 @@ subprojects {
repositories {
mavenLocal()
mavenCentral()
maven("http://mcitd.cn:8081/repository/releases") { isAllowInsecureProtocol = true }
maven("https://jitpack.io")
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://papermc.io/repo/repository/maven-public/")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=me.arasple.mc.trchat
version=2.2.0-beta2
version=2.2.0-beta3
kotlin.incremental=true
kotlin.incremental.java=true
kotlin.incremental.useClasspathSnapshot=true
Expand Down
2 changes: 1 addition & 1 deletion project/module-compat/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {

compileOnly("com.discordsrv:discordsrv:1.26.0") { isTransitive = false }
compileOnly("com.willfp:eco:6.35.1") { isTransitive = false }
compileOnly("com.github.LoneDev6:api-itemsadder:3.6.2-beta-r3-b") { isTransitive = false }
compileOnly("com.github.LoneDev6:api-itemsadder:3.6.3-beta-14") { isTransitive = false }
compileOnly("xyz.xenondevs.nova:nova-api:0.12.13") { isTransitive = false }
compileOnly("io.th0rgal:oraxen:1.170.0") { isTransitive = false }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ class HookItemsAdder : HookAbstract() {
if (!isHooked) {
return message
}
return if (player == null) {
FontImageWrapper.replaceFontImages(message)
} else {
FontImageWrapper.replaceFontImages(player, message)
try {
return if (player == null) {
FontImageWrapper.replaceFontImages(message)
} else {
FontImageWrapper.replaceFontImages(player, message)
}
} catch (_: Throwable) {
return message
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.bukkit.entity.Player
import org.bukkit.inventory.ItemStack
import taboolib.common.util.unsafeLazy
import taboolib.module.chat.ComponentText
import taboolib.module.nms.LocaleKey
import taboolib.module.nms.MinecraftLanguage
import taboolib.module.nms.MinecraftVersion
import taboolib.module.nms.nmsProxy
import java.util.*
Expand All @@ -27,7 +27,7 @@ abstract class NMS {

abstract fun optimizeNBT(itemStack: ItemStack, nbtWhitelist: Array<String> = whitelistTags): ItemStack

abstract fun getLocaleKey(itemStack: ItemStack): LocaleKey
abstract fun getLocaleKey(itemStack: ItemStack): MinecraftLanguage.LanguageKey

companion object {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import org.bukkit.inventory.ItemStack
import taboolib.common.platform.function.adaptPlayer
import taboolib.library.reflex.Reflex.Companion.invokeConstructor
import taboolib.module.chat.ComponentText
import taboolib.module.nms.LocaleKey
import taboolib.module.nms.MinecraftLanguage
import taboolib.module.nms.MinecraftVersion.isUniversal
import taboolib.module.nms.MinecraftVersion.majorLegacy
import taboolib.module.nms.NMSItem
import taboolib.module.nms.NMSItemTag
import taboolib.module.nms.nmsProxy
import taboolib.module.nms.sendPacket
import taboolib.platform.Folia
Expand Down Expand Up @@ -130,9 +130,9 @@ class NMSImpl : NMS() {
return itemStack
}

override fun getLocaleKey(itemStack: ItemStack): LocaleKey {
val nmsItemStack = nmsProxy<NMSItem>().getNMSCopy(itemStack) as net.minecraft.server.v1_16_R3.ItemStack
override fun getLocaleKey(itemStack: ItemStack): MinecraftLanguage.LanguageKey {
val nmsItemStack = nmsProxy<NMSItemTag>().getNMSCopy(itemStack) as net.minecraft.server.v1_16_R3.ItemStack
val nmsItem = nmsItemStack.item
return LocaleKey("N", nmsItem.f(nmsItemStack))
return MinecraftLanguage.LanguageKey(MinecraftLanguage.LanguageKey.Type.NORMAL, nmsItem.f(nmsItemStack))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.bukkit.entity.Player
import org.bukkit.inventory.ItemStack
import taboolib.common.platform.function.adaptPlayer
import taboolib.module.chat.ComponentText
import taboolib.module.nms.LocaleKey
import taboolib.module.nms.MinecraftLanguage
import java.util.*

class NMSImpl12100 : NMS() {
Expand All @@ -29,7 +29,7 @@ class NMSImpl12100 : NMS() {
TODO("Not yet implemented")
}

override fun getLocaleKey(itemStack: ItemStack): LocaleKey {
override fun getLocaleKey(itemStack: ItemStack): MinecraftLanguage.LanguageKey {
TODO("Not yet implemented")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ import taboolib.module.chat.Components
import taboolib.module.chat.impl.DefaultComponent
import taboolib.module.configuration.ConfigNode
import taboolib.module.configuration.ConfigNodeTransfer
import taboolib.module.nms.*
import taboolib.module.nms.MinecraftVersion
import taboolib.module.nms.getI18nName
import taboolib.module.nms.getKey
import taboolib.module.nms.getLanguageKey
import taboolib.module.ui.buildMenu
import taboolib.module.ui.type.Chest
import taboolib.module.ui.type.PageableChest
Expand Down Expand Up @@ -218,7 +221,7 @@ object ItemShow : Function("ITEM") {
} else {
try {
if (MinecraftVersion.isHigherOrEqual(MinecraftVersion.V1_15)) {
Components.translation(getLocaleKey().path)
Components.translation(getLanguageKey().path)
} else {
Components.text(getI18nName(player))
}
Expand All @@ -228,7 +231,7 @@ object ItemShow : Function("ITEM") {
Components.translation(NMS.instance.getLocaleKey(this).path)
} catch (_: Throwable) {
try {
Components.text(nmsProxy<NMSItem>().getKey(this))
Components.text(getKey())
} catch (_: Throwable) {
Components.text(type.name)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import taboolib.common.LifeCycle
import taboolib.common.platform.*
import taboolib.common.platform.function.console
import taboolib.common.platform.function.pluginVersion
import taboolib.common.platform.function.warning
import taboolib.module.lang.sendLang
import taboolib.module.nms.MinecraftVersion.majorLegacy
import taboolib.module.nms.disablePacketListener
Expand Down Expand Up @@ -64,7 +63,6 @@ object TrChatBukkit : Plugin() {
HookPlugin.printInfo()
reload(console())
console().sendLang("Plugin-Enabled", pluginVersion)
warning("In this version, some functions do not work!")
}

override fun onDisable() {
Expand Down

0 comments on commit 2b71ff6

Please sign in to comment.