Posted November 25, 20213 yr package com.technokraken.ct.citrine.block; import com.technokraken.ct.citrine.Citrine; import com.technokraken.ct.citrine.item.ModCreativeModeTab; import com.technokraken.ct.citrine.item.ModItems; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.material.Material; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fmllegacy.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import java.util.function.Supplier; public class ModBlocks { public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, Citrine.MOD_ID); public static final RegistryObject<Block> CITRINE_BLOCK = registerBlock("citrine_block", () -> new Block(BlockBehaviour.Properties.of(Material.METAL).strength(15f).requiresCorrectToolForDrops()), ModCreativeModeTab.CITRINE_TAB); public static final RegistryObject<Block> CITRINE_ORE = registerBlock("citrine_ore", () -> new Block(BlockBehaviour.Properties.of(Material.STONE).strength(12f).requiresCorrectToolForDrops()), ModCreativeModeTab.CITRINE_TAB); private static <T extends Block>RegistryObject<T> registerBlock(String name, Supplier<T> block, CreativeModeTab tab) { RegistryObject<T> toReturn = BLOCKS.register(name, block); registerBlockItem(name, toReturn, tab); return toReturn; } private static <T extends Block> void registerBlockItem(String name, RegistryObject<T> block, CreativeModeTab tab) { ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties().tab(tab))); } private static <T extends Block>RegistryObject<T> registerBlock(String name, Supplier<T> block) { RegistryObject<T> toReturn = BLOCKS.register(name, block); registerBlockItem(name, toReturn); return toReturn; } private static <T extends Block> void registerBlockItem(String name, RegistryObject<T> block) { ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties().tab(ModCreativeModeTab.CITRINE_TAB))); } public static void register(IEventBus eventBus) { BLOCKS.register(eventBus); } } i have tried many things but i cant find the error it would be nice if someone could try to find it for me.
November 25, 20213 yr Author here is a link to my github repository if u want to check my code out and see if there is any solutions. https://github.com/TechnoKraken/Citrine-1.17.1 Edited November 25, 20213 yr by technokraken
November 25, 20213 yr the git repo is incomplete there is only one .java file, its your Main Mod class
November 26, 20213 yr Author i found out the solution my blockstates folder was in assets instead of my modid
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.