aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/co/fantabos/bscv/BoSCoVicino.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/co/fantabos/bscv/BoSCoVicino.java')
-rw-r--r--src/main/java/co/fantabos/bscv/BoSCoVicino.java23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/main/java/co/fantabos/bscv/BoSCoVicino.java b/src/main/java/co/fantabos/bscv/BoSCoVicino.java
index e3555a5..afb5029 100644
--- a/src/main/java/co/fantabos/bscv/BoSCoVicino.java
+++ b/src/main/java/co/fantabos/bscv/BoSCoVicino.java
@@ -1,12 +1,15 @@
-package com.example.examplemod;
+package co.fantabos.bscv;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
+import net.minecraft.client.Minecraft;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.InterModComms;
+import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
+import net.minecraftforge.fml.config.ModConfig.Type;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
@@ -20,11 +23,12 @@ import java.util.stream.Collectors;
// The value here should match an entry in the META-INF/mods.toml file
@Mod("bscv")
-public class BoSCoVicino
-{
+public class BoSCoVicino {
// Directly reference a log4j logger.
private static final Logger LOGGER = LogManager.getLogger();
+ public static Minecraft minecraft;
+
public BoSCoVicino() {
// Register the setup method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
@@ -35,12 +39,15 @@ public class BoSCoVicino
// Register the doClientStuff method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);
+ ModLoadingContext.get().registerConfig(Type.CLIENT, Configuration.SPEC, "bscv.toml");
+
+ BoSCoVicino.minecraft = Minecraft.getInstance();
+
// Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this);
}
- private void setup(final FMLCommonSetupEvent event)
- {
+ private void setup(final FMLCommonSetupEvent event) {
// some preinit code
LOGGER.info("HELLO FROM PREINIT");
LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
@@ -51,14 +58,12 @@ public class BoSCoVicino
LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().options);
}
- private void enqueueIMC(final InterModEnqueueEvent event)
- {
+ private void enqueueIMC(final InterModEnqueueEvent event) {
// some example code to dispatch IMC to another mod
InterModComms.sendTo("bscv", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";});
}
- private void processIMC(final InterModProcessEvent event)
- {
+ private void processIMC(final InterModProcessEvent event) {
// some example code to receive and process InterModComms from other mods
LOGGER.info("Got IMC {}", event.getIMCStream().
map(m->m.getMessageSupplier().get()).