Search in sources :

Example 1 with BombFallingEntity

use of net.reikeb.electrona.entity.BombFallingEntity in project Electrona-Project by Max094Reikeb.

the class NuclearBomb method explode.

private void explode(ServerLevel world, BlockPos pos) {
    BlockEntity tile = world.getBlockEntity(pos);
    if (tile instanceof TileNuclearBomb) {
        BombFallingEntity bombFallingEntity = new BombFallingEntity(world, (double) pos.getX() + 0.5D, pos.getY(), (double) pos.getZ() + 0.5D, world.getBlockState(pos), ((TileNuclearBomb) tile).isCharged(), ((TileNuclearBomb) tile).getNuclearCharge());
        this.falling(bombFallingEntity);
        world.addFreshEntity(bombFallingEntity);
    }
}
Also used : TileNuclearBomb(net.reikeb.electrona.tileentities.TileNuclearBomb) BombFallingEntity(net.reikeb.electrona.entity.BombFallingEntity) FallingBlockEntity(net.minecraft.world.entity.item.FallingBlockEntity) BlockEntity(net.minecraft.world.level.block.entity.BlockEntity)

Aggregations

FallingBlockEntity (net.minecraft.world.entity.item.FallingBlockEntity)1 BlockEntity (net.minecraft.world.level.block.entity.BlockEntity)1 BombFallingEntity (net.reikeb.electrona.entity.BombFallingEntity)1 TileNuclearBomb (net.reikeb.electrona.tileentities.TileNuclearBomb)1