I'm attempting to replace grass blocks in a world with a ModBlock I called `scorched_earth`. However, `world.setBlock()` requires a block ID. I've looked for some way to get an ID for the block but can't seem to find any workarounds? Am I just doing it wrong?
Example (incomplete) code:
private void scorch(World worldIn, BlockPos pos, Block block) {
BlockState state = worldIn.getBlockState(pos);
if(block.isBurning(state, worldIn, pos)) {
if(block.is(Blocks.GRASS_BLOCK)) worldIn.setBlock(pos, state, 0, ModBlocks.SCORCHED_EARTH.get());
}
}