Skip to content

Commit

Permalink
fix: FluidStackImpl#getRawFluidSupplier crashing on forge/neoforge
Browse files Browse the repository at this point in the history
Wrap the Holder.Reference returned from Registry#getHolderOrThrow
 inside an actual Supplier
  • Loading branch information
desht committed Mar 11, 2024
1 parent 0c3f7c6 commit 3fbee10
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public FluidStack create(Supplier<Fluid> fluid, long amount, CompoundTag tag) {

@Override
public Supplier<Fluid> getRawFluidSupplier(FluidStack object) {
return BuiltInRegistries.FLUID.getHolderOrThrow(BuiltInRegistries.FLUID.getResourceKey(object.getRawFluid()).orElseThrow());
return () -> BuiltInRegistries.FLUID.getHolderOrThrow(BuiltInRegistries.FLUID.getResourceKey(object.getRawFluid()).orElseThrow()).value();
}

@Override
Expand Down

0 comments on commit 3fbee10

Please sign in to comment.