소스 검색

Fix crash on recent Forge builds, closes #80

malte0811 3 년 전
부모
커밋
736ca79537

+ 5 - 4
Common/src/main/java/malte0811/ferritecore/mixin/dedupmultipart/MixinMultipartModel.java

@@ -24,7 +24,7 @@ import java.util.Map;
  * decent JIT should be able to remove the inner synchronization since both are on the same final field, so performance
  * should not be an issue.
  */
-// Unresolved reference: Forge adds a parameter to getQuads, so the usual remapping process breaks and I need to specify
+// Unresolved reference: Forge adds parameters to getQuads, so the usual remapping process breaks and I need to specify
 // SRG and intermediary names directly, which confuses the MCDev IntelliJ plugin
 // Sync on local/parameter: The parameter is actually always a final field, but which one it is depends on whether
 // sodium is installed or not.
@@ -34,8 +34,9 @@ public class MixinMultipartModel {
     @Redirect(
             method = {
                     "getQuads", // Mapped name in MCP, Moj and Yarn
-                    "method_4707", "m_6840_", // SRG and Intermediary names
-                    "emitBlockQuads" // Added by FRAPI, also needs to be synchronized
+                    "method_4707", // Intermediary
+                    "emitBlockQuads", // Added by FRAPI, also needs to be synchronized
+                    "getSelectors" // Forge moves the logic into its own method
             },
             at = @At(value = "INVOKE", target = "Ljava/util/Map;get(Ljava/lang/Object;)Ljava/lang/Object;"),
             remap = false
@@ -47,7 +48,7 @@ public class MixinMultipartModel {
     }
 
     @Redirect(
-            method = {"getQuads", "method_4707", "m_6840_", "emitBlockQuads"},
+            method = {"getQuads", "method_4707", "emitBlockQuads", "getSelectors"},
             at = @At(value = "INVOKE", target = "Ljava/util/Map;put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"),
             remap = false
     )

+ 2 - 2
Forge/src/main/java/malte0811/ferritecore/ModClientForge.java

@@ -3,14 +3,14 @@ package malte0811.ferritecore;
 import malte0811.ferritecore.impl.Deduplicator;
 import malte0811.ferritecore.util.Constants;
 import net.minecraftforge.api.distmarker.Dist;
-import net.minecraftforge.client.event.ParticleFactoryRegisterEvent;
+import net.minecraftforge.client.event.RenderLevelStageEvent;
 import net.minecraftforge.eventbus.api.SubscribeEvent;
 import net.minecraftforge.fml.common.Mod;
 
 @Mod.EventBusSubscriber(value = Dist.CLIENT, modid = Constants.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
 public class ModClientForge {
     @SubscribeEvent
-    public static void registerReloadListener(ParticleFactoryRegisterEvent ev) {
+    public static void registerReloadListener(RenderLevelStageEvent.RegisterStageEvent ev) {
         Deduplicator.registerReloadListener();
     }
 }

+ 1 - 1
gradle.properties

@@ -8,7 +8,7 @@ minecraft_version=1.19
 parchment_version=2022.03.13
 
 # Forge
-forge_version=41.0.1
+forge_version=41.0.98
 
 # Fabric
 fabric_loader_version=0.14.6