Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.cademissner.cademod;
- import net.minecraft.block.Block;
- import net.minecraftforge.common.MinecraftForge;
- import net.minecraftforge.event.RegistryEvent;
- import net.minecraftforge.eventbus.api.SubscribeEvent;
- import net.minecraftforge.fml.common.Mod;
- import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
- import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- // The value here should match an entry in the META-INF/mods.toml file
- @Mod("cademod")
- public class CadeMod {
- // Directly reference a log4j logger.
- private static final Logger LOGGER = LogManager.getLogger();
- public CadeMod() {
- // Register the setup method for modloading
- FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
- // Register ourselves for server and other game events we are interested in
- MinecraftForge.EVENT_BUS.register(this);
- }
- private void setup(final FMLCommonSetupEvent event) {
- }
- // You can use EventBusSubscriber to automatically subscribe events on the
- // contained class (this is subscribing to the MOD
- // Event bus for receiving Registry Events)
- @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
- public static class RegistryEvents {
- @SubscribeEvent
- public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
- // register a new block here
- LOGGER.info("HELLO from Register Block");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment