Pretty Pipes

Pretty Pipes

9M Downloads

[Bug] Pressing button in Stack Limiter Module doesn't update the text

Quarris opened this issue ยท 1 comments

commented

Versions

MC Verion: 1.21.1
NeoForge: 21.1.45
Pretty Pipes: 1.17.0

Description

When you press the button "Don't limit to one stack" and "Limit to one stack" in the Stack Limiter Module, it does not cycle the button text until you close and open the screen again.

commented

Its because you cache the data before passing it into the button text supplier.

I fixed it in PP Fluids by just passing the entire call to get data.
From:

Supplier<Component> buttonText = () -> Component.literal(data.useBucketMeasure() ? "B" : "mB");

To:

Supplier<Component> buttonText = () -> Component.literal(this.menu.moduleStack.getOrDefault(DataComponentSetup.FLUID_LIMITER, FluidLimiterModuleItem.LimiterData.DEFAULT).useBucketMeasure() ? "B" : "mB");

It's not pretty but something like that should work.