Trait FluidsRegistrar
pub trait FluidsRegistrar {
// Required methods
fn fluid_key(&mut self, id: &str) -> FluidKey;
fn declare_fluid(&mut self, path: &str) -> FluidKey;
fn declare_world_fluid(&mut self, path: &str, fluid: WorldFluid) -> FluidKey;
fn attach_fluid_part(
&mut self,
fluid: &str,
kind: &'static str,
part: Arc<dyn FluidPart>,
);
}Expand description
Registrar operations for fluids.
Required Methods§
fn fluid_key(&mut self, id: &str) -> FluidKey
fn fluid_key(&mut self, id: &str) -> FluidKey
Request a fluid by canonical registry id, checked when the registry loads.
fn declare_fluid(&mut self, path: &str) -> FluidKey
fn declare_fluid(&mut self, path: &str) -> FluidKey
Declare a tank-only fluid in a namespace owned by this mod’s manifest and return its key.
fn declare_world_fluid(&mut self, path: &str, fluid: WorldFluid) -> FluidKey
fn declare_world_fluid(&mut self, path: &str, fluid: WorldFluid) -> FluidKey
Declare a fluid in a namespace owned by this mod’s manifest that exists in the world (NeoForge’s
RegisterEvent for a FluidType), with its block and, as fluid says, its bucket. Its
data/<mod id>/horizon/fluid/<path>.json, if any, says how it looks.
fn attach_fluid_part(
&mut self,
fluid: &str,
kind: &'static str,
part: Arc<dyn FluidPart>,
)
fn attach_fluid_part( &mut self, fluid: &str, kind: &'static str, part: Arc<dyn FluidPart>, )
Attach part, of kind kind, to the world fluid fluid.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".