Skip to content

Commit

Permalink
Weird Error
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangerGamer-A committed Sep 27, 2024
1 parent 4158a9a commit 02763d1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/net/strangergamer/mccourse/MCCourseMod.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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.
Expand Down
27 changes: 27 additions & 0 deletions src/main/java/net/strangergamer/mccourse/block/ModBlocks.java
Original file line number Diff line number Diff line change
@@ -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 <T extends Block> DeferredBlock<T> registerBlock(String name, Supplier<T> block) {
DeferredBlock<T> toReturn = BLOCKS.register(name, block);
registerBlockItem(name, toReturn);
return toReturn

public static void register(IEventBus eventBus) {
BLOCKS.register(eventBus);
}
}

private static <T extends Block> void registerBlockItem(String name, DeferredBlock<T> Block) {
}

0 comments on commit 02763d1

Please sign in to comment.