From 3fbee10d1a8708d50981c57986141f7c48435eff Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Mon, 11 Mar 2024 09:59:49 +0000 Subject: [PATCH] fix: FluidStackImpl#getRawFluidSupplier crashing on forge/neoforge Wrap the Holder.Reference returned from Registry#getHolderOrThrow inside an actual Supplier --- .../main/java/dev/architectury/fluid/forge/FluidStackImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge/src/main/java/dev/architectury/fluid/forge/FluidStackImpl.java b/forge/src/main/java/dev/architectury/fluid/forge/FluidStackImpl.java index cdbc1543..b39bf5b9 100644 --- a/forge/src/main/java/dev/architectury/fluid/forge/FluidStackImpl.java +++ b/forge/src/main/java/dev/architectury/fluid/forge/FluidStackImpl.java @@ -54,7 +54,7 @@ public FluidStack create(Supplier fluid, long amount, CompoundTag tag) { @Override public Supplier 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