package net.minecraft.world.level.block;

import net.minecraft.world.level.block.state.AbstractStateHolder;
import java.util.stream.Collector;
import net.minecraft.Util;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.sounds.SoundSource;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.level.dimension.DimensionType;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.core.Vec3i;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.dimension.end.TheEndDimension;
import net.minecraft.world.level.GameRules;
import java.util.Random;
import net.minecraft.server.level.ServerLevel;
import javax.annotation.Nullable;
import net.minecraft.world.item.BlockPlaceContext;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.state.properties.Property;
import net.minecraft.world.level.block.state.BlockState;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import net.minecraft.core.Direction;
import java.util.Map;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.IntegerProperty;

public class FireBlock extends Block {
    public static final IntegerProperty AGE;
    public static final BooleanProperty NORTH;
    public static final BooleanProperty EAST;
    public static final BooleanProperty SOUTH;
    public static final BooleanProperty WEST;
    public static final BooleanProperty UP;
    private static final Map<Direction, BooleanProperty> PROPERTY_BY_DIRECTION;
    private final Object2IntMap<Block> flameOdds;
    private final Object2IntMap<Block> burnOdds;
    
    protected FireBlock(final Properties c) {
        super(c);
        this.flameOdds = (Object2IntMap<Block>)new Object2IntOpenHashMap();
        this.burnOdds = (Object2IntMap<Block>)new Object2IntOpenHashMap();
        this.registerDefaultState((((((((AbstractStateHolder<O, BlockState>)this.stateDefinition.any()).setValue((Property<Comparable>)FireBlock.AGE, 0)).setValue((Property<Comparable>)FireBlock.NORTH, false)).setValue((Property<Comparable>)FireBlock.EAST, false)).setValue((Property<Comparable>)FireBlock.SOUTH, false)).setValue((Property<Comparable>)FireBlock.WEST, false)).<Comparable, Boolean>setValue((Property<Comparable>)FireBlock.UP, false));
    }
    
    @Override
    public VoxelShape getShape(final BlockState byj, final BlockGetter bjg, final BlockPos fk, final CollisionContext cvq) {
        return Shapes.empty();
    }
    
    @Override
    public BlockState updateShape(final BlockState byj1, final Direction fp, final BlockState byj3, final LevelAccessor bjx, final BlockPos fk5, final BlockPos fk6) {
        if (this.canSurvive(byj1, bjx, fk5)) {
            return ((AbstractStateHolder<O, BlockState>)this.getStateForPlacement(bjx, fk5)).<Comparable, Comparable>setValue((Property<Comparable>)FireBlock.AGE, (Comparable)byj1.<V>getValue((Property<V>)FireBlock.AGE));
        }
        return Blocks.AIR.defaultBlockState();
    }
    
    @Nullable
    @Override
    public BlockState getStateForPlacement(final BlockPlaceContext bcq) {
        return this.getStateForPlacement(bcq.getLevel(), bcq.getClickedPos());
    }
    
    public BlockState getStateForPlacement(final BlockGetter bjg, final BlockPos fk) {
        final BlockPos fk2 = fk.below();
        final BlockState byj5 = bjg.getBlockState(fk2);
        if (this.canBurn(byj5) || byj5.isFaceSturdy(bjg, fk2, Direction.UP)) {
            return this.defaultBlockState();
        }
        BlockState byj6 = this.defaultBlockState();
        for (final Direction fp10 : Direction.values()) {
            final BooleanProperty bzb11 = FireBlock.PROPERTY_BY_DIRECTION.get(fp10);
            if (bzb11 != null) {
                byj6 = ((AbstractStateHolder<O, BlockState>)byj6).<Comparable, Boolean>setValue((Property<Comparable>)bzb11, this.canBurn(bjg.getBlockState(fk.relative(fp10))));
            }
        }
        return byj6;
    }
    
    @Override
    public boolean canSurvive(final BlockState byj, final LevelReader bjz, final BlockPos fk) {
        final BlockPos fk2 = fk.below();
        return bjz.getBlockState(fk2).isFaceSturdy(bjz, fk2, Direction.UP) || this.isValidFireLocation(bjz, fk);
    }
    
    @Override
    public int getTickDelay(final LevelReader bjz) {
        return 30;
    }
    
    @Override
    public void tick(BlockState byj, final ServerLevel xd, final BlockPos fk, final Random random) {
        if (!xd.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) {
            return;
        }
        if (!byj.canSurvive(xd, fk)) {
            xd.removeBlock(fk, false);
        }
        final Block bph6 = xd.getBlockState(fk.below()).getBlock();
        final boolean boolean7 = (xd.dimension instanceof TheEndDimension && bph6 == Blocks.BEDROCK) || bph6 == Blocks.NETHERRACK || bph6 == Blocks.MAGMA_BLOCK;
        final int integer8 = byj.<Integer>getValue((Property<Integer>)FireBlock.AGE);
        if (!boolean7 && xd.isRaining() && this.isNearRain(xd, fk) && random.nextFloat() < 0.2f + integer8 * 0.03f) {
            xd.removeBlock(fk, false);
            return;
        }
        final int integer9 = Math.min(15, integer8 + random.nextInt(3) / 2);
        if (integer8 != integer9) {
            byj = ((AbstractStateHolder<O, BlockState>)byj).<Comparable, Integer>setValue((Property<Comparable>)FireBlock.AGE, integer9);
            xd.setBlock(fk, byj, 4);
        }
        if (!boolean7) {
            xd.getBlockTicks().scheduleTick(fk, this, this.getTickDelay(xd) + random.nextInt(10));
            if (!this.isValidFireLocation(xd, fk)) {
                final BlockPos fk2 = fk.below();
                if (!xd.getBlockState(fk2).isFaceSturdy(xd, fk2, Direction.UP) || integer8 > 3) {
                    xd.removeBlock(fk, false);
                }
                return;
            }
            if (integer8 == 15 && random.nextInt(4) == 0 && !this.canBurn(xd.getBlockState(fk.below()))) {
                xd.removeBlock(fk, false);
                return;
            }
        }
        final boolean boolean8 = xd.isHumidAt(fk);
        final int integer10 = boolean8 ? -50 : 0;
        this.checkBurnOut(xd, fk.east(), 300 + integer10, random, integer8);
        this.checkBurnOut(xd, fk.west(), 300 + integer10, random, integer8);
        this.checkBurnOut(xd, fk.below(), 250 + integer10, random, integer8);
        this.checkBurnOut(xd, fk.above(), 250 + integer10, random, integer8);
        this.checkBurnOut(xd, fk.north(), 300 + integer10, random, integer8);
        this.checkBurnOut(xd, fk.south(), 300 + integer10, random, integer8);
        final BlockPos.MutableBlockPos a12 = new BlockPos.MutableBlockPos();
        for (int integer11 = -1; integer11 <= 1; ++integer11) {
            for (int integer12 = -1; integer12 <= 1; ++integer12) {
                for (int integer13 = -1; integer13 <= 4; ++integer13) {
                    if (integer11 != 0 || integer13 != 0 || integer12 != 0) {
                        int integer14 = 100;
                        if (integer13 > 1) {
                            integer14 += (integer13 - 1) * 100;
                        }
                        a12.set(fk).move(integer11, integer13, integer12);
                        final int integer15 = this.getFireOdds(xd, a12);
                        if (integer15 > 0) {
                            int integer16 = (integer15 + 40 + xd.getDifficulty().getId() * 7) / (integer8 + 30);
                            if (boolean8) {
                                integer16 /= 2;
                            }
                            if (integer16 > 0 && random.nextInt(integer14) <= integer16) {
                                if (!xd.isRaining() || !this.isNearRain(xd, a12)) {
                                    final int integer17 = Math.min(15, integer8 + random.nextInt(5) / 4);
                                    xd.setBlock(a12, ((AbstractStateHolder<O, BlockState>)this.getStateForPlacement(xd, a12)).<Comparable, Integer>setValue((Property<Comparable>)FireBlock.AGE, integer17), 3);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    
    protected boolean isNearRain(final Level bjw, final BlockPos fk) {
        return bjw.isRainingAt(fk) || bjw.isRainingAt(fk.west()) || bjw.isRainingAt(fk.east()) || bjw.isRainingAt(fk.north()) || bjw.isRainingAt(fk.south());
    }
    
    private int getBurnOdd(final BlockState byj) {
        if (byj.<Comparable>hasProperty((Property<Comparable>)BlockStateProperties.WATERLOGGED) && byj.<Boolean>getValue((Property<Boolean>)BlockStateProperties.WATERLOGGED)) {
            return 0;
        }
        return this.burnOdds.getInt(byj.getBlock());
    }
    
    private int getFlameOdds(final BlockState byj) {
        if (byj.<Comparable>hasProperty((Property<Comparable>)BlockStateProperties.WATERLOGGED) && byj.<Boolean>getValue((Property<Boolean>)BlockStateProperties.WATERLOGGED)) {
            return 0;
        }
        return this.flameOdds.getInt(byj.getBlock());
    }
    
    private void checkBurnOut(final Level bjw, final BlockPos fk, final int integer3, final Random random, final int integer5) {
        final int integer6 = this.getBurnOdd(bjw.getBlockState(fk));
        if (random.nextInt(integer3) < integer6) {
            final BlockState byj8 = bjw.getBlockState(fk);
            if (random.nextInt(integer5 + 10) < 5 && !bjw.isRainingAt(fk)) {
                final int integer7 = Math.min(integer5 + random.nextInt(5) / 4, 15);
                bjw.setBlock(fk, ((AbstractStateHolder<O, BlockState>)this.getStateForPlacement(bjw, fk)).<Comparable, Integer>setValue((Property<Comparable>)FireBlock.AGE, integer7), 3);
            }
            else {
                bjw.removeBlock(fk, false);
            }
            final Block bph9 = byj8.getBlock();
            if (bph9 instanceof TntBlock) {
                final TntBlock tntBlock = (TntBlock)bph9;
                TntBlock.explode(bjw, fk);
            }
        }
    }
    
    private boolean isValidFireLocation(final BlockGetter bjg, final BlockPos fk) {
        for (final Direction fp7 : Direction.values()) {
            if (this.canBurn(bjg.getBlockState(fk.relative(fp7)))) {
                return true;
            }
        }
        return false;
    }
    
    private int getFireOdds(final LevelReader bjz, final BlockPos fk) {
        if (!bjz.isEmptyBlock(fk)) {
            return 0;
        }
        int integer4 = 0;
        for (final Direction fp8 : Direction.values()) {
            final BlockState byj9 = bjz.getBlockState(fk.relative(fp8));
            integer4 = Math.max(this.getFlameOdds(byj9), integer4);
        }
        return integer4;
    }
    
    public boolean canBurn(final BlockState byj) {
        return this.getFlameOdds(byj) > 0;
    }
    
    @Override
    public void onPlace(final BlockState byj1, final Level bjw, final BlockPos fk, final BlockState byj4, final boolean boolean5) {
        if (byj4.getBlock() == byj1.getBlock()) {
            return;
        }
        if ((bjw.dimension.getType() == DimensionType.OVERWORLD || bjw.dimension.getType() == DimensionType.NETHER) && ((NetherPortalBlock)Blocks.NETHER_PORTAL).trySpawnPortal(bjw, fk)) {
            return;
        }
        if (!byj1.canSurvive(bjw, fk)) {
            bjw.removeBlock(fk, false);
            return;
        }
        bjw.getBlockTicks().scheduleTick(fk, this, this.getTickDelay(bjw) + bjw.random.nextInt(10));
    }
    
    @Override
    public void animateTick(final BlockState byj, final Level bjw, final BlockPos fk, final Random random) {
        if (random.nextInt(24) == 0) {
            bjw.playLocalSound(fk.getX() + 0.5f, fk.getY() + 0.5f, fk.getZ() + 0.5f, SoundEvents.FIRE_AMBIENT, SoundSource.BLOCKS, 1.0f + random.nextFloat(), random.nextFloat() * 0.7f + 0.3f, false);
        }
        final BlockPos fk2 = fk.below();
        final BlockState byj2 = bjw.getBlockState(fk2);
        if (this.canBurn(byj2) || byj2.isFaceSturdy(bjw, fk2, Direction.UP)) {
            for (int integer8 = 0; integer8 < 3; ++integer8) {
                final double double9 = fk.getX() + random.nextDouble();
                final double double10 = fk.getY() + random.nextDouble() * 0.5 + 0.5;
                final double double11 = fk.getZ() + random.nextDouble();
                bjw.addParticle(ParticleTypes.LARGE_SMOKE, double9, double10, double11, 0.0, 0.0, 0.0);
            }
        }
        else {
            if (this.canBurn(bjw.getBlockState(fk.west()))) {
                for (int integer8 = 0; integer8 < 2; ++integer8) {
                    final double double9 = fk.getX() + random.nextDouble() * 0.10000000149011612;
                    final double double10 = fk.getY() + random.nextDouble();
                    final double double11 = fk.getZ() + random.nextDouble();
                    bjw.addParticle(ParticleTypes.LARGE_SMOKE, double9, double10, double11, 0.0, 0.0, 0.0);
                }
            }
            if (this.canBurn(bjw.getBlockState(fk.east()))) {
                for (int integer8 = 0; integer8 < 2; ++integer8) {
                    final double double9 = fk.getX() + 1 - random.nextDouble() * 0.10000000149011612;
                    final double double10 = fk.getY() + random.nextDouble();
                    final double double11 = fk.getZ() + random.nextDouble();
                    bjw.addParticle(ParticleTypes.LARGE_SMOKE, double9, double10, double11, 0.0, 0.0, 0.0);
                }
            }
            if (this.canBurn(bjw.getBlockState(fk.north()))) {
                for (int integer8 = 0; integer8 < 2; ++integer8) {
                    final double double9 = fk.getX() + random.nextDouble();
                    final double double10 = fk.getY() + random.nextDouble();
                    final double double11 = fk.getZ() + random.nextDouble() * 0.10000000149011612;
                    bjw.addParticle(ParticleTypes.LARGE_SMOKE, double9, double10, double11, 0.0, 0.0, 0.0);
                }
            }
            if (this.canBurn(bjw.getBlockState(fk.south()))) {
                for (int integer8 = 0; integer8 < 2; ++integer8) {
                    final double double9 = fk.getX() + random.nextDouble();
                    final double double10 = fk.getY() + random.nextDouble();
                    final double double11 = fk.getZ() + 1 - random.nextDouble() * 0.10000000149011612;
                    bjw.addParticle(ParticleTypes.LARGE_SMOKE, double9, double10, double11, 0.0, 0.0, 0.0);
                }
            }
            if (this.canBurn(bjw.getBlockState(fk.above()))) {
                for (int integer8 = 0; integer8 < 2; ++integer8) {
                    final double double9 = fk.getX() + random.nextDouble();
                    final double double10 = fk.getY() + 1 - random.nextDouble() * 0.10000000149011612;
                    final double double11 = fk.getZ() + random.nextDouble();
                    bjw.addParticle(ParticleTypes.LARGE_SMOKE, double9, double10, double11, 0.0, 0.0, 0.0);
                }
            }
        }
    }
    
    @Override
    protected void createBlockStateDefinition(final StateDefinition.Builder<Block, BlockState> a) {
        a.add(FireBlock.AGE, FireBlock.NORTH, FireBlock.EAST, FireBlock.SOUTH, FireBlock.WEST, FireBlock.UP);
    }
    
    public void setFlammable(final Block bph, final int integer2, final int integer3) {
        this.flameOdds.put(bph, integer2);
        this.burnOdds.put(bph, integer3);
    }
    
    public static void bootStrap() {
        final FireBlock brj1 = (FireBlock)Blocks.FIRE;
        brj1.setFlammable(Blocks.OAK_PLANKS, 5, 20);
        brj1.setFlammable(Blocks.SPRUCE_PLANKS, 5, 20);
        brj1.setFlammable(Blocks.BIRCH_PLANKS, 5, 20);
        brj1.setFlammable(Blocks.JUNGLE_PLANKS, 5, 20);
        brj1.setFlammable(Blocks.ACACIA_PLANKS, 5, 20);
        brj1.setFlammable(Blocks.DARK_OAK_PLANKS, 5, 20);
        brj1.setFlammable(Blocks.OAK_SLAB, 5, 20);
        brj1.setFlammable(Blocks.SPRUCE_SLAB, 5, 20);
        brj1.setFlammable(Blocks.BIRCH_SLAB, 5, 20);
        brj1.setFlammable(Blocks.JUNGLE_SLAB, 5, 20);
        brj1.setFlammable(Blocks.ACACIA_SLAB, 5, 20);
        brj1.setFlammable(Blocks.DARK_OAK_SLAB, 5, 20);
        brj1.setFlammable(Blocks.OAK_FENCE_GATE, 5, 20);
        brj1.setFlammable(Blocks.SPRUCE_FENCE_GATE, 5, 20);
        brj1.setFlammable(Blocks.BIRCH_FENCE_GATE, 5, 20);
        brj1.setFlammable(Blocks.JUNGLE_FENCE_GATE, 5, 20);
        brj1.setFlammable(Blocks.DARK_OAK_FENCE_GATE, 5, 20);
        brj1.setFlammable(Blocks.ACACIA_FENCE_GATE, 5, 20);
        brj1.setFlammable(Blocks.OAK_FENCE, 5, 20);
        brj1.setFlammable(Blocks.SPRUCE_FENCE, 5, 20);
        brj1.setFlammable(Blocks.BIRCH_FENCE, 5, 20);
        brj1.setFlammable(Blocks.JUNGLE_FENCE, 5, 20);
        brj1.setFlammable(Blocks.DARK_OAK_FENCE, 5, 20);
        brj1.setFlammable(Blocks.ACACIA_FENCE, 5, 20);
        brj1.setFlammable(Blocks.OAK_STAIRS, 5, 20);
        brj1.setFlammable(Blocks.BIRCH_STAIRS, 5, 20);
        brj1.setFlammable(Blocks.SPRUCE_STAIRS, 5, 20);
        brj1.setFlammable(Blocks.JUNGLE_STAIRS, 5, 20);
        brj1.setFlammable(Blocks.ACACIA_STAIRS, 5, 20);
        brj1.setFlammable(Blocks.DARK_OAK_STAIRS, 5, 20);
        brj1.setFlammable(Blocks.OAK_LOG, 5, 5);
        brj1.setFlammable(Blocks.SPRUCE_LOG, 5, 5);
        brj1.setFlammable(Blocks.BIRCH_LOG, 5, 5);
        brj1.setFlammable(Blocks.JUNGLE_LOG, 5, 5);
        brj1.setFlammable(Blocks.ACACIA_LOG, 5, 5);
        brj1.setFlammable(Blocks.DARK_OAK_LOG, 5, 5);
        brj1.setFlammable(Blocks.STRIPPED_OAK_LOG, 5, 5);
        brj1.setFlammable(Blocks.STRIPPED_SPRUCE_LOG, 5, 5);
        brj1.setFlammable(Blocks.STRIPPED_BIRCH_LOG, 5, 5);
        brj1.setFlammable(Blocks.STRIPPED_JUNGLE_LOG, 5, 5);
        brj1.setFlammable(Blocks.STRIPPED_ACACIA_LOG, 5, 5);
        brj1.setFlammable(Blocks.STRIPPED_DARK_OAK_LOG, 5, 5);
        brj1.setFlammable(Blocks.STRIPPED_OAK_WOOD, 5, 5);
        brj1.setFlammable(Blocks.STRIPPED_SPRUCE_WOOD, 5, 5);
        brj1.setFlammable(Blocks.STRIPPED_BIRCH_WOOD, 5, 5);
        brj1.setFlammable(Blocks.STRIPPED_JUNGLE_WOOD, 5, 5);
        brj1.setFlammable(Blocks.STRIPPED_ACACIA_WOOD, 5, 5);
        brj1.setFlammable(Blocks.STRIPPED_DARK_OAK_WOOD, 5, 5);
        brj1.setFlammable(Blocks.OAK_WOOD, 5, 5);
        brj1.setFlammable(Blocks.SPRUCE_WOOD, 5, 5);
        brj1.setFlammable(Blocks.BIRCH_WOOD, 5, 5);
        brj1.setFlammable(Blocks.JUNGLE_WOOD, 5, 5);
        brj1.setFlammable(Blocks.ACACIA_WOOD, 5, 5);
        brj1.setFlammable(Blocks.DARK_OAK_WOOD, 5, 5);
        brj1.setFlammable(Blocks.OAK_LEAVES, 30, 60);
        brj1.setFlammable(Blocks.SPRUCE_LEAVES, 30, 60);
        brj1.setFlammable(Blocks.BIRCH_LEAVES, 30, 60);
        brj1.setFlammable(Blocks.JUNGLE_LEAVES, 30, 60);
        brj1.setFlammable(Blocks.ACACIA_LEAVES, 30, 60);
        brj1.setFlammable(Blocks.DARK_OAK_LEAVES, 30, 60);
        brj1.setFlammable(Blocks.BOOKSHELF, 30, 20);
        brj1.setFlammable(Blocks.TNT, 15, 100);
        brj1.setFlammable(Blocks.GRASS, 60, 100);
        brj1.setFlammable(Blocks.FERN, 60, 100);
        brj1.setFlammable(Blocks.DEAD_BUSH, 60, 100);
        brj1.setFlammable(Blocks.SUNFLOWER, 60, 100);
        brj1.setFlammable(Blocks.LILAC, 60, 100);
        brj1.setFlammable(Blocks.ROSE_BUSH, 60, 100);
        brj1.setFlammable(Blocks.PEONY, 60, 100);
        brj1.setFlammable(Blocks.TALL_GRASS, 60, 100);
        brj1.setFlammable(Blocks.LARGE_FERN, 60, 100);
        brj1.setFlammable(Blocks.DANDELION, 60, 100);
        brj1.setFlammable(Blocks.POPPY, 60, 100);
        brj1.setFlammable(Blocks.BLUE_ORCHID, 60, 100);
        brj1.setFlammable(Blocks.ALLIUM, 60, 100);
        brj1.setFlammable(Blocks.AZURE_BLUET, 60, 100);
        brj1.setFlammable(Blocks.RED_TULIP, 60, 100);
        brj1.setFlammable(Blocks.ORANGE_TULIP, 60, 100);
        brj1.setFlammable(Blocks.WHITE_TULIP, 60, 100);
        brj1.setFlammable(Blocks.PINK_TULIP, 60, 100);
        brj1.setFlammable(Blocks.OXEYE_DAISY, 60, 100);
        brj1.setFlammable(Blocks.CORNFLOWER, 60, 100);
        brj1.setFlammable(Blocks.LILY_OF_THE_VALLEY, 60, 100);
        brj1.setFlammable(Blocks.WITHER_ROSE, 60, 100);
        brj1.setFlammable(Blocks.WHITE_WOOL, 30, 60);
        brj1.setFlammable(Blocks.ORANGE_WOOL, 30, 60);
        brj1.setFlammable(Blocks.MAGENTA_WOOL, 30, 60);
        brj1.setFlammable(Blocks.LIGHT_BLUE_WOOL, 30, 60);
        brj1.setFlammable(Blocks.YELLOW_WOOL, 30, 60);
        brj1.setFlammable(Blocks.LIME_WOOL, 30, 60);
        brj1.setFlammable(Blocks.PINK_WOOL, 30, 60);
        brj1.setFlammable(Blocks.GRAY_WOOL, 30, 60);
        brj1.setFlammable(Blocks.LIGHT_GRAY_WOOL, 30, 60);
        brj1.setFlammable(Blocks.CYAN_WOOL, 30, 60);
        brj1.setFlammable(Blocks.PURPLE_WOOL, 30, 60);
        brj1.setFlammable(Blocks.BLUE_WOOL, 30, 60);
        brj1.setFlammable(Blocks.BROWN_WOOL, 30, 60);
        brj1.setFlammable(Blocks.GREEN_WOOL, 30, 60);
        brj1.setFlammable(Blocks.RED_WOOL, 30, 60);
        brj1.setFlammable(Blocks.BLACK_WOOL, 30, 60);
        brj1.setFlammable(Blocks.VINE, 15, 100);
        brj1.setFlammable(Blocks.COAL_BLOCK, 5, 5);
        brj1.setFlammable(Blocks.HAY_BLOCK, 60, 20);
        brj1.setFlammable(Blocks.WHITE_CARPET, 60, 20);
        brj1.setFlammable(Blocks.ORANGE_CARPET, 60, 20);
        brj1.setFlammable(Blocks.MAGENTA_CARPET, 60, 20);
        brj1.setFlammable(Blocks.LIGHT_BLUE_CARPET, 60, 20);
        brj1.setFlammable(Blocks.YELLOW_CARPET, 60, 20);
        brj1.setFlammable(Blocks.LIME_CARPET, 60, 20);
        brj1.setFlammable(Blocks.PINK_CARPET, 60, 20);
        brj1.setFlammable(Blocks.GRAY_CARPET, 60, 20);
        brj1.setFlammable(Blocks.LIGHT_GRAY_CARPET, 60, 20);
        brj1.setFlammable(Blocks.CYAN_CARPET, 60, 20);
        brj1.setFlammable(Blocks.PURPLE_CARPET, 60, 20);
        brj1.setFlammable(Blocks.BLUE_CARPET, 60, 20);
        brj1.setFlammable(Blocks.BROWN_CARPET, 60, 20);
        brj1.setFlammable(Blocks.GREEN_CARPET, 60, 20);
        brj1.setFlammable(Blocks.RED_CARPET, 60, 20);
        brj1.setFlammable(Blocks.BLACK_CARPET, 60, 20);
        brj1.setFlammable(Blocks.DRIED_KELP_BLOCK, 30, 60);
        brj1.setFlammable(Blocks.BAMBOO, 60, 60);
        brj1.setFlammable(Blocks.SCAFFOLDING, 60, 60);
        brj1.setFlammable(Blocks.LECTERN, 30, 20);
        brj1.setFlammable(Blocks.COMPOSTER, 5, 20);
        brj1.setFlammable(Blocks.SWEET_BERRY_BUSH, 60, 100);
        brj1.setFlammable(Blocks.BEEHIVE, 5, 20);
        brj1.setFlammable(Blocks.BEE_NEST, 30, 20);
    }
    
    static {
        AGE = BlockStateProperties.AGE_15;
        NORTH = PipeBlock.NORTH;
        EAST = PipeBlock.EAST;
        SOUTH = PipeBlock.SOUTH;
        WEST = PipeBlock.WEST;
        UP = PipeBlock.UP;
        PROPERTY_BY_DIRECTION = PipeBlock.PROPERTY_BY_DIRECTION.entrySet().stream().filter(entry -> entry.getKey() != Direction.DOWN).collect(Util.<Direction, BooleanProperty>toMap());
    }
}
