summaryrefslogtreecommitdiff
path: root/src/main/java/com/example/examplemod/ExampleMod.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/example/examplemod/ExampleMod.java')
-rw-r--r--src/main/java/com/example/examplemod/ExampleMod.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/com/example/examplemod/ExampleMod.java b/src/main/java/com/example/examplemod/ExampleMod.java
index d345370..990fd63 100644
--- a/src/main/java/com/example/examplemod/ExampleMod.java
+++ b/src/main/java/com/example/examplemod/ExampleMod.java
@@ -18,7 +18,9 @@ import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
+import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
+import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
@@ -78,13 +80,22 @@ public class ExampleMod
// Register the item to a creative tab
modEventBus.addListener(this::addCreative);
+
+ // Register our mod's ForgeConfigSpec so that Forge can create and load the config file for us
+ ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.SPEC);
}
private void commonSetup(final FMLCommonSetupEvent event)
{
// Some common setup code
LOGGER.info("HELLO FROM COMMON SETUP");
- LOGGER.info("DIRT BLOCK >> {}", ForgeRegistries.BLOCKS.getKey(Blocks.DIRT));
+
+ if (Config.logDirtBlock)
+ LOGGER.info("DIRT BLOCK >> {}", ForgeRegistries.BLOCKS.getKey(Blocks.DIRT));
+
+ LOGGER.info(Config.magicNumberIntroduction + Config.magicNumber);
+
+ Config.items.forEach((item) -> LOGGER.info("ITEM >> {}", item.toString()));
}
// Add the example block item to the building blocks tab