I'm trying to migrate my mod from 1.20 to 1.21. Some packages in the forge api were changed so my mod did have some classes not working. I've changed everything i needed but still is getting me the following error
error: cannot access Registry
DeferredRegister.create(ForgeRegistries.BLOCKS, FarmMod.MOD_ID);
^
class file for net.minecraft.core.Registry not found
The piece of code that is wrong is
public static final DeferredRegister<Block> BLOCKS =
DeferredRegister.create(ForgeRegistries.BLOCKS, FarmMod.MOD_ID);
And here are my imports
import com.lucas.farmmod.FarmMod;
import com.lucas.farmmod.block.custom.BaseIrrigatorBlock;
import com.lucas.farmmod.item.ModItems;
import com.lucas.farmmod.item.custom.BaseIrrigatorBlockItem;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
The class DeferredRegister is throwing the error in the print below
I've tried running rebuilding my project in every way possible, tried refreshing my dependencies but nothing works. What can i do?