Skip to content

Comments

Support CensoredASM's onDemandAnimatedTextures feature#87

Open
embeddedt wants to merge 1 commit intoMeldexun:mainfrom
embeddedt:main
Open

Support CensoredASM's onDemandAnimatedTextures feature#87
embeddedt wants to merge 1 commit intoMeldexun:mainfrom
embeddedt:main

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.

@ZZZank
Copy link

ZZZank commented Oct 17, 2024

given that there have been at least 4 people reaching out to me to ask how to build this PR with my minor fix, I'm providing an example build at https://github.com/ZZZank/Nothirium/releases/tag/v1.12.2-0.3.4-on_demand_texture . Note that you need to unzip the artifact.zip to get the actual mod file because it's copied directly from this github action with no modification.

I'm aware that this mod is ARR, so if Meldexun points out anything that my example build violates, I'll obviously delete this release.

@xskutsu
Copy link

xskutsu commented Nov 6, 2024

Entity flames are not properly animated, even with this PR/patch. For example if a zombie is burning from sunlight, the flame texture will be inconsistently animated based on distance from the player.

@Glad-BR
Copy link

Glad-BR commented Jan 20, 2025

will this ever get merged? it's been a while

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.

5 participants