pub struct Printer3d(pub Address);Expand description
The printer3d component (18 methods).
Provided by OpenComputers’ Printer.
Tuple Fields§
§0: AddressImplementations§
Source§impl Printer3d
impl Printer3d
Sourcepub 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<()>
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.
Sourcepub 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<()>
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.
Sourcepub fn commit(&self, count: Option<Number>) -> Result<bool>
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.
Sourcepub async fn commit_async(&self, count: Option<Number>) -> Result<bool>
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.
Sourcepub fn get_label(&self) -> Result<OcString>
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.
Sourcepub async fn get_label_async(&self) -> Result<OcString>
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.
Sourcepub fn get_light_level(&self) -> Result<Number>
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.
Sourcepub async fn get_light_level_async(&self) -> Result<Number>
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.
Sourcepub fn get_max_shape_count(&self) -> Result<Number>
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.
Sourcepub async fn get_max_shape_count_async(&self) -> Result<Number>
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.
Sourcepub fn get_shape_count(&self) -> Result<Number>
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.
Sourcepub async fn get_shape_count_async(&self) -> Result<Number>
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.
Sourcepub fn get_tooltip(&self) -> Result<OcString>
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.
Sourcepub async fn get_tooltip_async(&self) -> Result<OcString>
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.
Get whether the printed block should automatically return to its off state.
Lua: printer3d.isButtonMode():boolean
Indirect call: waits for the next server tick.
Self::is_button_mode without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn is_collidable(&self) -> Result<(bool, bool)>
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.
Sourcepub async fn is_collidable_async(&self) -> Result<(bool, bool)>
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.
Sourcepub fn is_redstone_emitter(&self) -> Result<(bool, Number)>
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.
Sourcepub async fn is_redstone_emitter_async(&self) -> Result<(bool, Number)>
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.
Sourcepub fn reset(&self) -> Result<()>
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.
Sourcepub async fn reset_async(&self) -> Result<()>
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.
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.
Self::set_button_mode without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_collidable(&self, collide_off: bool, collide_on: bool) -> Result<()>
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.
Sourcepub async fn set_collidable_async(
&self,
collide_off: bool,
collide_on: bool,
) -> Result<()>
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.
Sourcepub fn set_label(&self, value: impl AsRef<[u8]>) -> Result<()>
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.
Sourcepub async fn set_label_async(&self, value: impl AsRef<[u8]>) -> Result<()>
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.
Sourcepub fn set_light_level(&self, value: impl Into<Number>) -> Result<()>
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.
Sourcepub async fn set_light_level_async(
&self,
value: impl Into<Number>,
) -> Result<()>
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.
Sourcepub fn set_redstone_emitter(&self, value: impl Into<Value>) -> Result<()>
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.
Sourcepub async fn set_redstone_emitter_async(
&self,
value: impl Into<Value>,
) -> Result<()>
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.
Sourcepub fn set_tooltip(&self, value: impl AsRef<[u8]>) -> Result<()>
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.
Sourcepub async fn set_tooltip_async(&self, value: impl AsRef<[u8]>) -> Result<()>
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.
Sourcepub fn status(&self) -> Result<(OcString, Value)>
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.
Sourcepub async fn status_async(&self) -> Result<(OcString, Value)>
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 Component for Printer3d
impl Component for Printer3d
Source§fn from_address(address: Address) -> Self
fn from_address(address: Address) -> Self
fn address(&self) -> &Address
Source§fn at(address: impl Into<Address>) -> Option<Self>
fn at(address: impl Into<Address>) -> Option<Self>
address, if it is of this type.Source§fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>
fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>
Source§fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ
fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ
Component::invoke without blocking; see invoke_async.