Search in sources :

Example 1 with ContraptionBargeEntity

use of dev.murad.littlecontraptions.entity.ContraptionBargeEntity in project LittleContraptions by EDToaster.

the class BargeAssemblerBlockEntity method disassemble.

protected void disassemble(Level world, BlockPos pos, ContraptionBargeEntity barge) {
    if (barge.getPassengers().isEmpty())
        return;
    Entity entity = barge.getPassengers().get(0);
    if (!(entity instanceof OrientedContraptionEntity))
        return;
    OrientedContraptionEntity contraption = (OrientedContraptionEntity) entity;
    contraption.yaw = BargeAssemblerBlock.getHorizontalDirection(getBlockState()).toYRot();
    barge.ejectPassengers();
}
Also used : ContraptionBargeEntity(dev.murad.littlecontraptions.entity.ContraptionBargeEntity) OrientedContraptionEntity(com.simibubi.create.content.contraptions.components.structureMovement.OrientedContraptionEntity) BlockEntity(net.minecraft.world.level.block.entity.BlockEntity) Entity(net.minecraft.world.entity.Entity) CartAssemblerTileEntity(com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssemblerTileEntity) OrientedContraptionEntity(com.simibubi.create.content.contraptions.components.structureMovement.OrientedContraptionEntity)

Aggregations

OrientedContraptionEntity (com.simibubi.create.content.contraptions.components.structureMovement.OrientedContraptionEntity)1 CartAssemblerTileEntity (com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssemblerTileEntity)1 ContraptionBargeEntity (dev.murad.littlecontraptions.entity.ContraptionBargeEntity)1 Entity (net.minecraft.world.entity.Entity)1 BlockEntity (net.minecraft.world.level.block.entity.BlockEntity)1