Struct DisplayRef
pub struct DisplayRef(/* private fields */);Expand description
A display entity of the open world (block_display, item_display or
text_display), narrowed with host.display.
Implementations§
§impl DisplayRef
impl DisplayRef
pub fn kind(self, host: &dyn Host) -> Option<DisplayKind>
pub fn kind(self, host: &dyn Host) -> Option<DisplayKind>
Side: server.
Which Display subclass the entity is.
pub fn transformation(self, host: &dyn Host) -> Option<Transformation>
pub fn transformation(self, host: &dyn Host) -> Option<Transformation>
Side: server.
Display.createTransformation: the transformation as shown.
pub fn billboard(self, host: &dyn Host) -> Option<Billboard>
pub fn billboard(self, host: &dyn Host) -> Option<Billboard>
Side: server.
Display.getBillboardConstraints.
pub fn brightness(self, host: &dyn Host) -> Option<(u8, u8)>
pub fn brightness(self, host: &dyn Host) -> Option<(u8, u8)>
Side: server.
Display.getBrightnessOverride: block and sky light, 0 to 15 each, or None for no override.
pub fn view_range(self, host: &dyn Host) -> Option<f32>
pub fn view_range(self, host: &dyn Host) -> Option<f32>
Side: server.
Display.getViewRange.
pub fn shadow_radius(self, host: &dyn Host) -> Option<f32>
pub fn shadow_radius(self, host: &dyn Host) -> Option<f32>
Side: server.
Display.getShadowRadius.
pub fn shadow_strength(self, host: &dyn Host) -> Option<f32>
pub fn shadow_strength(self, host: &dyn Host) -> Option<f32>
Side: server.
Display.getShadowStrength.
pub fn width(self, host: &dyn Host) -> Option<f32>
pub fn width(self, host: &dyn Host) -> Option<f32>
Side: server.
Display.getWidth: the culling box’s width, 0 for none.
pub fn height(self, host: &dyn Host) -> Option<f32>
pub fn height(self, host: &dyn Host) -> Option<f32>
Side: server.
Display.getHeight: the culling box’s height, 0 for none.
pub fn glow_color_override(self, host: &dyn Host) -> Option<i32>
pub fn glow_color_override(self, host: &dyn Host) -> Option<i32>
Side: server.
Display.getGlowColorOverride: an ARGB color, or -1 for none.
pub fn interpolation_duration(self, host: &dyn Host) -> Option<i32>
pub fn interpolation_duration(self, host: &dyn Host) -> Option<i32>
Side: server.
Display.getTransformationInterpolationDuration, in ticks.
pub fn start_interpolation(self, host: &dyn Host) -> Option<i32>
pub fn start_interpolation(self, host: &dyn Host) -> Option<i32>
Side: server.
Display.getTransformationInterpolationDelay: ticks before an
interpolation starts.
pub fn teleport_duration(self, host: &dyn Host) -> Option<i32>
pub fn teleport_duration(self, host: &dyn Host) -> Option<i32>
Side: server.
Display.getPosRotInterpolationDuration: ticks a move eases over, 0 to 59.
pub fn text(self, host: &dyn Host) -> Result<Option<Text>, TextFormError>
pub fn text(self, host: &dyn Host) -> Result<Option<Text>, TextFormError>
Side: server.
TextDisplay.getText; None for another kind of display.
Refuses text deeper than 512 component nodes before applying any changes.
pub fn line_width(self, host: &dyn Host) -> Option<i32>
pub fn line_width(self, host: &dyn Host) -> Option<i32>
Side: server.
TextDisplay.getLineWidth.
pub fn background(self, host: &dyn Host) -> Option<i32>
pub fn background(self, host: &dyn Host) -> Option<i32>
Side: server.
TextDisplay.getBackgroundColor: ARGB.
pub fn text_opacity(self, host: &dyn Host) -> Option<i8>
pub fn text_opacity(self, host: &dyn Host) -> Option<i8>
Side: server.
TextDisplay.getTextOpacity: -1 is opaque, else 0 to 127 then -128 to -2.
pub fn text_shadow(self, host: &dyn Host) -> Option<bool>
pub fn text_shadow(self, host: &dyn Host) -> Option<bool>
Side: server.
TextDisplay.FLAG_SHADOW.
pub fn see_through(self, host: &dyn Host) -> Option<bool>
pub fn see_through(self, host: &dyn Host) -> Option<bool>
Side: server.
TextDisplay.FLAG_SEE_THROUGH.
pub fn default_background(self, host: &dyn Host) -> Option<bool>
pub fn default_background(self, host: &dyn Host) -> Option<bool>
Side: server.
TextDisplay.FLAG_USE_DEFAULT_BACKGROUND.
pub fn alignment(self, host: &dyn Host) -> Option<TextAlignment>
pub fn alignment(self, host: &dyn Host) -> Option<TextAlignment>
Side: server.
TextDisplay.getAlign, from the left and right flags.
pub fn block_state(self, host: &dyn Host) -> Option<BlockState>
pub fn block_state(self, host: &dyn Host) -> Option<BlockState>
Side: server.
BlockDisplay.getBlockState; None for another kind of display.
pub fn item(self, host: &dyn Host) -> Option<ItemStack>
pub fn item(self, host: &dyn Host) -> Option<ItemStack>
Side: server.
ItemDisplay.getItemStack; None for another kind of display or an empty stack.
pub fn item_context(self, host: &dyn Host) -> Option<ItemDisplayContext>
pub fn item_context(self, host: &dyn Host) -> Option<ItemDisplayContext>
Side: server.
ItemDisplay.getItemTransform: how the item is displayed.
pub fn set_transformation(
self,
host: &mut dyn ServerHost,
transformation: Transformation,
) -> bool
pub fn set_transformation( self, host: &mut dyn ServerHost, transformation: Transformation, ) -> bool
Side: server.
Sets the transformation. False for a value that isn’t finite or a
zero quaternion. Clients ease to it when the start delay is set
(set_start_interpolation).
pub fn set_billboard(
self,
host: &mut dyn ServerHost,
billboard: Billboard,
) -> bool
pub fn set_billboard( self, host: &mut dyn ServerHost, billboard: Billboard, ) -> bool
Side: server.
Display.setBillboardConstraints.
pub fn set_brightness(
self,
host: &mut dyn ServerHost,
brightness: Option<(u8, u8)>,
) -> bool
pub fn set_brightness( self, host: &mut dyn ServerHost, brightness: Option<(u8, u8)>, ) -> bool
Side: server.
Display.setBrightnessOverride; None clears the override. False for a
light level above 15.
pub fn set_view_range(self, host: &mut dyn ServerHost, range: f32) -> bool
pub fn set_view_range(self, host: &mut dyn ServerHost, range: f32) -> bool
Side: server.
Display.setViewRange. False for a value that isn’t finite.
pub fn set_shadow_radius(self, host: &mut dyn ServerHost, radius: f32) -> bool
pub fn set_shadow_radius(self, host: &mut dyn ServerHost, radius: f32) -> bool
Side: server.
Display.setShadowRadius. False for a value that isn’t finite.
pub fn set_shadow_strength(
self,
host: &mut dyn ServerHost,
strength: f32,
) -> bool
pub fn set_shadow_strength( self, host: &mut dyn ServerHost, strength: f32, ) -> bool
Side: server.
Display.setShadowStrength. False for a value that isn’t finite.
pub fn set_width(self, host: &mut dyn ServerHost, width: f32) -> bool
pub fn set_width(self, host: &mut dyn ServerHost, width: f32) -> bool
Side: server.
Display.setWidth. False for a value that isn’t finite.
pub fn set_height(self, host: &mut dyn ServerHost, height: f32) -> bool
pub fn set_height(self, host: &mut dyn ServerHost, height: f32) -> bool
Side: server.
Display.setHeight. False for a value that isn’t finite.
pub fn set_glow_color_override(
self,
host: &mut dyn ServerHost,
color: i32,
) -> bool
pub fn set_glow_color_override( self, host: &mut dyn ServerHost, color: i32, ) -> bool
Side: server.
Display.setGlowColorOverride.
pub fn set_interpolation_duration(
self,
host: &mut dyn ServerHost,
ticks: i32,
) -> bool
pub fn set_interpolation_duration( self, host: &mut dyn ServerHost, ticks: i32, ) -> bool
Side: server.
Display.setTransformationInterpolationDuration.
pub fn set_start_interpolation(
self,
host: &mut dyn ServerHost,
ticks: i32,
) -> bool
pub fn set_start_interpolation( self, host: &mut dyn ServerHost, ticks: i32, ) -> bool
Side: server.
Display.setTransformationInterpolationDelay. Like vanilla, every
call is sent to the clients that track the display, even with the
delay it already has, and each client restarts its interpolation.
pub fn set_teleport_duration(
self,
host: &mut dyn ServerHost,
ticks: i32,
) -> bool
pub fn set_teleport_duration( self, host: &mut dyn ServerHost, ticks: i32, ) -> bool
Side: server.
Display.setPosRotInterpolationDuration, kept from 0 to 59 as
vanilla’s load keeps it.
pub fn set_text(
self,
host: &mut dyn ServerHost,
text: Text,
) -> Result<bool, TextFormError>
pub fn set_text( self, host: &mut dyn ServerHost, text: Text, ) -> Result<bool, TextFormError>
Side: server.
TextDisplay.setText; false for another kind of display.
Refuses text deeper than 512 component nodes before applying any changes.
pub fn set_line_width(self, host: &mut dyn ServerHost, width: i32) -> bool
pub fn set_line_width(self, host: &mut dyn ServerHost, width: i32) -> bool
Side: server.
TextDisplay.setLineWidth; false for another kind of display.
pub fn set_background(self, host: &mut dyn ServerHost, argb: i32) -> bool
pub fn set_background(self, host: &mut dyn ServerHost, argb: i32) -> bool
Side: server.
TextDisplay.setBackgroundColor; false for another kind of display.
pub fn set_text_opacity(self, host: &mut dyn ServerHost, opacity: i8) -> bool
pub fn set_text_opacity(self, host: &mut dyn ServerHost, opacity: i8) -> bool
Side: server.
TextDisplay.setTextOpacity; false for another kind of display.
pub fn set_text_shadow(self, host: &mut dyn ServerHost, on: bool) -> bool
pub fn set_text_shadow(self, host: &mut dyn ServerHost, on: bool) -> bool
Side: server. Sets the shadow flag; false for another kind of display.
pub fn set_see_through(self, host: &mut dyn ServerHost, on: bool) -> bool
pub fn set_see_through(self, host: &mut dyn ServerHost, on: bool) -> bool
Side: server. Sets the see-through flag; false for another kind of display.
pub fn set_default_background(self, host: &mut dyn ServerHost, on: bool) -> bool
pub fn set_default_background(self, host: &mut dyn ServerHost, on: bool) -> bool
Side: server. Sets the default-background flag; false for another kind of display.
pub fn set_alignment(
self,
host: &mut dyn ServerHost,
alignment: TextAlignment,
) -> bool
pub fn set_alignment( self, host: &mut dyn ServerHost, alignment: TextAlignment, ) -> bool
Side: server. Sets the alignment; false for another kind of display.
pub fn set_block_state(
self,
host: &mut dyn ServerHost,
state: BlockState,
) -> bool
pub fn set_block_state( self, host: &mut dyn ServerHost, state: BlockState, ) -> bool
Side: server.
BlockDisplay.setBlockState; false for another kind of display or an unknown state.
pub fn set_item(
self,
host: &mut dyn ServerHost,
stack: Option<ItemStack>,
) -> Result<bool, StackWriteError>
pub fn set_item( self, host: &mut dyn ServerHost, stack: Option<ItemStack>, ) -> Result<bool, StackWriteError>
Side: server.
ItemDisplay.setItemStack; None empties it. False for another kind of display.
pub fn set_item_context(
self,
host: &mut dyn ServerHost,
context: ItemDisplayContext,
) -> bool
pub fn set_item_context( self, host: &mut dyn ServerHost, context: ItemDisplayContext, ) -> bool
Side: server.
ItemDisplay.setItemTransform; false for another kind of display.
§impl DisplayRef
impl DisplayRef
Trait Implementations§
§impl Clone for DisplayRef
impl Clone for DisplayRef
§fn clone(&self) -> DisplayRef
fn clone(&self) -> DisplayRef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more