Dynamic Asset Generator

Dynamic Asset Generator

4M Downloads

[BUG] `NullPointerException: Cannot invoke "java.lang.AutoCloseable.close()" because "c" is null`

SettingDust opened this issue ยท 11 comments

commented

Describe the bug

[15:13:03] [Worker-Main-10/ERROR]: Exception while closing resources:

java.lang.NullPointerException: Cannot invoke "java.lang.AutoCloseable.close()" because "c" is null
	at io.github.lukebemish.dynamic_asset_generator.impl.util.MultiCloser.close(MultiCloser.java:17) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.api.client.generators.texsources.AnimationSplittingSource.lambda$getSupplier$5(AnimationSplittingSource.java:41) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.api.client.generators.DynamicTextureSource.lambda$new$3(DynamicTextureSource.java:33) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.api.client.generators.DynamicTextureSource.lambda$get$5(DynamicTextureSource.java:43) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.excavated_variants.client.BlockStateAssembler.lambda$getMap$1(BlockStateAssembler.java:122) ~[excavated-variants-quilt-1.19.2-1.0.3.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.api.ResourceCache.lambda$wrapSafeData$2(ResourceCache.java:53) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.impl.client.DynAssetGenClientResourcePack.method_14411(DynAssetGenClientResourcePack.java:74) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at net.minecraft.class_3294.method_14486(class_3294.java:74) ~[client-intermediary.jar:?]
	at net.minecraft.class_6861.method_14486(class_6861.java:82) ~[client-intermediary.jar:?]
	at net.minecraft.class_1059.method_18160(class_1059.java:185) ~[client-intermediary.jar:?]
	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) [?:?]
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) [?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) [?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1311) [?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1840) [?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1806) [?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177) [?:?]
[15:13:03] [Worker-Main-10/ERROR]: Exception while closing resources:

java.lang.NullPointerException: Cannot invoke "java.lang.AutoCloseable.close()" because "c" is null
	at io.github.lukebemish.dynamic_asset_generator.impl.util.MultiCloser.close(MultiCloser.java:17) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.api.client.generators.texsources.AnimationSplittingSource.lambda$getSupplier$5(AnimationSplittingSource.java:41) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.api.client.generators.DynamicTextureSource.lambda$new$3(DynamicTextureSource.java:33) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.api.client.generators.DynamicTextureSource.lambda$get$5(DynamicTextureSource.java:43) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.excavated_variants.client.BlockStateAssembler.lambda$getMap$1(BlockStateAssembler.java:122) ~[excavated-variants-quilt-1.19.2-1.0.3.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.api.ResourceCache.lambda$wrapSafeData$2(ResourceCache.java:53) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.impl.client.DynAssetGenClientResourcePack.method_14411(DynAssetGenClientResourcePack.java:74) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at net.minecraft.class_3294.method_14486(class_3294.java:74) ~[client-intermediary.jar:?]
	at net.minecraft.class_6861.method_14486(class_6861.java:82) ~[client-intermediary.jar:?]
	at net.minecraft.class_1059.method_18160(class_1059.java:185) ~[client-intermediary.jar:?]
	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) [?:?]
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) [?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) [?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1311) [?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1840) [?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1806) [?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177) [?:?]
[15:13:03] [Worker-Main-10/ERROR]: Issue creating texture from source JSON for output: excavated_variants:textures/block/granite_brilliant_stone0.png
java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1011.method_4323()" because "image" is null
	at io.github.lukebemish.dynamic_asset_generator.api.client.generators.texsources.AnimationSplittingSource.getFrameCount(AnimationSplittingSource.java:109) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.api.client.generators.texsources.AnimationSplittingSource.lambda$getSupplier$3(AnimationSplittingSource.java:47) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
	at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1858) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) ~[?:?]
	at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) ~[?:?]
	at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) ~[?:?]
	at java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) ~[?:?]
	at io.github.lukebemish.dynamic_asset_generator.api.client.generators.texsources.AnimationSplittingSource.lambda$getSupplier$5(AnimationSplittingSource.java:47) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.api.client.generators.DynamicTextureSource.lambda$new$3(DynamicTextureSource.java:33) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.api.client.generators.DynamicTextureSource.lambda$get$5(DynamicTextureSource.java:43) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.excavated_variants.client.BlockStateAssembler.lambda$getMap$1(BlockStateAssembler.java:122) ~[excavated-variants-quilt-1.19.2-1.0.3.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.api.ResourceCache.lambda$wrapSafeData$2(ResourceCache.java:53) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at io.github.lukebemish.dynamic_asset_generator.impl.client.DynAssetGenClientResourcePack.method_14411(DynAssetGenClientResourcePack.java:74) ~[dynamic-asset-generator-quilt-1.19.2-1.2.0.jar.i0:0/:?]
	at net.minecraft.class_3294.method_14486(class_3294.java:74) ~[client-intermediary.jar:?]
	at net.minecraft.class_6861.method_14486(class_6861.java:82) ~[client-intermediary.jar:?]
	at net.minecraft.class_1059.method_18160(class_1059.java:185) ~[client-intermediary.jar:?]
	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) [?:?]
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) [?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) [?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1311) [?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1840) [?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1806) [?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177) [?:?]
[15:13:03] [Worker-Main-10/ERROR]: Using missing texture, file excavated_variants:textures/block/granite_brilliant_stone0.png not found

To Reproduce
Only these mods
image

Expected behavior
A log that describing what is target texture.
And handle exception

Version:

  • Fabric(Quilt)
  • v1.2.0
commented

Should be fixed in the latest 1.19.3 version. Feel free to let me know if it isn't and I'll reopen this. I'm no longer updating the 1.19.2 version though. Additionally, is it just log spam or does it have a gameplay effect?

commented

Log spam currently

commented

Alright, well in that case see if it affects 1.19.3, otherwise there's nothing I can do about it

commented

7 months later, grasping at straws, here I am with the exact same problem :p

Unfortunately, Malum (nor its Quilt descendent) still hasn't updated for >1.19.2 yet, haha...

Do you remember which change fixed the issue in 1.19.3? I could attempt to backport it myself; wouldn't be the first time. (although the major version bump from "v1.2.0" to "v2.0.0" isn't too encouraging, eheh...)

commented

The bump from 1.19.2 to 1.19.3 was a rather large refactor with lots of changes. I am not even certain the same fix would work on 1.19.2, or if the targets for it even exist

commented

Yeah, I'm not really sure what I expected.

I guess the problem was that some of Malum's ores use a custom model that specifies both an "all" and a "glow" texture, with the (mostly transparent) "glow" texture simply being rendered on top of the (base) "all" texture, to achieve some sort of "emissive lighting"-esque effect.
Excavated Variants / Dynamic Asset Generator would then incorrectly assume that the texture is animated, and treat the "all" and "glow" textures as two frames of the animation, I think? The code is tough for me to follow from there, but I guess it trips up due to the "glow" texture being mostly transparent? (example)

I suppose I could just edit Malum to use the minecraft:block/cube_all model for all of its ores instead, haha.

commented

That could be for any number of reasons. Likely candidates are having lots of textures it needs to generate, and/or having higher resolution textures for ore/stone blocks. Enabling caching should help, if that's the issue

commented

I'm on 1.20.1 now

I don't blame you; 1.19.2 is getting older by the day. I'm only using it because most of the "big" mods haven't updated past it quite yet. Here's hoping that changes soon...

In the meantime, I've just edited Malum to use minecraft:block/cube_all instead of its custom models for its "glowing" ores - the textures look slightly off, but at least the log is clean.
(I thought this issue was also what was making the game take 5 minutes to load with Excavated Variants installed - but that still happens. oh well :p )

commented

The animation splitting source thing runs on everything, animated or no. The fact that it's erroring with something being null probably means that one of the nested sources within it failed and that version wasn't doing as many null checks? Not quite sure why it'd be failing but I can think of a number of reasons. Easiest way to tell would be to debug in an IDE and follow the trace of the image that returns null. I don't know. I haven't touched that version in ages. I'm on 1.20.1 now

commented

@unilock You can try to using profiler to profiling the cpu time during startup

commented

Wow, enabling asset caching brought down the startup time from 20 minutes to less than 2! (I am not exaggerating.) Thanks!