Skip to content

Commit

Permalink
feat: 1.21 forge
Browse files Browse the repository at this point in the history
  • Loading branch information
Apehum committed Jul 9, 2024
1 parent 94bc507 commit d704490
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 40 deletions.
2 changes: 2 additions & 0 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ dependencies {
tasks {
shadowJar {
archiveClassifier = "all"

exclude("classpath.index")
relocate("net.kyori", "su.plo.slib.libs.adventure")
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
val egtVersion = "0.6.0-SNAPSHOT"
val egtVersion = "0.7.0-SNAPSHOT"
id("gg.essential.defaults") version egtVersion
id("gg.essential.multi-version.root") version egtVersion
}
Expand Down

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions versions/1.21-forge/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
essential.defaults.loom.forge=net.minecraftforge:forge:1.21-51.0.22
2 changes: 2 additions & 0 deletions versions/root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ preprocess {

val fabric12100 = createNode("1.21-fabric", 12100, "official")
val neoForge12100 = createNode("1.21-neoforge", 12100, "official")
val forge12100 = createNode("1.21-forge", 12100, "official")

val fabric12006 = createNode("1.20.6-fabric", 12006, "official")

Expand Down Expand Up @@ -37,6 +38,7 @@ preprocess {

neoForge12100.link(fabric12006)
fabric12100.link(fabric12006)
forge12100.link(forge12004)

fabric12006.link(fabric12004)

Expand Down
28 changes: 28 additions & 0 deletions versions/src/main/kotlin/su/plo/slib/mod/channel/ByteArrayCodec.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//#if MC>=12005
//$$ package su.plo.slib.mod.channel
//$$
//$$ import net.minecraft.network.RegistryFriendlyByteBuf
//$$ import net.minecraft.network.codec.StreamCodec
//$$ import net.minecraft.network.protocol.common.custom.CustomPacketPayload
//$$ import net.minecraft.resources.ResourceLocation
//$$
//$$ class ByteArrayCodec(
//$$ channelKey: ResourceLocation
//$$ ) : StreamCodec<RegistryFriendlyByteBuf, ByteArrayPayload> {
//$$
//$$ val type = CustomPacketPayload.Type<ByteArrayPayload>(channelKey)
//$$
//$$ override fun decode(buf: RegistryFriendlyByteBuf): ByteArrayPayload {
//$$ val length = buf.readableBytes()
//$$
//$$ val data = ByteArray(length)
//$$ buf.readBytes(data)
//$$
//$$ return ByteArrayPayload(type, data)
//$$ }
//$$
//$$ override fun encode(buf: RegistryFriendlyByteBuf, payload: ByteArrayPayload) {
//$$ buf.writeBytes(payload.data)
//$$ }
//$$ }
//#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//#if MC>=12005
//$$ package su.plo.slib.mod.channel
//$$
//$$ import net.minecraft.network.protocol.common.custom.CustomPacketPayload
//$$
//$$ class ByteArrayPayload(
//$$ private val type: CustomPacketPayload.Type<ByteArrayPayload>,
//$$ val data: ByteArray
//$$ ) : CustomPacketPayload {
//$$
//$$ override fun type(): CustomPacketPayload.Type<ByteArrayPayload> = type
//$$ }
//#endif
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ class ModChannelManager : McServerChannelManager {
//$$ private val codecs: MutableMap<ResourceLocation, ByteArrayCodec> = HashMap()
//$$
//$$ fun getOrRegisterCodec(channelKey: ResourceLocation): ByteArrayCodec = codecs.computeIfAbsent(channelKey) {
//$$ println("Register $channelKey")
//$$ ByteArrayCodec(channelKey)
//#if FABRIC
//$$ .also {
Expand Down

0 comments on commit d704490

Please sign in to comment.