aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/anthonyhilyard/iceberg/Loader.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/anthonyhilyard/iceberg/Loader.java')
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/Loader.java70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/main/java/com/anthonyhilyard/iceberg/Loader.java b/src/main/java/com/anthonyhilyard/iceberg/Loader.java
new file mode 100644
index 0000000..b41595f
--- /dev/null
+++ b/src/main/java/com/anthonyhilyard/iceberg/Loader.java
@@ -0,0 +1,70 @@
+package com.anthonyhilyard.iceberg;
+
+import com.anthonyhilyard.iceberg.events.CriterionEvent;
+import com.anthonyhilyard.iceberg.events.EntityFluidEvent;
+
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.eventbus.api.SubscribeEvent;
+import net.minecraftforge.fml.ExtensionPoint;
+import net.minecraftforge.fml.ModLoadingContext;
+import net.minecraftforge.fml.common.Mod;
+import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
+import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
+import net.minecraftforge.fml.loading.FMLEnvironment;
+import net.minecraftforge.fml.network.FMLNetworkConstants;
+
+@Mod(Loader.MODID)
+public class Loader
+{
+ public static final String MODID = "iceberg";
+ public static final Logger LOGGER = LogManager.getLogger(MODID);
+
+ public Loader()
+ {
+ if (FMLEnvironment.dist == Dist.CLIENT)
+ {
+ IcebergClient mod = new IcebergClient();
+ FMLJavaModLoadingContext.get().getModEventBus().addListener(mod::onClientSetup);
+ }
+ else
+ {
+ new IcebergServer();
+ }
+ ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.DISPLAYTEST, () -> Pair.of(() -> FMLNetworkConstants.IGNORESERVERONLY, (a, b) -> true));
+ }
+
+ @SubscribeEvent
+ public void onCommonSetup(FMLCommonSetupEvent event)
+ {
+
+ }
+
+ // Event testing.
+ //
+ // @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.FORGE)
+ // public static class AdvancementEvents
+ // {
+ // @SubscribeEvent
+ // public static void onCriterion(final CriterionEvent event)
+ // {
+ // LOGGER.info("{} gained {} for {}!", event.getPlayer().getName().getString(), event.getCriterionKey(), event.getAdvancement().getId().toString());
+ // }
+
+ // @SubscribeEvent
+ // public static void onFluidEntered(final EntityFluidEvent.Entered event)
+ // {
+ // LOGGER.info("{} entered {}!", event.getEntity().getName().getString(), event.getFluid().getRegistryName().toString());
+ // }
+
+ // @SubscribeEvent
+ // public static void onFluidExited(final EntityFluidEvent.Exited event)
+ // {
+ // LOGGER.info("{} exited {}!", event.getEntity().getName().getString(), event.getFluid().getRegistryName().toString());
+ // }
+ // }
+
+} \ No newline at end of file