package net.minecraft.world.level.block; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.tags.BlockTags; import net.minecraft.util.RandomSource; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.ScheduledTickAccess; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; public class SoulFireBlock extends BaseFireBlock { public static final MapCodec CODEC = simpleCodec(SoulFireBlock::new); @Override public MapCodec codec() { return CODEC; } public SoulFireBlock(final BlockBehaviour.Properties properties) { super(properties, 2.0F); } @Override protected BlockState updateShape( final BlockState state, final LevelReader level, final ScheduledTickAccess ticks, final BlockPos pos, final Direction directionToNeighbour, final BlockPos neighbourPos, final BlockState neighbourState, final RandomSource random ) { return this.canSurvive(state, level, pos) ? this.defaultBlockState() : Blocks.AIR.defaultBlockState(); } @Override protected boolean canSurvive(final BlockState state, final LevelReader level, final BlockPos pos) { return canSurviveOnBlock(level.getBlockState(pos.below())); } public static boolean canSurviveOnBlock(final BlockState state) { return state.is(BlockTags.SOUL_FIRE_BASE_BLOCKS); } @Override protected boolean canBurn(final BlockState state) { return true; } }