Skip to content

Commit

Permalink
Make the example actually do something
Browse files Browse the repository at this point in the history
Not much, but it at least shows what to expect
  • Loading branch information
Chocohead committed Dec 8, 2018
1 parent 2dcaadc commit 4bfe21d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/main/java/example/Example.java

This file was deleted.

37 changes: 37 additions & 0 deletions src/main/java/example/ExampleListener.java
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 4bfe21d

Please sign in to comment.