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

Fix fluid amount not updated in multiblock ui #3561

Merged
merged 7 commits into from
Nov 28, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.Map;
import java.util.Optional;
import java.util.function.LongConsumer;
import java.util.stream.Collectors;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -2695,7 +2696,15 @@ && getBaseMetaTileEntity().wasShutdown()))
|| (mOutputItems != null && mOutputItems.length > 0)))
.widget(
new FakeSyncWidget.ListSyncer<>(
() -> mOutputFluids != null ? Arrays.asList(mOutputFluids) : Collections.emptyList(),
() -> mOutputFluids != null ? Arrays.stream(mOutputFluids)
.map(fluidStack -> new FluidStack(fluidStack, fluidStack.amount) {

@Override
public boolean isFluidEqual(FluidStack other) {
OneEyeMaker marked this conversation as resolved.
Show resolved Hide resolved
return super.isFluidEqual(other) && amount == other.amount;
}
})
.collect(Collectors.toList()) : Collections.emptyList(),
val -> mOutputFluids = val.toArray(new FluidStack[0]),
NetworkUtils::writeFluidStack,
NetworkUtils::readFluidStack))
Expand Down