Skip to main content

Printer3d

Struct Printer3d 

Source
pub struct Printer3d(pub Address);
Expand description

The printer3d component (18 methods).

Provided by OpenComputers’ Printer.

Tuple Fields§

§0: Address

Implementations§

Source§

impl Printer3d

Source

pub fn add_shape( &self, min_x: impl Into<Number>, min_y: impl Into<Number>, min_z: impl Into<Number>, max_x: impl Into<Number>, max_y: impl Into<Number>, max_z: impl Into<Number>, texture: impl AsRef<[u8]>, state: Option<bool>, tint: Option<Number>, ) -> Result<()>

Adds a shape to the printers configuration, optionally specifying whether it is for the off or on state.

Lua: printer3d.addShape(minX:number, minY:number, minZ:number, maxX:number, maxY:number, maxZ:number, texture:string[, state:boolean=false][,tint:number]) Indirect call: waits for the next server tick. state defaults to false.

Source

pub async fn add_shape_async( &self, min_x: impl Into<Number>, min_y: impl Into<Number>, min_z: impl Into<Number>, max_x: impl Into<Number>, max_y: impl Into<Number>, max_z: impl Into<Number>, texture: impl AsRef<[u8]>, state: Option<bool>, tint: Option<Number>, ) -> Result<()>

Self::add_shape without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn commit(&self, count: Option<Number>) -> Result<bool>

Commit and begin printing the current configuration.

Lua: printer3d.commit([count:number]):boolean Indirect call: waits for the next server tick.

Source

pub async fn commit_async(&self, count: Option<Number>) -> Result<bool>

Self::commit without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_label(&self) -> Result<OcString>

Get the current label for the block being printed.

Lua: printer3d.getLabel():string Indirect call: waits for the next server tick.

Source

pub async fn get_label_async(&self) -> Result<OcString>

Self::get_label without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_light_level(&self) -> Result<Number>

Get which light level the printed block should have.

Lua: printer3d.getLightLevel():number Indirect call: waits for the next server tick.

Source

pub async fn get_light_level_async(&self) -> Result<Number>

Self::get_light_level without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_max_shape_count(&self) -> Result<Number>

Get the maximum allowed number of shapes.

Lua: printer3d.getMaxShapeCount():number Indirect call: waits for the next server tick.

Source

pub async fn get_max_shape_count_async(&self) -> Result<Number>

Self::get_max_shape_count without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_shape_count(&self) -> Result<Number>

Get the number of shapes in the current configuration.

Lua: printer3d.getShapeCount():number Indirect call: waits for the next server tick.

Source

pub async fn get_shape_count_async(&self) -> Result<Number>

Self::get_shape_count without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_tooltip(&self) -> Result<OcString>

Get the current tooltip for the block being printed.

Lua: printer3d.getTooltip():string Indirect call: waits for the next server tick.

Source

pub async fn get_tooltip_async(&self) -> Result<OcString>

Self::get_tooltip without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn is_button_mode(&self) -> Result<bool>

Get whether the printed block should automatically return to its off state.

Lua: printer3d.isButtonMode():boolean Indirect call: waits for the next server tick.

Source

pub async fn is_button_mode_async(&self) -> Result<bool>

Self::is_button_mode without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn is_collidable(&self) -> Result<(bool, bool)>

Get whether the printed block should be collidable or not.

Lua: printer3d.isCollidable():boolean, boolean Indirect call: waits for the next server tick.

Source

pub async fn is_collidable_async(&self) -> Result<(bool, bool)>

Self::is_collidable without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn is_redstone_emitter(&self) -> Result<(bool, Number)>

Get whether the printed block should emit redstone when in its active state.

Lua: printer3d.isRedstoneEmitter():boolean, number Indirect call: waits for the next server tick.

Source

pub async fn is_redstone_emitter_async(&self) -> Result<(bool, Number)>

Self::is_redstone_emitter without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn reset(&self) -> Result<()>

Resets the configuration of the printer and stop printing (current job will finish).

Lua: printer3d.reset() Indirect call: waits for the next server tick.

Source

pub async fn reset_async(&self) -> Result<()>

Self::reset without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set_button_mode(&self, value: bool) -> Result<()>

Set whether the printed block should automatically return to its off state.

Lua: printer3d.setButtonMode(value:boolean) Indirect call: waits for the next server tick.

Source

pub async fn set_button_mode_async(&self, value: bool) -> Result<()>

Self::set_button_mode without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set_collidable(&self, collide_off: bool, collide_on: bool) -> Result<()>

Set whether the printed block should be collidable or not.

Lua: printer3d.setCollidable(collideOff:boolean, collideOn:boolean) Indirect call: waits for the next server tick.

Source

pub async fn set_collidable_async( &self, collide_off: bool, collide_on: bool, ) -> Result<()>

Self::set_collidable without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set_label(&self, value: impl AsRef<[u8]>) -> Result<()>

Set a label for the block being printed.

Lua: printer3d.setLabel(value:string) Indirect call: waits for the next server tick.

Source

pub async fn set_label_async(&self, value: impl AsRef<[u8]>) -> Result<()>

Self::set_label without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set_light_level(&self, value: impl Into<Number>) -> Result<()>

Set what light level the printed block should have.

Lua: printer3d.setLightLevel(value:number) Indirect call: waits for the next server tick.

Source

pub async fn set_light_level_async( &self, value: impl Into<Number>, ) -> Result<()>

Self::set_light_level without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set_redstone_emitter(&self, value: impl Into<Value>) -> Result<()>

Set whether the printed block should emit redstone when in its active state.

Lua: printer3d.setRedstoneEmitter(value:boolean or number) Indirect call: waits for the next server tick.

Source

pub async fn set_redstone_emitter_async( &self, value: impl Into<Value>, ) -> Result<()>

Self::set_redstone_emitter without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set_tooltip(&self, value: impl AsRef<[u8]>) -> Result<()>

Set a tooltip for the block being printed.

Lua: printer3d.setTooltip(value:string) Indirect call: waits for the next server tick.

Source

pub async fn set_tooltip_async(&self, value: impl AsRef<[u8]>) -> Result<()>

Self::set_tooltip without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn status(&self) -> Result<(OcString, Value)>

The current state of the printer, busy' or idle’, followed by the progress or model validity, respectively.

Lua: printer3d.status(): string, number or boolean Indirect call: waits for the next server tick.

Source

pub async fn status_async(&self) -> Result<(OcString, Value)>

Self::status without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Trait Implementations§

Source§

impl Clone for Printer3d

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Component for Printer3d

Source§

const KIND: &'static str = "printer3d"

The OpenComputers component type, such as "gpu".
Source§

fn from_address(address: Address) -> Self

Wraps an address without checking what is there.
Source§

fn address(&self) -> &Address

Source§

fn first() -> Option<Self>

The first component of this type, by address order.
Source§

fn all() -> Vec<Self>

Every component of this type, by address order.
Source§

fn at(address: impl Into<Address>) -> Option<Self>

The component at address, if it is of this type.
Source§

fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>

An untyped call, for methods the wrapper doesn’t know.
Source§

fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ

Component::invoke without blocking; see invoke_async.
Source§

impl Debug for Printer3d

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Printer3d

Source§

impl Hash for Printer3d

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Printer3d

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Printer3d

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.