From 792eaceac1e1aa7fc6e46e3207857fa9647fe4a3 Mon Sep 17 00:00:00 2001 From: Gegy Date: Sun, 23 Jun 2024 10:26:40 +0200 Subject: [PATCH] Enable split environment source sets --- build.gradle | 4 ++++ .../game/space/IntegratedPlayerManagerMixin.java | 2 +- src/client/resources/plasmid.client.mixins.json | 12 ++++++++++++ src/main/resources/fabric.mod.json | 8 +++++++- src/main/resources/plasmid.mixins.json | 1 - 5 files changed, 24 insertions(+), 3 deletions(-) rename src/{main/java/xyz/nucleoid/plasmid => client/java/xyz/nucleoid/plasmid/client}/mixin/game/space/IntegratedPlayerManagerMixin.java (93%) create mode 100644 src/client/resources/plasmid.client.mixins.json diff --git a/build.gradle b/build.gradle index 74d2ae3c..e33b3eb3 100644 --- a/build.gradle +++ b/build.gradle @@ -76,6 +76,9 @@ repositories { } } +loom { + splitEnvironmentSourceSets() +} dependencies { minecraft "com.mojang:minecraft:${project.minecraft_version}" @@ -110,6 +113,7 @@ dependencies { modCompileOnly("dev.emi:trinkets:3.7.1") testmodImplementation sourceSets.main.output + testmodImplementation sourceSets.client.output } processResources { diff --git a/src/main/java/xyz/nucleoid/plasmid/mixin/game/space/IntegratedPlayerManagerMixin.java b/src/client/java/xyz/nucleoid/plasmid/client/mixin/game/space/IntegratedPlayerManagerMixin.java similarity index 93% rename from src/main/java/xyz/nucleoid/plasmid/mixin/game/space/IntegratedPlayerManagerMixin.java rename to src/client/java/xyz/nucleoid/plasmid/client/mixin/game/space/IntegratedPlayerManagerMixin.java index bbfb9bbf..c3500bdb 100644 --- a/src/main/java/xyz/nucleoid/plasmid/mixin/game/space/IntegratedPlayerManagerMixin.java +++ b/src/client/java/xyz/nucleoid/plasmid/client/mixin/game/space/IntegratedPlayerManagerMixin.java @@ -1,4 +1,4 @@ -package xyz.nucleoid.plasmid.mixin.game.space; +package xyz.nucleoid.plasmid.client.mixin.game.space; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import net.minecraft.server.integrated.IntegratedPlayerManager; diff --git a/src/client/resources/plasmid.client.mixins.json b/src/client/resources/plasmid.client.mixins.json new file mode 100644 index 00000000..1fd25a0d --- /dev/null +++ b/src/client/resources/plasmid.client.mixins.json @@ -0,0 +1,12 @@ +{ + "required": true, + "minVersion": "0.8", + "package": "xyz.nucleoid.plasmid.client.mixin", + "compatibilityLevel": "JAVA_17", + "client": [ + "game.space.IntegratedPlayerManagerMixin" + ], + "injectors": { + "defaultRequire": 1 + } +} diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index c0fbb3a2..ba525928 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -10,7 +10,13 @@ "entrypoints": { "main": ["xyz.nucleoid.plasmid.Plasmid"] }, - "mixins": ["plasmid.mixins.json"], + "mixins": [ + "plasmid.mixins.json", + { + "config": "plasmid.client.mixins.json", + "environment": "client" + } + ], "accessWidener": "plasmid.accesswidener", "custom": { "modmenu": { diff --git a/src/main/resources/plasmid.mixins.json b/src/main/resources/plasmid.mixins.json index b9e6c6f9..d07e8f4d 100644 --- a/src/main/resources/plasmid.mixins.json +++ b/src/main/resources/plasmid.mixins.json @@ -15,7 +15,6 @@ "game.rule.ServerPlayerEntityMixin", "game.rule.ServerPlayNetworkHandlerMixin", "game.rule.TridentEntityMixin", - "game.space.IntegratedPlayerManagerMixin", "game.space.PlayerManagerMixin", "game.space.ScreenHandlerMixin", "game.space.ServerPlayerEntityMixin"