Fusion (Connected Textures)

Fusion (Connected Textures)

40M Downloads

[Bug] ci.setReturnValue that could be ModifyReturnValue

Closed this issue · 1 comments

commented

Version Info

  • Minecraft, 1.21.5
  • Fusion, 1.2.7b

What mod loader are you using?: Fabric

Are you using OptiFine: no

Description of the Bug

@Inject(
method = "bakeModels",
at = @At("RETURN"),
cancellable = true
)
private void applyBlockModelOverlays(SpriteGetter textureGetter, Executor executor, CallbackInfoReturnable<CompletableFuture<ModelBakery.BakingResult>> ci){
ci.setReturnValue(ci.getReturnValue().whenComplete((results, throwable) -> {
//noinspection DataFlowIssue
ModelBakery.ModelBakerImpl resolver = ((ModelBakery)(Object)this).new ModelBakerImpl(textureGetter);
BlockModelModifierReloadListener.INSTANCE.applyOverlays(results, resolver);
ItemModelModifierReloadListener.INSTANCE.applyPredicateModels(results, new ItemModel.BakingContext(
resolver,
this.entityModelSet,
results.missingModels().item(),
null
));
}));

this injection uses ci.setReturnValue that could be @ModifyReturnValue for better compatibility with other mods.

Steps to Reproduce

This runs into an issue with Firmament, where Firmaments block model injection breaks, resulting in an infinitely stalling loading screen.

Install Firmament, Fusion, launch the game. You should infinitely load on the overlay screen.

Screenshots

commented

I believe I got all of the mixins which cancel at return replaced with ModifyReturnValue now (at least for Fabric and NeoForge).
Version 1.2.8 of Fusion should hopefully no longer interfere now.
Thank you for reporting the issue and helping on how to fix it 🙂