mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-14 17:33:52 +01:00
Add support for other mod IDs with virtual fluids
This commit is contained in:
parent
c7aca258af
commit
385ffb4533
1 changed files with 15 additions and 0 deletions
|
@ -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<CreateRegistrate> {
|
|||
Create.asResource("fluid/" + name + "_flow"), attributesFactory, factory));
|
||||
}
|
||||
|
||||
public <T extends ForgeFlowingFluid> FluidBuilder<T, CreateRegistrate> virtualFluid(String name, ResourceLocation still, ResourceLocation flow,
|
||||
BiFunction<FluidAttributes.Builder, Fluid, FluidAttributes> attributesFactory,
|
||||
NonNullFunction<ForgeFlowingFluid.Properties, T> factory) {
|
||||
return entry(name,
|
||||
c -> new VirtualFluidBuilder<>(self(), self(), name, c, still,
|
||||
flow, attributesFactory, factory));
|
||||
}
|
||||
|
||||
public FluidBuilder<VirtualFluid, CreateRegistrate> 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, CreateRegistrate> virtualFluid(String name, ResourceLocation still, ResourceLocation flow) {
|
||||
return entry(name,
|
||||
c -> new VirtualFluidBuilder<>(self(), self(), name, c, still,
|
||||
flow, null, VirtualFluid::new));
|
||||
}
|
||||
|
||||
public FluidBuilder<ForgeFlowingFluid.Flowing, CreateRegistrate> standardFluid(String name) {
|
||||
return fluid(name, Create.asResource("fluid/" + name + "_still"), Create.asResource("fluid/" + name + "_flow"));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue