From 385ffb45336b0f8db349d1ce768d276897d59996 Mon Sep 17 00:00:00 2001 From: FortressNebula Date: Fri, 8 Apr 2022 12:26:52 +0100 Subject: [PATCH] Add support for other mod IDs with virtual fluids --- .../create/foundation/data/CreateRegistrate.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java b/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java index 92b34bdc9..32e661e8c 100644 --- a/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java +++ b/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java @@ -30,6 +30,7 @@ import com.tterrag.registrate.util.nullness.NonNullFunction; import com.tterrag.registrate.util.nullness.NonNullSupplier; import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BlockTags; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; @@ -168,12 +169,26 @@ public class CreateRegistrate extends AbstractRegistrate { Create.asResource("fluid/" + name + "_flow"), attributesFactory, factory)); } + public FluidBuilder virtualFluid(String name, ResourceLocation still, ResourceLocation flow, + BiFunction attributesFactory, + NonNullFunction factory) { + return entry(name, + c -> new VirtualFluidBuilder<>(self(), self(), name, c, still, + flow, attributesFactory, factory)); + } + public FluidBuilder virtualFluid(String name) { return entry(name, c -> new VirtualFluidBuilder<>(self(), self(), name, c, Create.asResource("fluid/" + name + "_still"), Create.asResource("fluid/" + name + "_flow"), null, VirtualFluid::new)); } + public FluidBuilder virtualFluid(String name, ResourceLocation still, ResourceLocation flow) { + return entry(name, + c -> new VirtualFluidBuilder<>(self(), self(), name, c, still, + flow, null, VirtualFluid::new)); + } + public FluidBuilder standardFluid(String name) { return fluid(name, Create.asResource("fluid/" + name + "_still"), Create.asResource("fluid/" + name + "_flow")); }