Ponder for KubeJS

Ponder for KubeJS

15M Downloads

Avoid extra resource pack reload

embeddedt opened this issue ยท 1 comments

commented

Describe the feature/addition!

It appears that the first time PonderJS is loaded, it triggers an extra reload of the client resource packs (stacktrace obtained by injecting a debug mixin in the resource pack reload functions):

java.lang.Exception
	at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.handler$zfn000$dbg(Minecraft.java:5899)
	at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.m_168019_(Minecraft.java)
	at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.m_91391_(Minecraft.java:832)
	at TRANSFORMER/[email protected]/com.almostreliable.ponderjs.PonderJS.init(PonderJS.java:108)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.DeferredWorkQueue.lambda$makeRunnable$1(DeferredWorkQueue.java:67)
	at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.DeferredWorkQueue.makeRunnable(DeferredWorkQueue.java:63)
	at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.DeferredWorkQueue.lambda$runTasks$0(DeferredWorkQueue.java:57)
	at java.base/java.util.concurrent.ConcurrentLinkedDeque.forEach(ConcurrentLinkedDeque.java:1650)
	at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.DeferredWorkQueue.runTasks(DeferredWorkQueue.java:57)
	at TRANSFORMER/[email protected]/net.minecraftforge.fml.core.ParallelTransition.lambda$finalActivityGenerator$2(ParallelTransition.java:35)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
	at TRANSFORMER/[email protected]/net.minecraft.server.packs.resources.SimpleReloadInstance.m_143940_(SimpleReloadInstance.java:69)
	at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:157)
	at TRANSFORMER/[email protected]/net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23)
	at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:131)
	at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_18699_(BlockableEventLoop.java:116)
	at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1072)
	at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.m_91374_(Minecraft.java:700)
	at TRANSFORMER/[email protected]/net.minecraft.client.main.Main.m_239872_(Main.java:212)
	at TRANSFORMER/[email protected]/net.minecraft.client.main.Main.main(Main.java:51)

Why would like to see this feature/addition?

This causes modpacks including PonderJS to take significantly longer to load the first time, as an extra resource pack reload is required (and that is very slow without performance mods). An example where this can be seen occurring is All the Mods 8.

What is the reason for needing this hack? Perhaps there is another way of accomplishing the same thing.

commented

This is required in order to generate the lang file. This is only done once if the lang strings changed. Some modpacks don't ship the generated lang file, thus another reload is performed when starting the pack for the first time.
The path for the auto-generated file is kubejs/assets/ponderjs_generated/lang/%lang%.json