Search in sources :

Example 1 with SeatEntity

use of com.simibubi.create.content.contraptions.components.actors.SeatEntity in project Create by Creators-of-Create.

the class Contraption method moveSeat.

private void moveSeat(Level world, BlockPos pos) {
    BlockPos local = toLocalPos(pos);
    getSeats().add(local);
    List<SeatEntity> seatsEntities = world.getEntitiesOfClass(SeatEntity.class, new AABB(pos));
    if (!seatsEntities.isEmpty()) {
        SeatEntity seat = seatsEntities.get(0);
        List<Entity> passengers = seat.getPassengers();
        if (!passengers.isEmpty())
            initialPassengers.put(local, passengers.get(0));
    }
}
Also used : BlockEntity(net.minecraft.world.level.block.entity.BlockEntity) CreativeCrateTileEntity(com.simibubi.create.content.logistics.block.inventories.CreativeCrateTileEntity) SeatEntity(com.simibubi.create.content.contraptions.components.actors.SeatEntity) FluidTankTileEntity(com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity) SuperGlueEntity(com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueEntity) PulleyTileEntity(com.simibubi.create.content.contraptions.components.structureMovement.pulley.PulleyTileEntity) KineticTileEntity(com.simibubi.create.content.contraptions.base.KineticTileEntity) ItemVaultTileEntity(com.simibubi.create.content.logistics.block.vault.ItemVaultTileEntity) Entity(net.minecraft.world.entity.Entity) ChassisTileEntity(com.simibubi.create.content.contraptions.components.structureMovement.chassis.ChassisTileEntity) BlockPos(net.minecraft.core.BlockPos) AABB(net.minecraft.world.phys.AABB) SeatEntity(com.simibubi.create.content.contraptions.components.actors.SeatEntity)

Aggregations

KineticTileEntity (com.simibubi.create.content.contraptions.base.KineticTileEntity)1 SeatEntity (com.simibubi.create.content.contraptions.components.actors.SeatEntity)1 ChassisTileEntity (com.simibubi.create.content.contraptions.components.structureMovement.chassis.ChassisTileEntity)1 SuperGlueEntity (com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueEntity)1 PulleyTileEntity (com.simibubi.create.content.contraptions.components.structureMovement.pulley.PulleyTileEntity)1 FluidTankTileEntity (com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity)1 CreativeCrateTileEntity (com.simibubi.create.content.logistics.block.inventories.CreativeCrateTileEntity)1 ItemVaultTileEntity (com.simibubi.create.content.logistics.block.vault.ItemVaultTileEntity)1 BlockPos (net.minecraft.core.BlockPos)1 Entity (net.minecraft.world.entity.Entity)1 BlockEntity (net.minecraft.world.level.block.entity.BlockEntity)1 AABB (net.minecraft.world.phys.AABB)1