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

1.20.6 FluidStack.empty() returns null (and FluidStack.EMPTY is null) #500

Open
desht opened this issue Apr 30, 2024 · 0 comments
Open

1.20.6 FluidStack.empty() returns null (and FluidStack.EMPTY is null) #500

desht opened this issue Apr 30, 2024 · 0 comments

Comments

@desht
Copy link
Contributor

desht commented Apr 30, 2024

The static init for FluidStack.EMPTY appears to be incorrect:

private static final FluidStack EMPTY = create(Fluids.EMPTY, 0);

Following the create() method call chain leads to this method:

public static FluidStack create(Fluid fluid, long amount, DataComponentPatch patch) {
    if (fluid == Fluids.EMPTY || amount <= 0) return empty();
    return create(() -> fluid, amount, patch);
}

Since the amount is 0, empty() is called, which returns EMPTY, which at this point is still null.

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

No branches or pull requests

1 participant