From eba6e42c3a10cb51c9e513e4c0281f567826ddb9 Mon Sep 17 00:00:00 2001 From: skippyall <121978267+skippyall@users.noreply.github.com> Date: Sun, 16 Nov 2025 22:57:51 +0100 Subject: [PATCH] Fix limestone & scoria generation --- src/main/java/com/simibubi/create/AllFluids.java | 15 ++++++++++++++- .../kinetics/drill/CobbleGenOptimisation.java | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/simibubi/create/AllFluids.java b/src/main/java/com/simibubi/create/AllFluids.java index c0915d7f16..3de4bd3f88 100644 --- a/src/main/java/com/simibubi/create/AllFluids.java +++ b/src/main/java/com/simibubi/create/AllFluids.java @@ -20,6 +20,11 @@ import com.tterrag.registrate.fabric.SimpleFlowableFluid; import com.tterrag.registrate.util.entry.FluidEntry; +import io.github.fabricators_of_create.porting_lib.fluids.FluidInteractionRegistry; + +import io.github.fabricators_of_create.porting_lib.fluids.FluidInteractionRegistry.InteractionInformation; +import io.github.fabricators_of_create.porting_lib.fluids.PortingLibFluids; + import net.createmod.catnip.data.Iterate; import net.createmod.catnip.nbt.NBTHelper; import net.minecraft.core.BlockPos; @@ -165,7 +170,15 @@ public static void initRendering() { } public static void registerFluidInteractions() { - // fabric: no fluid interaction API, use legacy method + FluidInteractionRegistry.addInteraction(PortingLibFluids.LAVA_TYPE, new InteractionInformation( + ((level, currentPos, relativePos, currentState) -> level.getFluidState(relativePos).getType().isSame(HONEY.get())), + AllPaletteStoneTypes.LIMESTONE.getBaseBlock().get().defaultBlockState() + )); + FluidInteractionRegistry.addInteraction(PortingLibFluids.LAVA_TYPE, new InteractionInformation( + ((level, currentPos, relativePos, currentState) -> level.getFluidState(relativePos).getType().isSame(CHOCOLATE.get())), + AllPaletteStoneTypes.SCORIA.getBaseBlock().get().defaultBlockState() + )); + FluidPlaceBlockCallback.EVENT.register(AllFluids::whenFluidsMeet); } diff --git a/src/main/java/com/simibubi/create/content/kinetics/drill/CobbleGenOptimisation.java b/src/main/java/com/simibubi/create/content/kinetics/drill/CobbleGenOptimisation.java index d329a06afb..90e35a6502 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/drill/CobbleGenOptimisation.java +++ b/src/main/java/com/simibubi/create/content/kinetics/drill/CobbleGenOptimisation.java @@ -58,7 +58,7 @@ public static BlockState determineOutput(ServerLevel level, BlockPos pos, Cobble FluidState fluidState = config.statesAroundDrill.get(i) .getFluidState(); FluidType fluidType = fluidState.getFluidType(); - if (!fluidType.isAir() && interactions.get(fluidType) != null) + if (fluidType != null && !fluidType.isAir() && interactions.get(fluidType) != null) presentFluidTypes.put(fluidType, Pair.of(Iterate.directions[i], fluidState)); } @@ -93,7 +93,7 @@ public static BlockState determineOutput(ServerLevel level, BlockPos pos, Cobble ServerLevel owLevel = level.getServer().getLevel(Level.OVERWORLD); if (owLevel == null) owLevel = level; - + if (cachedLevel == null || cachedLevel.getLevel() != owLevel) cachedLevel = new CobbleGenLevel(level);