From 013fe1199bdb28e2d0311d08da554067a9f46130 Mon Sep 17 00:00:00 2001 From: btwonion Date: Mon, 9 Sep 2024 21:42:30 +0200 Subject: [PATCH] support forge and neoforge --- .../kotlin/dev/nyon/bbm/BetterBoatMovement.kt | 65 ------------------- versions/1.20.1/gradle.properties | 10 --- versions/1.20.4/gradle.properties | 10 --- versions/1.20.6/gradle.properties | 10 --- versions/1.21/gradle.properties | 10 --- 5 files changed, 105 deletions(-) delete mode 100644 src/main/kotlin/dev/nyon/bbm/BetterBoatMovement.kt delete mode 100644 versions/1.20.1/gradle.properties delete mode 100644 versions/1.20.4/gradle.properties delete mode 100644 versions/1.20.6/gradle.properties delete mode 100644 versions/1.21/gradle.properties diff --git a/src/main/kotlin/dev/nyon/bbm/BetterBoatMovement.kt b/src/main/kotlin/dev/nyon/bbm/BetterBoatMovement.kt deleted file mode 100644 index fa2cafa..0000000 --- a/src/main/kotlin/dev/nyon/bbm/BetterBoatMovement.kt +++ /dev/null @@ -1,65 +0,0 @@ -package dev.nyon.bbm - -import dev.nyon.bbm.config.Config -import dev.nyon.bbm.config.migrate -import dev.nyon.konfig.config.config -import dev.nyon.konfig.config.loadConfig -import net.fabricmc.api.EnvType -import net.fabricmc.api.ModInitializer -import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents -import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking -//? if >=1.20.5 -import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry -import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents -import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking -import net.fabricmc.loader.api.FabricLoader -import dev.nyon.bbm.config.config as internalConfig - -var serverConfig: Config? = null - -@Suppress("unused") -object BetterBoatMovement : ModInitializer { - override fun onInitialize() { - instantiateConfig() - //? if >=1.20.5 - PayloadTypeRegistry.playS2C().register(Config.packetType, Config.codec) - when (FabricLoader.getInstance().environmentType) { - EnvType.CLIENT -> { - /*? if <1.20.5 {*//*ClientPlayNetworking.registerGlobalReceiver(Config.packetType.id) { _, _, buf, _ -> - serverConfig = Config.packetType.read(buf) - } - *//*?} else {*/ - ClientPlayConnectionEvents.INIT.register { _, _ -> - ClientPlayNetworking.registerReceiver(Config.packetType) { packet, _ -> - serverConfig = packet - } - }/*?}*/ - - ClientPlayConnectionEvents.DISCONNECT.register { _, _ -> - serverConfig = null - } - } - EnvType.SERVER -> { - serverConfig = internalConfig - - ServerPlayConnectionEvents.INIT.register { handler, _ -> - ServerPlayNetworking.send(handler.player, internalConfig) - } - } - else -> {} - } - } - - private fun instantiateConfig() { - config( - FabricLoader.getInstance().configDir.resolve("better-boat-movement.json"), - 3, - Config() - ) { element, version -> migrate(element, version) } - internalConfig = loadConfig() - } - - fun saveConfig() { - dev.nyon.konfig.config.saveConfig(internalConfig) - } -} diff --git a/versions/1.20.1/gradle.properties b/versions/1.20.1/gradle.properties deleted file mode 100644 index 3df67f3..0000000 --- a/versions/1.20.1/gradle.properties +++ /dev/null @@ -1,10 +0,0 @@ -mcVersion=1.20.1 -mcVersionRange=>=1.20 <=1.20.3 -supportedMcVersions=1.20,1.20.1 - -deps.parchment= -deps.fapi=0.92.1+1.20.1 -deps.yacl=3.5.0+1.20.1-fabric -deps.modMenu=7.2.2 - -javaVer=17 diff --git a/versions/1.20.4/gradle.properties b/versions/1.20.4/gradle.properties deleted file mode 100644 index de22d23..0000000 --- a/versions/1.20.4/gradle.properties +++ /dev/null @@ -1,10 +0,0 @@ -mcVersion=1.20.4 -mcVersionRange=>=1.20.3 <=1.20.4 -supportedMcVersions=1.20.4 - -deps.parchment= -deps.fapi=0.97.0+1.20.4 -deps.yacl=3.5.0+1.20.4-fabric -deps.modMenu=9.2.0-beta.2 - -javaVer=17 diff --git a/versions/1.20.6/gradle.properties b/versions/1.20.6/gradle.properties deleted file mode 100644 index b00b33f..0000000 --- a/versions/1.20.6/gradle.properties +++ /dev/null @@ -1,10 +0,0 @@ -mcVersion=1.20.6 -mcVersionRange=>=1.20.5 <=1.20.6 -supportedMcVersions=1.20.5,1.20.6 - -deps.parchment= -deps.fapi=0.97.8+1.20.6 -deps.yacl=3.5.0+1.20.6-fabric -deps.modMenu=10.0.0-beta.1 - -javaVer=21 diff --git a/versions/1.21/gradle.properties b/versions/1.21/gradle.properties deleted file mode 100644 index 42c32c4..0000000 --- a/versions/1.21/gradle.properties +++ /dev/null @@ -1,10 +0,0 @@ -mcVersion=1.21 -mcVersionRange=>=1.20.6 <=1.21 -supportedMcVersions=1.21 - -deps.parchment= -deps.fapi=0.100.1+1.21 -deps.yacl=3.5.0+1.21-fabric -deps.modMenu=11.0.0-beta.1 - -javaVer=21 \ No newline at end of file