Initial Setup and Classes
This commit is contained in:
34
Forge/src/main/java/me/hypherionmc/craterlib/CraterLib.java
Normal file
34
Forge/src/main/java/me/hypherionmc/craterlib/CraterLib.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.example.examplemod;
|
||||
|
||||
import me.hypherionmc.craterlib.Constants;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
@Mod(Constants.MOD_ID)
|
||||
public class ExampleMod {
|
||||
|
||||
public ExampleMod() {
|
||||
|
||||
// This method is invoked by the Forge mod loader when it is ready
|
||||
// to load your mod. You can access Forge and Common code in this
|
||||
// project.
|
||||
|
||||
// Use Forge to bootstrap the Common mod.
|
||||
Constants.LOG.info("Hello Forge world!");
|
||||
CommonClass.init();
|
||||
|
||||
// Some code like events require special initialization from the
|
||||
// loader specific code.
|
||||
MinecraftForge.EVENT_BUS.addListener(this::onItemTooltip);
|
||||
|
||||
}
|
||||
|
||||
// This method exists as a wrapper for the code in the Common project.
|
||||
// It takes Forge's event object and passes the parameters along to
|
||||
// the Common listener.
|
||||
private void onItemTooltip(ItemTooltipEvent event) {
|
||||
|
||||
CommonClass.onItemTooltip(event.getItemStack(), event.getFlags(), event.getToolTip());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user