pub struct Hologram(pub Address);Expand description
The hologram component (16 methods).
Provided by OpenComputers’ Hologram.
Tuple Fields§
§0: AddressImplementations§
Source§impl Hologram
impl Hologram
Sourcepub fn clear(&self) -> Result<()>
pub fn clear(&self) -> Result<()>
Clears the hologram.
Lua: hologram.clear()
Indirect call: waits for the next server tick.
Sourcepub async fn clear_async(&self) -> Result<()>
pub async fn clear_async(&self) -> Result<()>
Self::clear without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn copy(
&self,
x: impl Into<Number>,
z: impl Into<Number>,
sx: impl Into<Number>,
sz: impl Into<Number>,
tx: impl Into<Number>,
tz: impl Into<Number>,
) -> Result<()>
pub fn copy( &self, x: impl Into<Number>, z: impl Into<Number>, sx: impl Into<Number>, sz: impl Into<Number>, tx: impl Into<Number>, tz: impl Into<Number>, ) -> Result<()>
Copies an area of columns by the specified translation.
Lua: hologram.copy(x:number, z:number, sx:number, sz:number, tx:number, tz:number)
Indirect call: waits for the next server tick.
Sourcepub async fn copy_async(
&self,
x: impl Into<Number>,
z: impl Into<Number>,
sx: impl Into<Number>,
sz: impl Into<Number>,
tx: impl Into<Number>,
tz: impl Into<Number>,
) -> Result<()>
pub async fn copy_async( &self, x: impl Into<Number>, z: impl Into<Number>, sx: impl Into<Number>, sz: impl Into<Number>, tx: impl Into<Number>, tz: impl Into<Number>, ) -> Result<()>
Self::copy without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn fill(
&self,
x: impl Into<Number>,
z: impl Into<Number>,
min_y: Option<Number>,
max_y: Option<Number>,
value: Option<Value>,
) -> Result<()>
pub fn fill( &self, x: impl Into<Number>, z: impl Into<Number>, min_y: Option<Number>, max_y: Option<Number>, value: Option<Value>, ) -> Result<()>
Fills an interval of a column with the specified value.
Lua: hologram.fill(x:number, z:number[, minY:number], maxY:number, value:number or boolean)
Direct call (runs immediately, drawing on the per-tick budget; OC’s limit 128).
Sourcepub async fn fill_async(
&self,
x: impl Into<Number>,
z: impl Into<Number>,
min_y: Option<Number>,
max_y: Option<Number>,
value: Option<Value>,
) -> Result<()>
pub async fn fill_async( &self, x: impl Into<Number>, z: impl Into<Number>, min_y: Option<Number>, max_y: Option<Number>, value: Option<Value>, ) -> Result<()>
Self::fill without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get(
&self,
x: impl Into<Number>,
y: impl Into<Number>,
z: impl Into<Number>,
) -> Result<Number>
pub fn get( &self, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<Number>
Returns the value for the specified voxel.
Lua: hologram.get(x:number, y:number, z:number):number
Direct call (runs immediately, drawing on the per-tick budget).
Sourcepub async fn get_async(
&self,
x: impl Into<Number>,
y: impl Into<Number>,
z: impl Into<Number>,
) -> Result<Number>
pub async fn get_async( &self, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<Number>
Self::get without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_dimensions(&self) -> Result<(Number, Number, Number)>
pub fn get_dimensions(&self) -> Result<(Number, Number, Number)>
Get the dimension of the x,y,z axes.
Lua: hologram.getDimensions():number, number, number
Direct call (runs immediately, drawing on the per-tick budget).
Sourcepub async fn get_dimensions_async(&self) -> Result<(Number, Number, Number)>
pub async fn get_dimensions_async(&self) -> Result<(Number, Number, Number)>
Self::get_dimensions without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_palette_color(&self, index: impl Into<Number>) -> Result<Number>
pub fn get_palette_color(&self, index: impl Into<Number>) -> Result<Number>
Get the color defined for the specified value.
Lua: hologram.getPaletteColor(index:number):number
Indirect call: waits for the next server tick.
Sourcepub async fn get_palette_color_async(
&self,
index: impl Into<Number>,
) -> Result<Number>
pub async fn get_palette_color_async( &self, index: impl Into<Number>, ) -> Result<Number>
Self::get_palette_color without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_scale(&self) -> Result<Number>
pub fn get_scale(&self) -> Result<Number>
Returns the render scale of the hologram.
Lua: hologram.getScale():number
Direct call (runs immediately, drawing on the per-tick budget).
Sourcepub async fn get_scale_async(&self) -> Result<Number>
pub async fn get_scale_async(&self) -> Result<Number>
Self::get_scale without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_translation(&self) -> Result<(Number, Number, Number)>
pub fn get_translation(&self) -> Result<(Number, Number, Number)>
Returns the relative render projection offsets of the hologram.
Lua: hologram.getTranslation():number, number, number
Direct call (runs immediately, drawing on the per-tick budget).
Sourcepub async fn get_translation_async(&self) -> Result<(Number, Number, Number)>
pub async fn get_translation_async(&self) -> Result<(Number, Number, Number)>
Self::get_translation without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn max_depth(&self) -> Result<Number>
pub fn max_depth(&self) -> Result<Number>
The color depth supported by the hologram.
Lua: hologram.maxDepth():number
Direct call (runs immediately, drawing on the per-tick budget).
Sourcepub async fn max_depth_async(&self) -> Result<Number>
pub async fn max_depth_async(&self) -> Result<Number>
Self::max_depth without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set(
&self,
x: impl Into<Number>,
y: impl Into<Number>,
z: impl Into<Number>,
value: impl Into<Value>,
) -> Result<()>
pub fn set( &self, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, value: impl Into<Value>, ) -> Result<()>
Set the value for the specified voxel.
Lua: hologram.set(x:number, y:number, z:number, value:number or boolean)
Direct call (runs immediately, drawing on the per-tick budget; OC’s limit 256).
Sourcepub async fn set_async(
&self,
x: impl Into<Number>,
y: impl Into<Number>,
z: impl Into<Number>,
value: impl Into<Value>,
) -> Result<()>
pub async fn set_async( &self, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, value: impl Into<Value>, ) -> Result<()>
Self::set without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_palette_color(
&self,
index: impl Into<Number>,
value: impl Into<Number>,
) -> Result<Number>
pub fn set_palette_color( &self, index: impl Into<Number>, value: impl Into<Number>, ) -> Result<Number>
Set the color defined for the specified value.
Lua: hologram.setPaletteColor(index:number, value:number):number
Indirect call: waits for the next server tick.
Sourcepub async fn set_palette_color_async(
&self,
index: impl Into<Number>,
value: impl Into<Number>,
) -> Result<Number>
pub async fn set_palette_color_async( &self, index: impl Into<Number>, value: impl Into<Number>, ) -> Result<Number>
Self::set_palette_color without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_raw(&self, data: impl AsRef<[u8]>) -> Result<()>
pub fn set_raw(&self, data: impl AsRef<[u8]>) -> Result<()>
Set the raw buffer to the specified byte array, where each byte represents a voxel color. Nesting is x,z,y.
Lua: hologram.setRaw(data:string)
Indirect call: waits for the next server tick.
Sourcepub async fn set_raw_async(&self, data: impl AsRef<[u8]>) -> Result<()>
pub async fn set_raw_async(&self, data: impl AsRef<[u8]>) -> Result<()>
Self::set_raw without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_rotation(
&self,
angle: impl Into<Number>,
x: impl Into<Number>,
y: impl Into<Number>,
z: impl Into<Number>,
) -> Result<bool>
pub fn set_rotation( &self, angle: impl Into<Number>, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<bool>
Set the base rotation of the displayed hologram.
Lua: hologram.setRotation(angle:number, x:number, y:number, z:number):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn set_rotation_async(
&self,
angle: impl Into<Number>,
x: impl Into<Number>,
y: impl Into<Number>,
z: impl Into<Number>,
) -> Result<bool>
pub async fn set_rotation_async( &self, angle: impl Into<Number>, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<bool>
Self::set_rotation without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_rotation_speed(
&self,
speed: impl Into<Number>,
x: impl Into<Number>,
y: impl Into<Number>,
z: impl Into<Number>,
) -> Result<bool>
pub fn set_rotation_speed( &self, speed: impl Into<Number>, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<bool>
Set the rotation speed of the displayed hologram.
Lua: hologram.setRotationSpeed(speed:number, x:number, y:number, z:number):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn set_rotation_speed_async(
&self,
speed: impl Into<Number>,
x: impl Into<Number>,
y: impl Into<Number>,
z: impl Into<Number>,
) -> Result<bool>
pub async fn set_rotation_speed_async( &self, speed: impl Into<Number>, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<bool>
Self::set_rotation_speed without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_scale(&self, value: impl Into<Number>) -> Result<()>
pub fn set_scale(&self, value: impl Into<Number>) -> Result<()>
Set the render scale. A larger scale consumes more energy.
Lua: hologram.setScale(value:number)
Indirect call: waits for the next server tick.
Sourcepub async fn set_scale_async(&self, value: impl Into<Number>) -> Result<()>
pub async fn set_scale_async(&self, value: impl Into<Number>) -> Result<()>
Self::set_scale without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_translation(
&self,
tx: impl Into<Number>,
ty: impl Into<Number>,
tz: impl Into<Number>,
) -> Result<()>
pub fn set_translation( &self, tx: impl Into<Number>, ty: impl Into<Number>, tz: impl Into<Number>, ) -> Result<()>
Sets the relative render projection offsets of the hologram.
Lua: hologram.setTranslation(tx:number, ty:number, tz:number)
Indirect call: waits for the next server tick.
Sourcepub async fn set_translation_async(
&self,
tx: impl Into<Number>,
ty: impl Into<Number>,
tz: impl Into<Number>,
) -> Result<()>
pub async fn set_translation_async( &self, tx: impl Into<Number>, ty: impl Into<Number>, tz: impl Into<Number>, ) -> Result<()>
Self::set_translation 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 Hologram
impl Component for Hologram
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.