Search in sources :

Example 1 with ChassisTileEntity

use of com.simibubi.create.content.contraptions.components.structureMovement.chassis.ChassisTileEntity in project Create by Creators-of-Create.

the class Contraption method moveChassis.

private boolean moveChassis(Level world, BlockPos pos, Direction movementDirection, Queue<BlockPos> frontier, Set<BlockPos> visited) {
    BlockEntity te = world.getBlockEntity(pos);
    if (!(te instanceof ChassisTileEntity))
        return false;
    ChassisTileEntity chassis = (ChassisTileEntity) te;
    chassis.addAttachedChasses(frontier, visited);
    List<BlockPos> includedBlockPositions = chassis.getIncludedBlockPositions(movementDirection, false);
    if (includedBlockPositions == null)
        return false;
    for (BlockPos blockPos : includedBlockPositions) if (!visited.contains(blockPos))
        frontier.add(blockPos);
    return true;
}
Also used : ChassisTileEntity(com.simibubi.create.content.contraptions.components.structureMovement.chassis.ChassisTileEntity) BlockPos(net.minecraft.core.BlockPos) BlockEntity(net.minecraft.world.level.block.entity.BlockEntity)

Aggregations

ChassisTileEntity (com.simibubi.create.content.contraptions.components.structureMovement.chassis.ChassisTileEntity)1 BlockPos (net.minecraft.core.BlockPos)1 BlockEntity (net.minecraft.world.level.block.entity.BlockEntity)1