Struct ParticleOptions
pub struct ParticleOptions {
pub ty: ParticleKey,
pub block: Option<(String, u32)>,
pub color: [f32; 4],
pub scale: f32,
pub to_color: [f32; 3],
pub trail: Option<([f64; 3], i32)>,
pub item: Option<Vec<String>>,
pub item_stack: Option<ItemStack>,
pub geyser: Option<(i32, f32)>,
pub vibration: Option<(PositionSource, [f64; 3], i32)>,
pub legacy_entity_effect: Option<bool>,
pub legacy_trail_lifetime: bool,
}Expand description
ParticleOptions with the parameters of the option classes used here.
Fields§
§ty: ParticleKeyProvider identity issued by Registrar::particle_key, never an engine enum.
block: Option<(String, u32)>BlockParticleOption: the block’s particle sprite and terrain tint.
color: [f32; 4]RGB(A) for dust, spells, entity effects and tinted leaves.
scale: f32DustParticleOptions.scale, PowerParticleOption.power, SpellParticleOption.power,
SculkChargeParticleOptions.roll, ShriekParticleOption.delay.
to_color: [f32; 3]DustColorTransitionOptions.toColor (color is the from colour).
trail: Option<([f64; 3], i32)>TrailParticleOption: the point it flies to and how many ticks it takes.
item: Option<Vec<String>>ItemParticleOption: the particle sprite of each layer of the item’s
model as resolved for the ground.
item_stack: Option<ItemStack>Stack sent by ServerLevel.sendParticles; clients resolve its ground model at seed 0.
Invalid, unknown or oversized stacks cause the send to return false.
geyser: Option<(i32, f32)>GeyserParticleOptions.waterBlocks and GeyserBaseParticleOptions’
waterBlocks and burstImpulseBase (0 where the type has none).
vibration: Option<(PositionSource, [f64; 3], i32)>VibrationParticleOption: the listener’s position source, the resolved
point the signal flies to and its arrival time in ticks. The source is
sent to clients; the resolved point is used for local rendering
(ParticleEngine::vibration is the same particle).
legacy_entity_effect: Option<bool>Older entity-effect providers use velocity as RGB; true is ambient.
legacy_trail_lifetime: boolOlder trails choose their lifetime in the provider rather than on the wire.
Implementations§
§impl ParticleOptions
impl ParticleOptions
pub fn item_stack(ty: ParticleKey, stack: ItemStack) -> ParticleOptions
pub fn item_stack(ty: ParticleKey, stack: ItemStack) -> ParticleOptions
Vanilla ItemParticleOption(type, stack) for server delivery.
The receiving client resolves the stack’s ground model with seed 0,
using the same path as ClientHost::item_particle_options.
A send refuses unknown, invalid or oversized stacks and returns false.
§impl ParticleOptions
impl ParticleOptions
pub fn simple(ty: ParticleKey) -> ParticleOptions
pub fn simple(ty: ParticleKey) -> ParticleOptions
Construct an option for a retained vanilla or custom sprite-provider key.
pub fn geyser(ty: ParticleKey, water_blocks: i32) -> ParticleOptions
pub fn geyser(ty: ParticleKey, water_blocks: i32) -> ParticleOptions
GeyserParticleOptions(type, waterBlocks).
pub fn geyser_base(
ty: ParticleKey,
water_blocks: i32,
burst_impulse_base: f32,
) -> ParticleOptions
pub fn geyser_base( ty: ParticleKey, water_blocks: i32, burst_impulse_base: f32, ) -> ParticleOptions
GeyserBaseParticleOptions(type, waterBlocks, burstImpulseBase).
pub fn vibration(
ty: ParticleKey,
source: PositionSource,
dest: [f64; 3],
ticks: i32,
) -> ParticleOptions
pub fn vibration( ty: ParticleKey, source: PositionSource, dest: [f64; 3], ticks: i32, ) -> ParticleOptions
VibrationParticleOption(destination, arrivalInTicks): the listener’s
position source and the resolved point this engine flies the signal to.
pub fn item(ty: ParticleKey, layers: Vec<String>) -> ParticleOptions
pub fn item(ty: ParticleKey, layers: Vec<String>) -> ParticleOptions
ItemParticleOption: the stack’s layer particle sprites (BreakingItemParticle).
pub fn dust_transition(
ty: ParticleKey,
from: [f32; 3],
to: [f32; 3],
scale: f32,
) -> ParticleOptions
pub fn dust_transition( ty: ParticleKey, from: [f32; 3], to: [f32; 3], scale: f32, ) -> ParticleOptions
DustColorTransitionOptions.
pub fn sculk_to_redstone(ty: ParticleKey) -> ParticleOptions
pub fn sculk_to_redstone(ty: ParticleKey) -> ParticleOptions
DustColorTransitionOptions.SCULK_TO_REDSTONE.
pub fn sculk_charge(ty: ParticleKey, roll: f32) -> ParticleOptions
pub fn sculk_charge(ty: ParticleKey, roll: f32) -> ParticleOptions
SculkChargeParticleOptions(roll).
pub fn shriek(ty: ParticleKey, delay: i32) -> ParticleOptions
pub fn shriek(ty: ParticleKey, delay: i32) -> ParticleOptions
ShriekParticleOption(delay).
pub fn trail(
ty: ParticleKey,
target: [f64; 3],
rgb: u32,
duration: i32,
) -> ParticleOptions
pub fn trail( ty: ParticleKey, target: [f64; 3], rgb: u32, duration: i32, ) -> ParticleOptions
TrailParticleOption(target, color, duration).
pub fn block(ty: ParticleKey, sprite: String, tint: u32) -> ParticleOptions
pub fn dust(ty: ParticleKey, rgb: [f32; 3], scale: f32) -> ParticleOptions
pub fn dust(ty: ParticleKey, rgb: [f32; 3], scale: f32) -> ParticleOptions
DustParticleOptions(color, scale).
pub fn colored(ty: ParticleKey, rgba: [f32; 4]) -> ParticleOptions
Trait Implementations§
§impl Clone for ParticleOptions
impl Clone for ParticleOptions
§fn clone(&self) -> ParticleOptions
fn clone(&self) -> ParticleOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more