Skip to content

[1.20.1] Update Forge and mark TradeOffersTypeAwareBuyForOneEmeraldFactoryMixin injectors as not required #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

unilock
Copy link
Contributor

@unilock unilock commented Jan 29, 2025

Fixes compatibility with Forge 47.3.26+ while maintaining compatibility with older versions

…n injectors as not required, for Forge 47.3.26+

Signed-off-by: unilock <[email protected]>
@mpustovoi
Copy link

I guess that was the reason for my crash on Forge 47.3.27 upon entering the world:

[29���.2025 21:34:09.648] [Server thread/ERROR] [mixin/]: Injection error: LVT in net/minecraft/world/entity/npc/VillagerTrades$EmeraldsForVillagerTypeItem::m_213663_(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/util/RandomSource;)Lnet/minecraft/world/item/trading/MerchantOffer; has incompatible changes at opcode 34 in callback fabric-object-builder-v1.mixins.json:TradeOffersTypeAwareBuyForOneEmeraldFactoryMixin from mod fabric_object_builder_api_v1->@Inject::failOnNullItem(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/util/RandomSource;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfoReturnable;Lnet/minecraft/world/item/ItemStack;)V.
 Expected: [Lnet/minecraft/world/item/ItemStack;]
    Found: [Lnet/minecraft/world/item/Item;]
Available: [Lnet/minecraft/world/item/Item;, Lnet/minecraft/world/item/ItemStack;]
[29���.2025 21:34:09.650] [Server thread/ERROR] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: Exception caught during firing event: An unexpected critical error was encountered
	Index: 4
	Listeners:
		0: HIGH
		1: ASM: class dev.architectury.event.forge.EventHandlerImplCommon event(Lnet/minecraftforge/event/server/ServerAboutToStartEvent;)V
		2: NORMAL
		3: net.minecraftforge.eventbus.EventBus$$Lambda$1901/0x0000024d6288eb08@73ee1cfc
		4: net.minecraftforge.eventbus.EventBus$$Lambda$1901/0x0000024d6288eb08@71a318d3
		5: net.minecraftforge.eventbus.EventBus$$Lambda$1901/0x0000024d6288eb08@5e86ed8b
		6: ASM: com.mrcrayfish.framework.event.ForgeEvents@3024d4d6 onServerStarting(Lnet/minecraftforge/event/server/ServerAboutToStartEvent;)V
		7: ASM: class net.mehvahdjukaar.moonlight.forge.MoonlightForge beforeServerStart(Lnet/minecraftforge/event/server/ServerAboutToStartEvent;)V
		8: net.minecraftforge.eventbus.EventBus$$Lambda$1901/0x0000024d6288eb08@3a1520d0
		9: ASM: com.seibel.distanthorizons.forge.ForgeServerProxy@2e292f1f dedicatedWorldLoadEvent(Lnet/minecraftforge/event/server/ServerAboutToStartEvent;)V
		10: LOWEST
		11: ASM: class terrablender.handler.InitializationHandler onServerAboutToStart(Lnet/minecraftforge/event/server/ServerAboutToStartEvent;)V
		12: ASM: com.github.alexthe666.citadel.Citadel@6a33ed8b onServerAboutToStart(Lnet/minecraftforge/event/server/ServerAboutToStartEvent;)V
		13: ASM: com.github.alexmodguy.alexscaves.server.event.CommonEvents@57d32ec3 onServerAboutToStart(Lnet/minecraftforge/event/server/ServerAboutToStartEvent;)V
org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered
	at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:392)
	at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:250)
	at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.service.modlauncher.MixinTransformationHandler.processClass(MixinTransformationHandler.java:131)
	at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.launch.MixinLaunchPluginLegacy.processClass(MixinLaunchPluginLegacy.java:131)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClassWithFlags(ILaunchPluginService.java:156)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50)
	at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113)
	at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219)
	at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229)
	at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219)
	at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	at TRANSFORMER/[email protected]/net.minecraft.world.entity.npc.VillagerTrades.m_35632_(VillagerTrades.java:65)
	at TRANSFORMER/[email protected]/net.minecraft.Util.m_137469_(Util.java:359)
	at TRANSFORMER/[email protected]/net.minecraft.world.entity.npc.VillagerTrades.<clinit>(VillagerTrades.java:63)
	at TRANSFORMER/[email protected]/net.minecraftforge.common.VillagerTradingManager.<clinit>(VillagerTradingManager.java:32)
	at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:260)
	at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:252)
	at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:315)
	at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:296)
	at TRANSFORMER/[email protected]/net.minecraftforge.server.ServerLifecycleHooks.handleServerAboutToStart(ServerLifecycleHooks.java:98)
	at TRANSFORMER/[email protected]/net.minecraft.client.server.IntegratedServer.m_7038_(IntegratedServer.java:62)
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:634)
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.spongepowered.asm.mixin.injection.throwables.InjectionError: Critical injection failure: Redirector disableVanillaCheck(Lnet/minecraft/core/DefaultedRegistry;)Ljava/util/stream/Stream; in fabric-object-builder-v1.mixins.json:TradeOffersTypeAwareBuyForOneEmeraldFactoryMixin from mod fabric_object_builder_api_v1 failed injection check, (0/1) succeeded. Scanned 1 target(s). Using refmap fabric-object-builder-api-v1-refmap.json
	at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.injection.struct.InjectionInfo.postInject(InjectionInfo.java:468)
	at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinTargetContext.applyInjections(MixinTargetContext.java:1384)
	at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyInjections(MixinApplicatorStandard.java:1062)
	at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:402)
	at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:327)
	at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:421)
	at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:403)
	at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363)
	... 26 more

[29���.2025 21:34:09.651] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Encountered an unexpected exception
org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:392) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:250) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.service.modlauncher.MixinTransformationHandler.processClass(MixinTransformationHandler.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.launch.MixinLaunchPluginLegacy.processClass(MixinLaunchPluginLegacy.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClassWithFlags(ILaunchPluginService.java:156) ~[modlauncher-10.0.9.jar:10.0.9+10.0.9+main.dcd20f30]
	at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88) ~[modlauncher-10.0.9.jar:?]
	at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-10.0.9.jar:?]
	at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-10.0.9.jar:?]
	at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113) ~[securejarhandler-2.1.10.jar:?]
	at cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?]
	at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) ~[securejarhandler-2.1.10.jar:?]
	at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?]
	at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) ~[securejarhandler-2.1.10.jar:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
	at net.minecraft.world.entity.npc.VillagerTrades.m_35632_(VillagerTrades.java:65) ~[client-1.20.1-20230612.114412-srg.jar%23396!/:?]
	at net.minecraft.Util.m_137469_(Util.java:359) ~[client-1.20.1-20230612.114412-srg.jar%23396!/:?]
	at net.minecraft.world.entity.npc.VillagerTrades.<clinit>(VillagerTrades.java:63) ~[client-1.20.1-20230612.114412-srg.jar%23396!/:?]
	at net.minecraftforge.common.VillagerTradingManager.<clinit>(VillagerTradingManager.java:32) ~[forge-1.20.1-47.3.27-universal.jar%23401!/:?]
	at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:260) ~[eventbus-6.0.5.jar%23117!/:?]
	at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:252) ~[eventbus-6.0.5.jar%23117!/:?]
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%23117!/:?]
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%23117!/:?]
	at net.minecraftforge.server.ServerLifecycleHooks.handleServerAboutToStart(ServerLifecycleHooks.java:98) ~[forge-1.20.1-47.3.27-universal.jar%23401!/:?]
	at net.minecraft.client.server.IntegratedServer.m_7038_(IntegratedServer.java:62) ~[client-1.20.1-20230612.114412-srg.jar%23396!/:?]
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:634) ~[client-1.20.1-20230612.114412-srg.jar%23396!/:?]
	at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[client-1.20.1-20230612.114412-srg.jar%23396!/:?]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: org.spongepowered.asm.mixin.injection.throwables.InjectionError: Critical injection failure: Redirector disableVanillaCheck(Lnet/minecraft/core/DefaultedRegistry;)Ljava/util/stream/Stream; in fabric-object-builder-v1.mixins.json:TradeOffersTypeAwareBuyForOneEmeraldFactoryMixin from mod fabric_object_builder_api_v1 failed injection check, (0/1) succeeded. Scanned 1 target(s). Using refmap fabric-object-builder-api-v1-refmap.json
	at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.postInject(InjectionInfo.java:468) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.MixinTargetContext.applyInjections(MixinTargetContext.java:1384) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyInjections(MixinApplicatorStandard.java:1062) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:402) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:327) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:421) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:403) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	... 26 more
[29���.2025 21:34:09.762] [Server thread/FATAL] [net.minecraftforge.common.ForgeMod/]: Preparing crash report with UUID 0c675e95-0ef6-4ec8-8a02-55c392053564
[29���.2025 21:34:09.763] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: This crash report has been saved to: E:\Modrinth\profiles\Test instance\crash-reports\crash-2025-01-29_21.34.09-server.txt
[29���.2025 21:34:09.764] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Exception stopping the server
java.lang.NullPointerException: Cannot invoke "net.minecraft.server.level.ServerLevel.m_8895_()" because "com.bawnorton.neruina.handler.PersitanceHandler.world" is null
	at com.bawnorton.neruina.handler.PersitanceHandler.getServerState(PersitanceHandler.java:36) ~[Neruina-2.1.1-forge+1.20.1.jar%23354!/:?]
	at com.bawnorton.neruina.Neruina.getPersitanceHandler(Neruina.java:49) ~[Neruina-2.1.1-forge+1.20.1.jar%23354!/:?]
	at net.minecraft.server.MinecraftServer.handler$bll000$neruina$onServerStop(MinecraftServer.java:2861) ~[client-1.20.1-20230612.114412-srg.jar%23396!/:?]
	at net.minecraft.server.MinecraftServer.m_7041_(MinecraftServer.java) ~[client-1.20.1-20230612.114412-srg.jar%23396!/:?]
	at net.minecraft.client.server.IntegratedServer.m_7041_(IntegratedServer.java:187) ~[client-1.20.1-20230612.114412-srg.jar%23396!/:?]
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:689) ~[client-1.20.1-20230612.114412-srg.jar%23396!/:?]
	at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[client-1.20.1-20230612.114412-srg.jar%23396!/:?]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]
[29���.2025 21:34:09.805] [Server thread/INFO] [Framework/]: Unloading server configs...
[29���.2025 21:34:09.805] [Server thread/INFO] [Framework/]: Finished unloading server configs
[29���.2025 21:34:09.813] [Server thread/WARN] [com.kingcontaria.fastquit.FastQuit/]: [FastQuit] "New World" was not registered in currently saving worlds!

Otherwise, I'm just at a loss.

@unilock
Copy link
Contributor Author

unilock commented Jan 29, 2025

@mpustovoi Yes, this PR intends to fix that particular crash.

@stevenjwheeler
Copy link

I spent the whole of yesterday trying to track down this specific bug when adding the Forgified API to my server,
PLEASE commit this fix. Thank you!

@Rearth
Copy link
Contributor

Rearth commented Feb 3, 2025

Can we also get this fix on 1.21? I have users reporting this issue for Oritech 1.21 aswell

@unilock
Copy link
Contributor Author

unilock commented Feb 3, 2025

@Rearth The fix should already be present on 1.21.1 with cc242ef.

@Gaming-tech-cyber
Copy link

can we integrate the QFAPI into this for quilt mod integration for forge via connector

@unilock
Copy link
Contributor Author

unilock commented Feb 7, 2025

@Gaming-tech-cyber

can we integrate the QFAPI into this for quilt mod integration for forge via connector

Uh, no. I'm not sure what this has to do with this PR anyway.

Off-Topic

Quilt uses its own mappings, loader, and API (although I think it remaps JARs to Intermediary anyway). It would be a rather large effort to port its entire ecosystem to Fabric. (Though not as much of an effort as porting Fabric's ecosystem to Forge, I suppose...)

There aren't really enough Quilt-specific mods to make it worth the trouble.

@Su5eD Su5eD merged commit 4bd998f into Sinytra:1.20.1 Feb 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants