This commit is contained in:
2024-12-14 15:03:03 -06:00
parent e2bb2a7121
commit 3655550fe0
11 changed files with 79 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.slf4j.Logger;
import xyz.sillyangel.nugget.item.ModItems;
import xyz.sillyangel.nugget.block.ModBlocks;
// Very important Comment
// The value here should match an entry in the META-INF/mods.toml file
@@ -33,6 +34,7 @@ public class NuggetMod {
MinecraftForge.EVENT_BUS.register(this);
ModItems.register(modEventBus);
ModBlocks.register(modEventBus);
// Register the item to a creative tab
modEventBus.addListener(this::addCreative);
@@ -49,6 +51,10 @@ public class NuggetMod {
if (event.getTabKey() == CreativeModeTabs.INGREDIENTS) {
event.accept(ModItems.NUGGET);
}
if (event.getTabKey() == CreativeModeTabs.BUILDING_BLOCKS) {
event.accept(ModBlocks.NUGGET_BLOCK);
event.accept(ModBlocks.RAW_NUGGET_BLOCK);
}
}
// You can use SubscribeEvent and let the Event Bus discover methods to call