Initial Setup and Classes

This commit is contained in:
2022-05-12 00:18:53 +02:00
commit 16c24ce795
48 changed files with 1370 additions and 0 deletions

View 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());
}
}