diff --git a/build.gradle.kts b/build.gradle.kts index 8260f8b..212d0b3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -58,6 +58,10 @@ tasks { shadowJar { archiveFileName.set("${project.name}-${project.version}.jar") + manifest { + attributes["paperweight-mappings-namespace"] = "mojang" + } + val libs = "${project.group}.${project.name.lowercase()}.lib" relocate("org.objenesis", "$libs.objenesis") relocate("net.swiftzer.semver", "$libs.semver") @@ -99,7 +103,7 @@ tasks { projectId = property("modrinth.project") as String? uploadFile = shadowJar.get() gameVersions = mapVersions("modrinth.versions") - loaders = arrayListOf("bukkit", "spigot", "paper", "folia") + loaders = arrayListOf("bukkit", "spigot", "paper", "folia", "purpur") changelog = generateChangelog() syncBodyFrom = file("README.md").readText() @@ -132,4 +136,4 @@ fun generateChangelog(): Provider = provider { }.toString(Charsets.UTF_8.name()) return@provider changelog -} \ No newline at end of file +} diff --git a/bukkit/protocol/common/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/ChannelInjector.kt b/bukkit/protocol/common/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/ChannelInjector.kt index 3cd278e..5271442 100644 --- a/bukkit/protocol/common/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/ChannelInjector.kt +++ b/bukkit/protocol/common/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/ChannelInjector.kt @@ -20,12 +20,15 @@ class ChannelInjector { try { val craftPlayer = Reflection.getClass("${Utils.OBC}.entity.CraftPlayer") val entityPlayer = Reflection.findClass( + "net.minecraft.server.level.ServerPlayer", "net.minecraft.server.level.EntityPlayer", "${Utils.NMS}.EntityPlayer" ) val playerConnection = Reflection.findClass( + "net.minecraft.server.network.ServerGamePacketListenerImpl", "net.minecraft.server.network.PlayerConnection", "${Utils.NMS}.PlayerConnection" ) val networkManager = Reflection.findClass( + "net.minecraft.network.Connection", "net.minecraft.network.NetworkManager", "${Utils.NMS}.NetworkManager" ) @@ -59,4 +62,4 @@ class ChannelInjector { } } } -} \ No newline at end of file +} diff --git a/bukkit/protocol/legacy/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/legacy/packet/WrappedUpdateObjective.kt b/bukkit/protocol/legacy/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/legacy/packet/WrappedUpdateObjective.kt index 1a6ece4..68c0c6f 100644 --- a/bukkit/protocol/legacy/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/legacy/packet/WrappedUpdateObjective.kt +++ b/bukkit/protocol/legacy/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/legacy/packet/WrappedUpdateObjective.kt @@ -26,7 +26,7 @@ data class WrappedUpdateObjective( ) val enumScoreboardHealthDisplay = Reflection.getClass( - "${Utils.NMS}.IScoreboardCriteria\$EnumScoreboardHealthDisplay" + $$"$${Utils.NMS}.IScoreboardCriteria$EnumScoreboardHealthDisplay" ) nameField = Reflection.getField(packetPlayOutScoreboardObjective, String::class.java, 0) @@ -54,4 +54,4 @@ data class WrappedUpdateObjective( if (type != null) typeField.set(handle, typeFieldEnums[type.id]) if (displayName != null) displayNameField.set(handle, displayName) } -} \ No newline at end of file +} diff --git a/bukkit/protocol/legacy/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/legacy/packet/WrappedUpdateScore.kt b/bukkit/protocol/legacy/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/legacy/packet/WrappedUpdateScore.kt index de71f21..7fdb2bf 100644 --- a/bukkit/protocol/legacy/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/legacy/packet/WrappedUpdateScore.kt +++ b/bukkit/protocol/legacy/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/legacy/packet/WrappedUpdateScore.kt @@ -26,7 +26,7 @@ data class WrappedUpdateScore( ) val enumScoreboardAction = Reflection.getClass( - "${Utils.NMS}.PacketPlayOutScoreboardScore\$EnumScoreboardAction" + $$"$${Utils.NMS}.PacketPlayOutScoreboardScore$EnumScoreboardAction" ) objectiveNameField = Reflection.getField(packetPlayOutScoreboardScore, String::class.java, 1) diff --git a/bukkit/protocol/modern/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/modern/packet/WrappedUpdateObjective.kt b/bukkit/protocol/modern/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/modern/packet/WrappedUpdateObjective.kt index 173eed1..efee41e 100644 --- a/bukkit/protocol/modern/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/modern/packet/WrappedUpdateObjective.kt +++ b/bukkit/protocol/modern/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/modern/packet/WrappedUpdateObjective.kt @@ -40,8 +40,9 @@ data class WrappedUpdateObjective( packetInstantiator = Utils.getInstantiatorOf(packetPlayOutScoreboardObjective) val enumScoreboardHealthDisplay = Reflection.findClass( - "net.minecraft.world.scores.criteria.IScoreboardCriteria\$EnumScoreboardHealthDisplay", - "${Utils.NMS}.IScoreboardCriteria\$EnumScoreboardHealthDisplay" + $$"net.minecraft.world.scores.criteria.ObjectiveCriteria$RenderType", + $$"net.minecraft.world.scores.criteria.IScoreboardCriteria$EnumScoreboardHealthDisplay", + $$"$${Utils.NMS}.IScoreboardCriteria$EnumScoreboardHealthDisplay" ) nameField = Reflection.getField(packetPlayOutScoreboardObjective, String::class.java) diff --git a/bukkit/protocol/modern/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/modern/packet/WrappedUpdateScore.kt b/bukkit/protocol/modern/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/modern/packet/WrappedUpdateScore.kt index 72ee621..7b8d1ce 100644 --- a/bukkit/protocol/modern/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/modern/packet/WrappedUpdateScore.kt +++ b/bukkit/protocol/modern/src/main/kotlin/com/r4g3baby/simplescore/bukkit/protocol/modern/packet/WrappedUpdateScore.kt @@ -56,7 +56,8 @@ data class WrappedUpdateScore( } } else { val enumAction = Reflection.findClass( - "net.minecraft.server.ScoreboardServer\$Action", "${Utils.NMS}.ScoreboardServer\$Action" + $$"net.minecraft.server.ServerScoreboard$Method", + $$"net.minecraft.server.ScoreboardServer$Action", $$"$${Utils.NMS}.ScoreboardServer$Action" ) actionField = Reflection.getField(packetPlayOutScoreboardScore, enumAction) @@ -89,4 +90,4 @@ data class WrappedUpdateScore( if (numberFormat != null) numberFormatField?.set(handle, numberFormat.handle) } } -} \ No newline at end of file +}