diff --git a/src/main/java/example/Example.java b/src/main/java/example/Example.java deleted file mode 100644 index 9f45405..0000000 --- a/src/main/java/example/Example.java +++ /dev/null @@ -1,10 +0,0 @@ -package example; - -public class Example { - // in this class - // implement Rift listener interfaces such as BlockAdder, ItemAdder - - // see open sourced mods for reference - - // full names of listener classes must be placed in riftmod.json file -} diff --git a/src/main/java/example/ExampleListener.java b/src/main/java/example/ExampleListener.java new file mode 100644 index 0000000..edf0de8 --- /dev/null +++ b/src/main/java/example/ExampleListener.java @@ -0,0 +1,37 @@ +package example; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import org.dimdev.rift.listener.BootstrapListener; +import org.dimdev.rift.listener.MinecraftStartListener; + +import net.minecraft.init.Items; + +/** + * The example mod listener, as defined in the riftmod.json file + * + * As many more as wanted can be made by adding their full names in the riftmod.json file + * + * @author Reisse, Chocohead + */ +public class ExampleListener implements MinecraftStartListener, BootstrapListener { + private static final Logger LOGGER = LogManager.getLogger(); + + @Override + public void onMinecraftStart() { + //Minecraft has started but hasn't registered any blocks or items + //Prime time for loading a config if you need one + LOGGER.info("Minecraft starting"); + } + + //Blocks can be added by implementing BlockAdder, Items from ItemAdder etc. + //See open sourced mods such as HalfLogs for reference + + @Override + public void afterVanillaBootstrap() { + //Minecraft has now finished Bootstrap so all blocks and items are registered + //You probably won't need to listen to this normally. + LOGGER.info("Minecraft loaded: " + Items.CARROT_ON_A_STICK); + } +}