• Recently Browsing

    No registered users viewing this page.

  • Posts

    • .get() or RegistryObject.of(new ResourceLocation(OresCores.MODID, "telerite_ore"), ForgeRegistries.BLOCKS); ?
    • What part of my code is wrong? The block are initialized in the registry event, and then I try get the block outside the registry event with .get()
    • You should only assign their values when they are being registered. ( RegistryObject.of(new ResourceLocation(OresCores.MODID, "telerite_ore"), ForgeRegistries.BLOCKS); is null when you call it there )
    • Now it is crashing again, but a bit differently: debug.log   RegisterBlocks.java: package maxi.ores_cores.init; @EventBusSubscriber(modid = OresCores.MODID, bus = Bus.MOD) public class RegisterBlocks { @SubscribeEvent public static void registerBlock(Register<Block> event) { event.getRegistry().registerAll( new SimpleBlock(OresCores.MODID, "emoulrite_block", Properties.create(Material.IRON, MaterialColor.GOLD).sound(SoundType.METAL).hardnessAndResistance(5f, 6f).harvestTool(ToolType.PICKAXE).harvestLevel(2)), new SimpleOreBlock(OresCores.MODID, "emoulrite_ore", Properties.create(Material.ROCK, MaterialColor.STONE).sound(SoundType.STONE).hardnessAndResistance(3f, 3f).harvestTool(ToolType.PICKAXE).harvestLevel(2)), new SimpleBlock(OresCores.MODID, "telerite_block", Properties.create(Material.IRON, MaterialColor.PURPLE).sound(SoundType.METAL).hardnessAndResistance(5f, 6f).harvestTool(ToolType.PICKAXE).harvestLevel(2)), new SimpleOreBlock(OresCores.MODID, "telerite_ore", Properties.create(Material.ROCK, MaterialColor.SAND).sound(SoundType.STONE).hardnessAndResistance(4f, 9f).harvestTool(ToolType.PICKAXE).harvestLevel(2)) ); } @SubscribeEvent public static void registerItem(Register<Item> event) { event.getRegistry().registerAll( new SimpleBlockItem(Blocks.EMOULRITE_BLOCK.get(), ItemGroup.BUILDING_BLOCKS), new SimpleBlockItem(Blocks.EMOULRITE_ORE.get(), ItemGroup.BUILDING_BLOCKS), new SimpleBlockItem(Blocks.TELERITE_BLOCK.get(), ItemGroup.BUILDING_BLOCKS), new SimpleBlockItem(Blocks.TELERITE_ORE.get(), ItemGroup.BUILDING_BLOCKS) ); } }   Blocks.java: package maxi.ores_cores.blocks; public class Blocks { public static final RegistryObject<Block> EMOULRITE_BLOCK = RegistryObject.of(new ResourceLocation(OresCores.MODID, "emoulrite_block"), ForgeRegistries.BLOCKS); public static final RegistryObject<Block> EMOULRITE_ORE = RegistryObject.of(new ResourceLocation(OresCores.MODID, "emoulrite_ore"), ForgeRegistries.BLOCKS); public static final RegistryObject<Block> TELERITE_BLOCK = RegistryObject.of(new ResourceLocation(OresCores.MODID, "telerite_block"), ForgeRegistries.BLOCKS); public static final RegistryObject<Block> TELERITE_ORE = RegistryObject.of(new ResourceLocation(OresCores.MODID, "telerite_ore"), ForgeRegistries.BLOCKS); }  
  • Topics

  • Who's Online (See full list)