diff --git a/buildSrc/src/main/kotlin/PlatformConfig.kt b/buildSrc/src/main/kotlin/PlatformConfig.kt index 7c50840..7d0ef46 100644 --- a/buildSrc/src/main/kotlin/PlatformConfig.kt +++ b/buildSrc/src/main/kotlin/PlatformConfig.kt @@ -2,8 +2,6 @@ import org.gradle.api.Project import org.gradle.api.tasks.SourceSetContainer import org.gradle.api.tasks.bundling.Jar import org.gradle.api.tasks.compile.JavaCompile -import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.get import org.gradle.kotlin.dsl.getByType import org.gradle.kotlin.dsl.named @@ -25,7 +23,7 @@ fun Project.setupPlatform() { testmod.apply { val root = rootSourceSets["testmod"] compileClasspath += main.compileClasspath + main.output + root.output - runtimeClasspath += main.runtimeClasspath + main.output + root.output + runtimeClasspath += main.runtimeClasspath + main.output } } @@ -37,6 +35,10 @@ fun Project.setupPlatform() { source(rootSourceSets["main"].allJava) } + tasks.named("compileTestmodJava") { + source(rootSourceSets["testmod"].allJava) + } + tasks.named("sourcesJar") { from(rootSourceSets["main"].allSource) } diff --git a/gradle.properties b/gradle.properties index e550c62..b451ded 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,15 @@ org.gradle.jvmargs = -Xmx3G -minecraft = 1.20.5 +minecraft = 1.20.6 archiveBaseName = badpackets group = lol.bai majorVersion = 0 fabricLoader = 0.15.10 -fabricApi = 0.97.6+1.20.5 -forge = 49.0.19 -neo = 20.5.0-beta +fabricApi = 0.97.8+1.20.6 +forge = 50.0.0 +neo = 20.6.11-beta cf.projectId = 615134 mr.projectId = ftdbN0KK diff --git a/platform/fabric/gradle.properties b/platform/fabric/gradle.properties index 41dff78..43ffd80 100644 --- a/platform/fabric/gradle.properties +++ b/platform/fabric/gradle.properties @@ -3,9 +3,9 @@ cf.endpoint = minecraft.curseforge.com cf.prefix = [Fabric/Quilt] cf.releaseType = stable cf.loader = Fabric, Quilt -cf.gameVersion = 1.20.5 +cf.gameVersion = 1.20.5, 1.20.6 # Modrinth mr.releaseType = stable mr.loader = fabric, quilt -mr.gameVersion = 1.20.5 +mr.gameVersion = 1.20.5, 1.20.6 diff --git a/platform/forge/build.gradle.kts b/platform/forge/build.gradle.kts index 0b6a1f3..6cd69ee 100644 --- a/platform/forge/build.gradle.kts +++ b/platform/forge/build.gradle.kts @@ -1,21 +1,34 @@ import net.minecraftforge.gradle.common.util.RunConfig plugins { - id("net.minecraftforge.gradle") version "[6.0, 6.2)" - id("org.spongepowered.mixin") version "0.7.+" + id("net.minecraftforge.gradle") version "6.0.24" + id("org.spongepowered.mixin") version "0.7.38" } setupPlatform() repositories { maven("https://maven.minecraftforge.net") + maven("https://maven.fabricmc.net/") + mavenCentral() } +jarJar.enable() + dependencies { minecraft("net.minecraftforge:forge:${rootProp["minecraft"]}-${rootProp["forge"]}") implementation("org.jetbrains:annotations:19.0.0") - annotationProcessor("org.spongepowered:mixin:0.8.5:processor") + annotationProcessor("net.fabricmc:sponge-mixin:0.13.4+mixin.0.8.5") + + compileOnly("io.github.llamalad7:mixinextras-common:0.3.5") + annotationProcessor("io.github.llamalad7:mixinextras-common:0.3.5") + implementation(jarJar("io.github.llamalad7:mixinextras-forge:0.3.5")) { + jarJar.ranged(this, "[0.3.5,)") + } + + // https://github.com/MinecraftForge/MinecraftForge/blob/7b782e5b05d0059836b39fa072d49f63679d1782/mdk/build.gradle#L143C5-L143C92 + implementation("net.sf.jopt-simple:jopt-simple:5.0.4") { version { strictly("5.0.4") } } } minecraft { @@ -29,12 +42,10 @@ minecraft { mods { create("badpackets") { source(sourceSets["main"]) - source(rootProject.sourceSets["main"]) } - create("badpackets_test") { + create("badpackets_testmod") { source(sourceSets["testmod"]) - source(rootProject.sourceSets["testmod"]) } } } diff --git a/platform/forge/gradle.properties b/platform/forge/gradle.properties index 9348f74..74e1a8e 100644 --- a/platform/forge/gradle.properties +++ b/platform/forge/gradle.properties @@ -3,9 +3,9 @@ cf.endpoint = minecraft.curseforge.com cf.prefix = [Forge] cf.releaseType = beta cf.loader = Forge -cf.gameVersion = 1.20.4 +cf.gameVersion = 1.20.6 # Modrinth -mr.releaseType = release +mr.releaseType = stable mr.loader = forge -mr.gameVersion = 1.20.4 +mr.gameVersion = 1.20.6 diff --git a/platform/forge/src/main/java/lol/bai/badpackets/impl/forge/ForgeProxy.java b/platform/forge/src/main/java/lol/bai/badpackets/impl/forge/ForgeProxy.java deleted file mode 100644 index bb4ac90..0000000 --- a/platform/forge/src/main/java/lol/bai/badpackets/impl/forge/ForgeProxy.java +++ /dev/null @@ -1,37 +0,0 @@ -package lol.bai.badpackets.impl.forge; - -import java.util.Set; -import java.util.function.Supplier; - -import lol.bai.badpackets.impl.Constants; -import lol.bai.badpackets.impl.platform.PlatformProxy; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.network.protocol.Packet; -import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket; -import net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket; -import net.minecraft.network.protocol.common.custom.DiscardedPayload; -import net.minecraft.resources.ResourceLocation; - -public class ForgeProxy extends PlatformProxy { - - @Override - public Packet createVanillaRegisterConfigS2CPacket(Set channels, Supplier buf) { - return new ClientboundCustomPayloadPacket(new DiscardedPayload(Constants.MC_REGISTER_CHANNEL, buf.get())); - } - - @Override - public Packet createVanillaRegisterConfigC2SPacket(Set channels, Supplier buf) { - return new ServerboundCustomPayloadPacket(new DiscardedPayload(Constants.MC_REGISTER_CHANNEL, buf.get())); - } - - @Override - public Packet createVanillaRegisterPlayS2CPacket(Set channels, Supplier buf) { - return new ClientboundCustomPayloadPacket(new DiscardedPayload(Constants.MC_REGISTER_CHANNEL, buf.get())); - } - - @Override - public Packet createVanillaRegisterPlayC2SPacket(Set channels, Supplier buf) { - return new ServerboundCustomPayloadPacket(new DiscardedPayload(Constants.MC_REGISTER_CHANNEL, buf.get())); - } - -} diff --git a/platform/forge/src/main/resources/META-INF/mods.toml b/platform/forge/src/main/resources/META-INF/mods.toml index a8f1325..9a699fe 100644 --- a/platform/forge/src/main/resources/META-INF/mods.toml +++ b/platform/forge/src/main/resources/META-INF/mods.toml @@ -16,6 +16,6 @@ logoFile = "badpackets.png" [[dependencies.badpackets]] modId = "minecraft" mandatory = true -versionRange = "[1.20.4,)" +versionRange = "[1.20.6,)" ordering = "NONE" side = "BOTH" diff --git a/platform/forge/src/main/resources/META-INF/services/lol.bai.badpackets.impl.platform.PlatformProxy b/platform/forge/src/main/resources/META-INF/services/lol.bai.badpackets.impl.platform.PlatformProxy deleted file mode 100644 index 4513dc9..0000000 --- a/platform/forge/src/main/resources/META-INF/services/lol.bai.badpackets.impl.platform.PlatformProxy +++ /dev/null @@ -1 +0,0 @@ -lol.bai.badpackets.impl.forge.ForgeProxy diff --git a/platform/forge/src/testmod/java/lol/bai/badpackets/test/forge/ForgeBadPacketTest.java b/platform/forge/src/testmod/java/lol/bai/badpackets/test/forge/ForgeBadPacketTest.java index b6652f2..efae34f 100644 --- a/platform/forge/src/testmod/java/lol/bai/badpackets/test/forge/ForgeBadPacketTest.java +++ b/platform/forge/src/testmod/java/lol/bai/badpackets/test/forge/ForgeBadPacketTest.java @@ -16,7 +16,7 @@ public class ForgeBadPacketTest { @SubscribeEvent static void setup(FMLCommonSetupEvent event) { - BadPacketTest.server(); + BadPacketTest.common(); } } diff --git a/platform/neo/build.gradle.kts b/platform/neo/build.gradle.kts index 9fc050e..f1b43d8 100644 --- a/platform/neo/build.gradle.kts +++ b/platform/neo/build.gradle.kts @@ -29,10 +29,6 @@ tasks.processResources { } } -tasks.named("compileTestmodJava") { - source(rootProject.sourceSets["testmod"].allSource) -} - afterEvaluate { val jar = tasks.jar.get() val sourcesJar = tasks.sourcesJar.get() diff --git a/platform/neo/gradle.properties b/platform/neo/gradle.properties index 62eb7aa..c29227d 100644 --- a/platform/neo/gradle.properties +++ b/platform/neo/gradle.properties @@ -3,9 +3,9 @@ cf.endpoint = minecraft.curseforge.com cf.prefix = [NeoForge] cf.releaseType = beta cf.loader = NeoForge -cf.gameVersion = 1.20.5 +cf.gameVersion = 1.20.5, 1.20.6 # Modrinth mr.releaseType = stable mr.loader = neoforge -mr.gameVersion = 1.20.5 +mr.gameVersion = 1.20.5, 1.20.6 diff --git a/settings.gradle.kts b/settings.gradle.kts index c0eca01..eb51772 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -30,5 +30,5 @@ fun platform(name: String) { platform("mojmap") platform("fabric") -//platform("forge") +platform("forge") platform("neo")