35 lines
1.1 KiB
Java
35 lines
1.1 KiB
Java
|
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());
|
||
|
}
|
||
|
}
|