Fabric API

Fabric API

112M Downloads

Recent Fabric API shader update causes mods with namespaced shader strings to get stuck in asset load loop

TelepathicGrunt opened this issue ยท 6 comments

commented

The issue was found in 1.19.2. I have not yet tested other Mc versions yet but issue might be present in them as well.

This is likely the problematic commit
526f2c6

The commit is likely what is causing Fabric Twilight Forest in 1.19.2 to not be able to load anymore. The game gets stuck in a loading assets screen loop.
Caused by: net.minecraft.class_151: Non [a-z0-9/._-] character in path of location: forge:forge:shaders/core/rendertype_entity_unlit_translucent.vsh

Seems to be caused by this line in porting lib which used to be valid
https://github.com/Fabricators-of-Create/Porting-Lib/blob/1e37f69632e7da3e6d48ae827fe94fc5b311a168/model_loader/src/main/java/io/github/fabricators_of_create/porting_lib/model/PortingLibRenderTypes.java#L184

Log: https://controlc.com/2274920d

Someone told me to downgrade Fabric API to the version before the Fabric API shader update as it stopped issue for them.

commented

forgive me if i am reading it wrong, but the ShaderInstance constructor takes the string name you pass in and creates an identifier from it.

Identifier identifier = new Identifier("shaders/core/" + name + ".json");

if you pass "forge:rendertype_entity_unlit_translucent" into this, it will crash in vanilla (this has been tested even without FAPI). Are you adding mixins to modify the constructor to make your invalid name function correctly?

commented

@Linguardium Twilight Forest and Porting Lib are not my mod. I cannot speak for either of them. I only reported cause Twilight Forest in 1.19.2 was working and then suddenly not when using updated Fabric API and log showed the extra appended namespace which seemed odd. If it is not an issue with Fabric API, you can close this

commented

https://github.com/TeamTwilight/twilightforest-fabric/issues/212 is the issue on the Twilight Forest repo. Fabricators-of-Create/Porting-Lib@3f7a523 was the fix in Porting Lib

commented

Since I spent 5 hours troubleshooting this, this Christmas. Here's what I found out:

https://legacy.curseforge.com/minecraft/mc-mods/satin-api/files/3864173

This library here somehow bypasses the crash without requiring to roll back the fabric api. No idea why, but it seems to work?

Or would it break something else in game?

commented

As @Poopooracoocoo mentioned, this was an issue on Porting Lib's side that has since been fixed. Instead of downgrading Fabric API, you can just download a newer release of Porting Lib with the issue fixed, which will then override the older versions of the mod embedded in i.e. Twilight Forest.

commented

Going to close this, I dont think there is anything that Fabric API can or should do about this. We added a new API, sadly it clashes with an existing mods. This wont be the last time this happens, we cannot not ship new features becuase its incompatible with some random mod. Fabric API doesnt do this on purpose.