diff --git a/src/main/java/net/strangergamer/mccourse/MCCourseMod.java b/src/main/java/net/strangergamer/mccourse/MCCourseMod.java index f672b6a..abec58d 100644 --- a/src/main/java/net/strangergamer/mccourse/MCCourseMod.java +++ b/src/main/java/net/strangergamer/mccourse/MCCourseMod.java @@ -1,5 +1,6 @@ package net.strangergamer.mccourse; +import net.strangergamer.mccourse.block.ModBlocks; import net.strangergamer.mccourse.item.ModCreativeModeTabs; import net.strangergamer.mccourse.item.ModItems; import org.slf4j.Logger; @@ -32,10 +33,16 @@ public MCCourseMod(IEventBus modEventBus, ModContainer modContainer) { // Register the commonSetup method for modloading modEventBus.addListener(this::commonSetup); + + ModCreativeModeTabs.register(modEventBus); ModItems.register(modEventBus); + ModBlocks.register(modEventBus); + + + // Register ourselves for server and other game events we are interested in. // Note that this is necessary if and only if we want *this* class (ExampleMod) to respond directly to events. // Do not add this line if there are no @SubscribeEvent-annotated functions in this class, like onServerStarting() below. diff --git a/src/main/java/net/strangergamer/mccourse/block/ModBlocks.java b/src/main/java/net/strangergamer/mccourse/block/ModBlocks.java new file mode 100644 index 0000000..ea094bd --- /dev/null +++ b/src/main/java/net/strangergamer/mccourse/block/ModBlocks.java @@ -0,0 +1,27 @@ +package net.strangergamer.mccourse.block; + +import net.minecraft.world.level.block.Block; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredBlock; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.strangergamer.mccourse.MCCourseMod; + +import java.util.function.Supplier; + +public class ModBlocks { + public static final DeferredRegister.Blocks BLOCKS = + DeferredRegister.createBlocks(MCCourseMod.MOD_ID); + + + private static DeferredBlock registerBlock(String name, Supplier block) { + DeferredBlock toReturn = BLOCKS.register(name, block); + registerBlockItem(name, toReturn); + return toReturn + + public static void register(IEventBus eventBus) { + BLOCKS.register(eventBus); + } +} + + private static void registerBlockItem(String name, DeferredBlock Block) { + }