Skip to content
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

Support CensoredASM's onDemandAnimatedTextures feature #87

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

embeddedt
Copy link

The patch has been structured to involve minimal changes to Nothirium's codebase; the code that interacts with CensoredASM directly is in a separate class.

Note that this requires CensoredASM 5.18 to work correctly; I have not implemented a version restriction in the initial version of this PR.

@ZZZank
Copy link

ZZZank commented Oct 23, 2023

This PR seems to break Nothirium's current compatibility with OptiFine. I built a .jar myself, and when I tried to use it along with Optifine, the game will crash on entering main menu:
crash-2023-10-23_12.48.52-client.txt

java.lang.NullPointerException: Unexpected error
    at meldexun.nothirium.mc.integration.CensoredASM.activateChunkSprites(CensoredASM.java:51)
    at net.minecraft.client.renderer.texture.TextureMap.handler$zzl000$triggerChunkSprites(TextureMap.java:2641)
    at net.minecraft.client.renderer.texture.TextureMap.updateAnimations(TextureMap.java)
    at net.minecraft.client.renderer.texture.TextureMap.tick(TextureMap.java:711)
    at net.minecraft.client.renderer.texture.TextureManager.tick(TextureManager.java:167)
    at net.optifine.util.TextureUtils.resourcesReloaded(TextureUtils.java:342)
    at net.optifine.util.TextureUtils$1.onResourceManagerReload(TextureUtils.java:362)
    at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121)
    at net.optifine.util.TextureUtils.registerResourceListener(TextureUtils.java:366)
    at net.minecraft.client.renderer.EntityRenderer.frameInit(EntityRenderer.java:2818)
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1312)
    at net.minecraft.client.Minecraft.runGameLoop(MinecraftMixin.java:1119)
    ...

But it works pretty great without OptiFine installed.

The original Nothirium works with and without OptiFine installed.

@Meldexun
Copy link
Owner

This PR seems pretty invasive just to support this single feature. I'm currently in the process of some larger updates for Nothirium which means I will delay this PR until I have finished my updates.

@ZZZank
Copy link

ZZZank commented Jun 21, 2024

It seems that the compatibility issue introduced by this PR (see my last comment) is actually pretty easy to fix. An additional null check is enough for fixing this. See ZZZank@a18de8c

-        if(!LOADED)
+        if(!LOADED || ChunkRenderManager.getRenderer() == null)

I've tested this in E2EE modpack, and there's no crash during 3 hours of gameplay.

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.

None yet

3 participants