pub struct Piston(pub Address);Expand description
The piston component (3 methods).
Provided by OpenComputers’ UpgradePiston, UpgradePiston$Drone, UpgradePiston$Rotatable, UpgradePiston$Tablet, UpgradeStickyPiston, UpgradeStickyPiston$Drone, UpgradeStickyPiston$Rotatable, UpgradeStickyPiston$Tablet.
Tuple Fields§
§0: AddressImplementations§
Source§impl Piston
impl Piston
Sourcepub fn is_sticky(&self) -> Result<bool>
pub fn is_sticky(&self) -> Result<bool>
Returns true if the piston is sticky, i.e. it can also pull.
Lua: piston.isSticky():boolean
Indirect call: waits for the next server tick.
Sourcepub async fn is_sticky_async(&self) -> Result<bool>
pub async fn is_sticky_async(&self) -> Result<bool>
Self::is_sticky without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn pull(&self, side: Option<Number>) -> Result<bool>
pub fn pull(&self, side: Option<Number>) -> Result<bool>
Tries to reach out to the side given (default front) and pull a block similar to a vanilla sticky piston.
Lua: piston.pull([side:number]):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn pull_async(&self, side: Option<Number>) -> Result<bool>
pub async fn pull_async(&self, side: Option<Number>) -> Result<bool>
Self::pull without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn push(&self, side: Option<Number>) -> Result<bool>
pub fn push(&self, side: Option<Number>) -> Result<bool>
Tries to push the block on the specified side of the container of the upgrade. Defaults to front.
Lua: piston.push([side:number]):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn push_async(&self, side: Option<Number>) -> Result<bool>
pub async fn push_async(&self, side: Option<Number>) -> Result<bool>
Self::push 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 Piston
impl Component for Piston
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.