Jump to content

[1.21] Problem migrating my mod from 1.20 to 1.21


lvcas

Recommended Posts

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
 

spacer.png

 

I've tried running rebuilding my project in every way possible, tried refreshing my dependencies but nothing works. What can i do?

Edited by lvcas
changing title for better description of the problem
Link to comment
Share on other sites

  • lvcas changed the title to [1.21] Problem migrating my mod from 1.20 to 1.21

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.