--- a/net/minecraft/world/level/block/BaseFireBlock.java
+++ b/net/minecraft/world/level/block/BaseFireBlock.java
@@ -20,10 +20,11 @@
 import net.minecraft.world.phys.shapes.VoxelShape;
 
 public abstract class BaseFireBlock extends Block {
+
     private static final int SECONDS_ON_FIRE = 8;
     private final float fireDamage;
     protected static final float AABB_OFFSET = 1.0F;
-    protected static final VoxelShape DOWN_AABB = Block.box(0.0, 0.0, 0.0, 16.0, 1.0, 16.0);
+    protected static final VoxelShape DOWN_AABB = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 1.0D, 16.0D);
 
     public BaseFireBlock(BlockBehaviour.Properties settings, float damage) {
         super(settings);
@@ -35,100 +36,110 @@
 
     @Override
     public BlockState getStateForPlacement(BlockPlaceContext ctx) {
-        return getState(ctx.getLevel(), ctx.getClickedPos());
+        return BaseFireBlock.getState(ctx.getLevel(), ctx.getClickedPos());
     }
 
     public static BlockState getState(BlockGetter world, BlockPos pos) {
-        BlockPos blockPos = pos.below();
-        BlockState blockState = world.getBlockState(blockPos);
-        return SoulFireBlock.canSurviveOnBlock(blockState) ? Blocks.SOUL_FIRE.defaultBlockState() : ((FireBlock)Blocks.FIRE).getStateForPlacement(world, pos);
+        BlockPos blockposition1 = pos.below();
+        BlockState iblockdata = world.getBlockState(blockposition1);
+
+        return SoulFireBlock.canSurviveOnBlock(iblockdata) ? Blocks.SOUL_FIRE.defaultBlockState() : ((FireBlock) Blocks.FIRE).getStateForPlacement(world, pos);
     }
 
     @Override
     protected VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
-        return DOWN_AABB;
+        return BaseFireBlock.DOWN_AABB;
     }
 
     @Override
     public void animateTick(BlockState state, Level world, BlockPos pos, RandomSource random) {
         if (random.nextInt(24) == 0) {
-            world.playLocalSound(
-                (double)pos.getX() + 0.5,
-                (double)pos.getY() + 0.5,
-                (double)pos.getZ() + 0.5,
-                SoundEvents.FIRE_AMBIENT,
-                SoundSource.BLOCKS,
-                1.0F + random.nextFloat(),
-                random.nextFloat() * 0.7F + 0.3F,
-                false
-            );
+            world.playLocalSound((double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, SoundEvents.FIRE_AMBIENT, SoundSource.BLOCKS, 1.0F + random.nextFloat(), random.nextFloat() * 0.7F + 0.3F, false);
         }
 
-        BlockPos blockPos = pos.below();
-        BlockState blockState = world.getBlockState(blockPos);
-        if (!this.canBurn(blockState) && !blockState.isFaceSturdy(world, blockPos, Direction.UP)) {
+        BlockPos blockposition1 = pos.below();
+        BlockState iblockdata1 = world.getBlockState(blockposition1);
+        double d0;
+        double d1;
+        double d2;
+        int i;
+
+        if (!this.canBurn(iblockdata1) && !iblockdata1.isFaceSturdy(world, blockposition1, Direction.UP)) {
             if (this.canBurn(world.getBlockState(pos.west()))) {
-                for (int j = 0; j < 2; j++) {
-                    double g = (double)pos.getX() + random.nextDouble() * 0.1F;
-                    double h = (double)pos.getY() + random.nextDouble();
-                    double k = (double)pos.getZ() + random.nextDouble();
-                    world.addParticle(ParticleTypes.LARGE_SMOKE, g, h, k, 0.0, 0.0, 0.0);
+                for (i = 0; i < 2; ++i) {
+                    d0 = (double) pos.getX() + random.nextDouble() * 0.10000000149011612D;
+                    d1 = (double) pos.getY() + random.nextDouble();
+                    d2 = (double) pos.getZ() + random.nextDouble();
+                    world.addParticle(ParticleTypes.LARGE_SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D);
                 }
             }
 
             if (this.canBurn(world.getBlockState(pos.east()))) {
-                for (int l = 0; l < 2; l++) {
-                    double m = (double)(pos.getX() + 1) - random.nextDouble() * 0.1F;
-                    double n = (double)pos.getY() + random.nextDouble();
-                    double o = (double)pos.getZ() + random.nextDouble();
-                    world.addParticle(ParticleTypes.LARGE_SMOKE, m, n, o, 0.0, 0.0, 0.0);
+                for (i = 0; i < 2; ++i) {
+                    d0 = (double) (pos.getX() + 1) - random.nextDouble() * 0.10000000149011612D;
+                    d1 = (double) pos.getY() + random.nextDouble();
+                    d2 = (double) pos.getZ() + random.nextDouble();
+                    world.addParticle(ParticleTypes.LARGE_SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D);
                 }
             }
 
             if (this.canBurn(world.getBlockState(pos.north()))) {
-                for (int p = 0; p < 2; p++) {
-                    double q = (double)pos.getX() + random.nextDouble();
-                    double r = (double)pos.getY() + random.nextDouble();
-                    double s = (double)pos.getZ() + random.nextDouble() * 0.1F;
-                    world.addParticle(ParticleTypes.LARGE_SMOKE, q, r, s, 0.0, 0.0, 0.0);
+                for (i = 0; i < 2; ++i) {
+                    d0 = (double) pos.getX() + random.nextDouble();
+                    d1 = (double) pos.getY() + random.nextDouble();
+                    d2 = (double) pos.getZ() + random.nextDouble() * 0.10000000149011612D;
+                    world.addParticle(ParticleTypes.LARGE_SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D);
                 }
             }
 
             if (this.canBurn(world.getBlockState(pos.south()))) {
-                for (int t = 0; t < 2; t++) {
-                    double u = (double)pos.getX() + random.nextDouble();
-                    double v = (double)pos.getY() + random.nextDouble();
-                    double w = (double)(pos.getZ() + 1) - random.nextDouble() * 0.1F;
-                    world.addParticle(ParticleTypes.LARGE_SMOKE, u, v, w, 0.0, 0.0, 0.0);
+                for (i = 0; i < 2; ++i) {
+                    d0 = (double) pos.getX() + random.nextDouble();
+                    d1 = (double) pos.getY() + random.nextDouble();
+                    d2 = (double) (pos.getZ() + 1) - random.nextDouble() * 0.10000000149011612D;
+                    world.addParticle(ParticleTypes.LARGE_SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D);
                 }
             }
 
             if (this.canBurn(world.getBlockState(pos.above()))) {
-                for (int x = 0; x < 2; x++) {
-                    double y = (double)pos.getX() + random.nextDouble();
-                    double z = (double)(pos.getY() + 1) - random.nextDouble() * 0.1F;
-                    double aa = (double)pos.getZ() + random.nextDouble();
-                    world.addParticle(ParticleTypes.LARGE_SMOKE, y, z, aa, 0.0, 0.0, 0.0);
+                for (i = 0; i < 2; ++i) {
+                    d0 = (double) pos.getX() + random.nextDouble();
+                    d1 = (double) (pos.getY() + 1) - random.nextDouble() * 0.10000000149011612D;
+                    d2 = (double) pos.getZ() + random.nextDouble();
+                    world.addParticle(ParticleTypes.LARGE_SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D);
                 }
             }
         } else {
-            for (int i = 0; i < 3; i++) {
-                double d = (double)pos.getX() + random.nextDouble();
-                double e = (double)pos.getY() + random.nextDouble() * 0.5 + 0.5;
-                double f = (double)pos.getZ() + random.nextDouble();
-                world.addParticle(ParticleTypes.LARGE_SMOKE, d, e, f, 0.0, 0.0, 0.0);
+            for (i = 0; i < 3; ++i) {
+                d0 = (double) pos.getX() + random.nextDouble();
+                d1 = (double) pos.getY() + random.nextDouble() * 0.5D + 0.5D;
+                d2 = (double) pos.getZ() + random.nextDouble();
+                world.addParticle(ParticleTypes.LARGE_SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D);
             }
         }
+
     }
 
     protected abstract boolean canBurn(BlockState state);
 
     @Override
     protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
+        if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
         if (!entity.fireImmune()) {
             entity.setRemainingFireTicks(entity.getRemainingFireTicks() + 1);
             if (entity.getRemainingFireTicks() == 0) {
-                entity.igniteForSeconds(8.0F);
+                // CraftBukkit start
+                org.bukkit.event.entity.EntityCombustEvent event = new org.bukkit.event.entity.EntityCombustByBlockEvent(org.bukkit.craftbukkit.block.CraftBlock.at(world, pos), entity.getBukkitEntity(), 8.0F);
+                world.getCraftServer().getPluginManager().callEvent(event);
+
+                if (!event.isCancelled()) {
+                    entity.igniteForSeconds(event.getDuration(), false);
+                    // Paper start - fix EntityCombustEvent cancellation
+                } else {
+                    entity.setRemainingFireTicks(entity.getRemainingFireTicks() - 1);
+                    // Paper end - fix EntityCombustEvent cancellation
+                }
+                // CraftBukkit end
             }
         }
 
@@ -138,65 +149,85 @@
 
     @Override
     protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
+        // Paper start - UseOnContext param
+        this.onPlace(state, world, pos, oldState, notify, null);
+    }
+
+    @Override
+    protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify, @javax.annotation.Nullable net.minecraft.world.item.context.UseOnContext context) {
+        // Paper end - UseOnContext param
         if (!oldState.is(state.getBlock())) {
-            if (inPortalDimension(world)) {
+            if (BaseFireBlock.inPortalDimension(world)) {
                 Optional<PortalShape> optional = PortalShape.findEmptyPortalShape(world, pos, Direction.Axis.X);
+
                 if (optional.isPresent()) {
-                    optional.get().createPortalBlocks();
+                    ((PortalShape) optional.get()).createPortalBlocks(context); // Paper - pass context param
                     return;
                 }
             }
 
             if (!state.canSurvive(world, pos)) {
-                world.removeBlock(pos, false);
+                this.fireExtinguished(world, pos); // CraftBukkit - fuel block broke
             }
+
         }
     }
 
     private static boolean inPortalDimension(Level world) {
-        return world.dimension() == Level.OVERWORLD || world.dimension() == Level.NETHER;
+        return world.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.OVERWORLD || world.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER; // CraftBukkit - getTypeKey()
     }
 
     @Override
-    protected void spawnDestroyParticles(Level world, Player player, BlockPos pos, BlockState state) {
-    }
+    protected void spawnDestroyParticles(Level world, Player player, BlockPos pos, BlockState state) {}
 
     @Override
     public BlockState playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) {
         if (!world.isClientSide()) {
-            world.levelEvent(null, 1009, pos, 0);
+            world.levelEvent((Player) null, 1009, pos, 0);
         }
 
         return super.playerWillDestroy(world, pos, state, player);
     }
 
     public static boolean canBePlacedAt(Level world, BlockPos pos, Direction direction) {
-        BlockState blockState = world.getBlockState(pos);
-        return blockState.isAir() && (getState(world, pos).canSurvive(world, pos) || isPortal(world, pos, direction));
+        BlockState iblockdata = world.getBlockState(pos);
+
+        return !iblockdata.isAir() ? false : BaseFireBlock.getState(world, pos).canSurvive(world, pos) || BaseFireBlock.isPortal(world, pos, direction);
     }
 
     private static boolean isPortal(Level world, BlockPos pos, Direction direction) {
-        if (!inPortalDimension(world)) {
+        if (!BaseFireBlock.inPortalDimension(world)) {
             return false;
         } else {
-            BlockPos.MutableBlockPos mutableBlockPos = pos.mutable();
-            boolean bl = false;
+            BlockPos.MutableBlockPos blockposition_mutableblockposition = pos.mutable();
+            boolean flag = false;
+            Direction[] aenumdirection = Direction.values();
+            int i = aenumdirection.length;
 
-            for (Direction direction2 : Direction.values()) {
-                if (world.getBlockState(mutableBlockPos.set(pos).move(direction2)).is(Blocks.OBSIDIAN)) {
-                    bl = true;
+            for (int j = 0; j < i; ++j) {
+                Direction enumdirection1 = aenumdirection[j];
+
+                if (world.getBlockState(blockposition_mutableblockposition.set(pos).move(enumdirection1)).is(Blocks.OBSIDIAN)) {
+                    flag = true;
                     break;
                 }
             }
 
-            if (!bl) {
+            if (!flag) {
                 return false;
             } else {
-                Direction.Axis axis = direction.getAxis().isHorizontal()
-                    ? direction.getCounterClockWise().getAxis()
-                    : Direction.Plane.HORIZONTAL.getRandomAxis(world.random);
-                return PortalShape.findEmptyPortalShape(world, pos, axis).isPresent();
+                Direction.Axis enumdirection_enumaxis = direction.getAxis().isHorizontal() ? direction.getCounterClockWise().getAxis() : Direction.Plane.HORIZONTAL.getRandomAxis(world.random);
+
+                return PortalShape.findEmptyPortalShape(world, pos, enumdirection_enumaxis).isPresent();
             }
         }
     }
+
+    // CraftBukkit start
+    protected void fireExtinguished(net.minecraft.world.level.LevelAccessor world, BlockPos position) {
+        if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, position, Blocks.AIR.defaultBlockState()).isCancelled()) {
+            world.removeBlock(position, false);
+        }
+    }
+    // CraftBukkit end
 }
