PistonStructureResolver

Link to pistonstructureresolver

Импорт класса

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
Copy
import crafttweaker.api.block.type.piston.PistonStructureResolver;

Link to getPushDirection

Name: getPushDirection

Gets the direction that the piston is moving.

This is usually the direction that the piston block is facing, however if the piston is retracting, the direction is the opposite.

Returns: The direction that the piston is moving.
Return Type: Direction

ZenScript
Copy
// PistonStructureResolver.getPushDirection() as Direction

myPistonStructureResolver.getPushDirection();

Name: getToDestroy

Gets the blocks that will be destroyed by pushing the piston.

Returns: The blocks that will be destroyed.
Return Type: stdlib.List<BlockPos>

ZenScript
Copy
// PistonStructureResolver.getToDestroy() as stdlib.List<BlockPos>

myPistonStructureResolver.getToDestroy();

Name: getToPush

Gets the blocks that will be pushed.

Returns: The blocks that will be pushed.
Return Type: stdlib.List<BlockPos>

ZenScript
Copy
// PistonStructureResolver.getToPush() as stdlib.List<BlockPos>

myPistonStructureResolver.getToPush();

Name: resolve

Calculates and caches the blocks to push and the blocks to destroy.

Returns: True if blocks should move, false otherwise
Return Type: boolean

ZenScript
Copy
// PistonStructureResolver.resolve() as boolean

myPistonStructureResolver.resolve();

Свойства

Link to свойства

НазваниеТипИмеет GetterИмеет SetterОписание
Название
pushDirection
Тип
Direction
Имеет Getter
true
Имеет Setter
false
Описание
Gets the direction that the piston is moving.

This is usually the direction that the piston block is facing, however if the piston is retracting, the direction is the opposite.
Название
toDestroy
Тип
stdlib.List<BlockPos>
Имеет Getter
true
Имеет Setter
false
Описание
Gets the blocks that will be destroyed by pushing the piston.
Название
toPush
Тип
stdlib.List<BlockPos>
Имеет Getter
true
Имеет Setter
false
Описание
Gets the blocks that will be pushed.