From 12778e855d2270704fff902c099ab5a9dc6f0d55 Mon Sep 17 00:00:00 2001 From: DaMachinator Date: Fri, 19 Jan 2018 19:52:19 -0500 Subject: [PATCH] Fix structure --- src/main/java/CivilEngineering.java | 10 ------ .../civilengineering/CivilEngineering.java | 36 +++++++++++++++++++ .../eventhandlers/HandleChatMessage.java | 14 ++++++++ 3 files changed, 50 insertions(+), 10 deletions(-) delete mode 100644 src/main/java/CivilEngineering.java create mode 100644 src/main/java/arcanitor/civilengineering/CivilEngineering.java create mode 100644 src/main/java/arcanitor/civilengineering/eventhandlers/HandleChatMessage.java diff --git a/src/main/java/CivilEngineering.java b/src/main/java/CivilEngineering.java deleted file mode 100644 index fe0fabe..0000000 --- a/src/main/java/CivilEngineering.java +++ /dev/null @@ -1,10 +0,0 @@ -import net.minecraftforge.fml.common.Mod; - -@Mod(modid = CivilEngineering.MODID, name = CivilEngineering.NAME, version = CivilEngineering.VERSION, serverSideOnly = true,useMetadata = true) -public class CivilEngineering { - public static final String MODID = "civilengineering"; - public static final String NAME = "Civil Engineering"; - public static final String VERSION = "0.0.1"; - - -} diff --git a/src/main/java/arcanitor/civilengineering/CivilEngineering.java b/src/main/java/arcanitor/civilengineering/CivilEngineering.java new file mode 100644 index 0000000..e5ce099 --- /dev/null +++ b/src/main/java/arcanitor/civilengineering/CivilEngineering.java @@ -0,0 +1,36 @@ +package arcanitor.civilengineering; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import org.apache.logging.log4j.Logger; + +@Mod(modid = CivilEngineering.MODID, name = CivilEngineering.NAME, version = CivilEngineering.VERSION, serverSideOnly = true,useMetadata = true) +public class CivilEngineering { + public static final String MODID = "civilengineering"; + public static final String NAME = "Civil Engineering"; + public static final String VERSION = "0.0.1"; + + @Mod.Instance(value = CivilEngineering.MODID) + public static CivilEngineering instance; + + public static Logger logger; + + @Mod.EventHandler + public void preInit(FMLPreInitializationEvent event) { + logger = event.getModLog(); + logger.info("Bridge building pre-init."); + } + + @Mod.EventHandler + public void init(FMLInitializationEvent event) { + logger.info("Bridge building init."); + } + + @Mod.EventHandler + public void init(FMLPostInitializationEvent event) { + logger.info("Bridge building post-init."); + } + +} diff --git a/src/main/java/arcanitor/civilengineering/eventhandlers/HandleChatMessage.java b/src/main/java/arcanitor/civilengineering/eventhandlers/HandleChatMessage.java new file mode 100644 index 0000000..e187efa --- /dev/null +++ b/src/main/java/arcanitor/civilengineering/eventhandlers/HandleChatMessage.java @@ -0,0 +1,14 @@ +package arcanitor.civilengineering.eventhandlers; + +import arcanitor.civilengineering.CivilEngineering; +import net.minecraftforge.event.ServerChatEvent; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +@Mod.EventBusSubscriber +public class HandleChatMessage { + @SubscribeEvent + public static void chatMessageGlobal(ServerChatEvent event) { + CivilEngineering.logger.info("Message on server: "+event.getMessage()+" sent by "+event.getUsername()); + } +}