Skip to content

Commit

Permalink
[6.2.0] 调整 AppConsole#sendMessage 函数,调整记分板逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
Bkm016 committed Oct 23, 2024
1 parent 3a49e58 commit 524d729
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=taboolib
version=6.2.0-beta21
version=6.2.0-beta22
kotlin.incremental=true
kotlin.incremental.java=true
kotlin.caching.enabled=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,25 +520,13 @@ class NMSScoreboardImpl : NMSScoreboard() {
player.sendPacket(PacketPlayOutScoreboardScore::class.java.invokeConstructor(uniqueOwner[i], objectiveName, i, null, null))
return@forEach
}
// 1.20.1, 1.20.2
if (MinecraftVersion.majorLegacy > 12000) {
player.sendPacket(
net.minecraft.server.v1_16_R3.PacketPlayOutScoreboardScore(
net.minecraft.server.v1_16_R3.ScoreboardServer.Action.CHANGE,
objectiveName,
uniqueOwner[i], // 麻将小天才
i
)
)
return@forEach
}
// 1.13+ 直接实例化
if (MinecraftVersion.isHigherOrEqual(MinecraftVersion.V1_13)) {
player.sendPacket(
net.minecraft.server.v1_16_R3.PacketPlayOutScoreboardScore(
net.minecraft.server.v1_16_R3.ScoreboardServer.Action.CHANGE,
uniqueOwner[i],
objectiveName,
uniqueOwner[i],
i
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ object AppConsole : SimpleTerminalConsole(), ProxyCommandSender {
}

override fun sendMessage(message: String) {
info(message)
// 移除颜色代码
if (message.contains("§")) {
info(message.replace("§[0-9a-fA-F]", ""))
} else {
info(message)
}
}
}

0 comments on commit 524d729

Please sign in to comment.