Hello. For my Minecraft mod, I have been trying to update it from 1.19 to 1.20. However, I'm suddenly having a strange issue regarding the registry of my BlockEntities.
It claims that the registry object for breeding_structure isn't present twice. This wasn't a problem in my 1.19 code, so I'm stuck on what the issue could be.
Here are the snippets of code listed by the Stacktrace, and the code relevant to the breeding structure block entity.
public static final RegistryObject<Block> BREEDING_STRUCTURE = registerBlock("breeding_structure",
() -> new BreedingStructure(BlockBehaviour.Properties.copy(Blocks.OAK_LOG)
.strength(2F,2F).noOcclusion())
);
private static <T extends Block> RegistryObject<Item> registerBlockItem(String name, RegistryObject<T> block) {
return ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties()));
}
public static final RegistryObject<BlockEntityType<BreedingStructureEntity>> BREEDING_STRUCTURE =
BLOCK_ENTITIES.register("breeding_structure", () ->
BlockEntityType.Builder.of(BreedingStructureEntity::new,
ModBlocks.BREEDING_STRUCTURE.get()).build(null));
I believe it's likely ModBlocks.BREEDING_STRUCTURE.get(), but I'm totally lost on how.