Block with constructor ::
public static BarrierBlock barrierBlock = new BarrierBlock(AbstractBlock.Properties.of(Material.FIRE, MaterialColor.METAL));
public static final RegistryObject<Block> BARRIER_BLOCK = BLOCKS.register("barrier_block", (Supplier<? extends I>) barrierBlock); //this needs supplier
public class BarrierBlock extends Block {
public BarrierBlock(Properties p_i48440_1_) {
super(p_i48440_1_);
}
}
//Following gives error: java.lang.NoSuchFieldError: field_151573_f
at com.mcexamples.lists.BlockList.lambda$static$0(BlockList.java:19) ~[main/:?]
public static final RegistryObject<Block> SILVER_BLOCK = BLOCKS.register("silver_block", () ->
new Block(AbstractBlock.Properties.of(Material.METAL, MaterialColor.METAL).requiresCorrectToolForDrops()
.strength(4.0f, 6.0f).sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(2)));
Thanks