SequenceContext<T : Object, U : Object>
Link to sequencecontextt--object-u--object
A SequenceContext provides more data to Sequence<T,U>s and allows a sequence to be stopped from inside a task.
导入类
Link to 导入类
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.util.sequence.SequenceContext;
Constructor #构造函数
Link to constructor-构造函数
ZenScript Copynew SequenceContext<T,U>(sequence as Sequence<T,U>, data as U) as SequenceContext<T,U>
参数 | 类型 |
---|---|
参数 sequence | 类型 Sequence<T,U> |
参数 data | 类型 U |
使用方式
Link to 使用方式
Name: getData
Gets the data provided to the sequence.
Note, this can never return null, if the data is null then it will throw an error.
Returns: The data provided to the sequence or an error if null was provided.
Return Type: U
ZenScript Copy// SequenceContext.getData() as U
mySequenceContext.getData();
Name: stop
Stop the sequence.
ZenScript Copy// SequenceContext.stop()
mySequenceContext.stop();
名称 | 类型 | 可获得 | 可设置 | 描述 |
---|---|---|---|---|
名称 data | 类型 U | 可获得 true | 可设置 false | 描述 Gets the data provided to the sequence. Note, this can never return null, if the data is null then it will throw an error. |