Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
15 changes: 14 additions & 1 deletion src/main/java/com/simibubi/create/AllFluids.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down Expand Up @@ -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);

Expand Down