mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-18 16:02:19 +01:00
Merge pull request #2938 from FortressNebula/mc1.18/dev
Add support for other mod IDs with virtual fluids
This commit is contained in:
commit
e815cb190e
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 com.tterrag.registrate.util.nullness.NonNullSupplier;
|
||||||
|
|
||||||
import net.minecraft.client.resources.model.BakedModel;
|
import net.minecraft.client.resources.model.BakedModel;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.tags.BlockTags;
|
import net.minecraft.tags.BlockTags;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
@ -168,12 +169,26 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
|
||||||
Create.asResource("fluid/" + name + "_flow"), attributesFactory, factory));
|
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) {
|
public FluidBuilder<VirtualFluid, CreateRegistrate> virtualFluid(String name) {
|
||||||
return entry(name,
|
return entry(name,
|
||||||
c -> new VirtualFluidBuilder<>(self(), self(), name, c, Create.asResource("fluid/" + name + "_still"),
|
c -> new VirtualFluidBuilder<>(self(), self(), name, c, Create.asResource("fluid/" + name + "_still"),
|
||||||
Create.asResource("fluid/" + name + "_flow"), null, VirtualFluid::new));
|
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) {
|
public FluidBuilder<ForgeFlowingFluid.Flowing, CreateRegistrate> standardFluid(String name) {
|
||||||
return fluid(name, Create.asResource("fluid/" + name + "_still"), Create.asResource("fluid/" + name + "_flow"));
|
return fluid(name, Create.asResource("fluid/" + name + "_still"), Create.asResource("fluid/" + name + "_flow"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue