From ca672e74445000df955e2f38c39f516412f54e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaspar=20Sunek=C3=A6r?= Date: Wed, 19 Jun 2024 16:42:15 +0200 Subject: [PATCH] Fix crash --- CHANGELOG.md | 6 ++++++ .../mixin/WorldOpenFlowsMixin.java | 9 --------- .../mixin/WorldOpenFlowsMixinFabric.java | 19 ++++++++++++++++++ gradle.properties | 6 +++--- .../neo/mixin/WorldOpenFlowsMixinNeo.java | 20 +++++++++++++++++++ .../yeetusexperimentus-neo.mixins.json | 9 +++------ 6 files changed, 51 insertions(+), 18 deletions(-) create mode 100644 fabric/src/main/java/com/sunekaer/yeetusexperimentus/fabric/mixin/WorldOpenFlowsMixinFabric.java create mode 100644 neoforge/src/main/java/com/sunekaer/yeetusexperimentus/neo/mixin/WorldOpenFlowsMixinNeo.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e2195e..9f523c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [84.0.3] + +### Fixed + +- Fixed the mod not working on NeoForge and Forge + ## [84.0.2] ### Fixed diff --git a/common/src/main/java/com/sunekaer/yeetusexperimentus/mixin/WorldOpenFlowsMixin.java b/common/src/main/java/com/sunekaer/yeetusexperimentus/mixin/WorldOpenFlowsMixin.java index c5f0ddd..8c0c478 100644 --- a/common/src/main/java/com/sunekaer/yeetusexperimentus/mixin/WorldOpenFlowsMixin.java +++ b/common/src/main/java/com/sunekaer/yeetusexperimentus/mixin/WorldOpenFlowsMixin.java @@ -13,13 +13,4 @@ public class WorldOpenFlowsMixin { private static Lifecycle alwaysStable(Lifecycle cycle) { return Lifecycle.stable(); } - - @ModifyVariable( - method = "loadLevel(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;Lcom/mojang/serialization/Dynamic;ZZLjava/lang/Runnable;)V", - at = @At("STORE"), - ordinal = 3 - ) - public boolean no(boolean a) { - return false; - } } diff --git a/fabric/src/main/java/com/sunekaer/yeetusexperimentus/fabric/mixin/WorldOpenFlowsMixinFabric.java b/fabric/src/main/java/com/sunekaer/yeetusexperimentus/fabric/mixin/WorldOpenFlowsMixinFabric.java new file mode 100644 index 0000000..1330241 --- /dev/null +++ b/fabric/src/main/java/com/sunekaer/yeetusexperimentus/fabric/mixin/WorldOpenFlowsMixinFabric.java @@ -0,0 +1,19 @@ +package com.sunekaer.yeetusexperimentus.fabric.mixin; + +import com.mojang.serialization.Lifecycle; +import net.minecraft.client.gui.screens.worldselection.WorldOpenFlows; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyVariable; + +@Mixin(WorldOpenFlows.class) +public class WorldOpenFlowsMixinFabric { + @ModifyVariable( + method = "loadLevel(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;Lcom/mojang/serialization/Dynamic;ZZLjava/lang/Runnable;)V", + at = @At("STORE"), + ordinal = 3 + ) + public boolean no(boolean a) { + return false; + } +} diff --git a/gradle.properties b/gradle.properties index 1980bbd..83e2cda 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.daemon=false enabled_platforms=fabric,neoforge,forge # Project -mod_version=84.0.2 +mod_version=84.0.3 maven_group=com.sunekaer.mods mod_name=YeetusExperimentus mod_author=Sunekaer @@ -23,8 +23,8 @@ forge_version=49.0.14 forge_gradle_version=6.0.18 # Neo -neoforge_version=20.4.80-beta -neoforge_gradle_version=7.0.80 +neoforge_version=20.4.237 +neoforge_gradle_version=7.0.145 # Fabric fabric_api_version=0.91.2+1.20.4 diff --git a/neoforge/src/main/java/com/sunekaer/yeetusexperimentus/neo/mixin/WorldOpenFlowsMixinNeo.java b/neoforge/src/main/java/com/sunekaer/yeetusexperimentus/neo/mixin/WorldOpenFlowsMixinNeo.java new file mode 100644 index 0000000..922f11c --- /dev/null +++ b/neoforge/src/main/java/com/sunekaer/yeetusexperimentus/neo/mixin/WorldOpenFlowsMixinNeo.java @@ -0,0 +1,20 @@ +package com.sunekaer.yeetusexperimentus.neo.mixin; + +import net.minecraft.client.gui.screens.worldselection.WorldOpenFlows; +import org.spongepowered.asm.mixin.Debug; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyVariable; + +@Debug(export = true) +@Mixin(value = WorldOpenFlows.class) +public abstract class WorldOpenFlowsMixinNeo { + @ModifyVariable( + method = "loadLevel(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;Lcom/mojang/serialization/Dynamic;ZZLjava/lang/Runnable;Z)V", + at = @At("STORE"), + ordinal = 3 + ) + private boolean no(boolean original) { + return false; + } +} diff --git a/neoforge/src/main/resources/yeetusexperimentus-neo.mixins.json b/neoforge/src/main/resources/yeetusexperimentus-neo.mixins.json index 75aa96b..b1037d1 100644 --- a/neoforge/src/main/resources/yeetusexperimentus-neo.mixins.json +++ b/neoforge/src/main/resources/yeetusexperimentus-neo.mixins.json @@ -2,13 +2,10 @@ "required": true, "package": "com.sunekaer.yeetusexperimentus.neo.mixin", "compatibilityLevel": "JAVA_17", - "mixins": [ - ], - "client": [ - "PrimaryLevelDataMixinNeo" - ], + "mixins": [], + "client": ["PrimaryLevelDataMixinNeo", "WorldOpenFlowsMixinNeo"], "injectors": { "defaultRequire": 1 }, "minVersion": "0.8" -} \ No newline at end of file +}