use of net.minecraftforge.fml.common.Mod.EventHandler in project MinecraftForge by MinecraftForge.
the class ModelLoaderRegistryDebug method preInit.
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
List<Block> blocks = Lists.newArrayList();
blocks.add(CustomModelBlock.instance);
blocks.add(OBJTesseractBlock.instance);
blocks.add(OBJVertexColoring1.instance);
//blocks.add(OBJDirectionEye.instance);
blocks.add(OBJVertexColoring2.instance);
blocks.add(OBJDirectionBlock.instance);
blocks.add(OBJCustomDataBlock.instance);
//blocks.add(OBJDynamicEye.instance);
for (Block block : blocks) {
GameRegistry.register(block);
GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
}
GameRegistry.registerTileEntity(OBJTesseractTileEntity.class, OBJTesseractBlock.name);
GameRegistry.registerTileEntity(OBJVertexColoring2TileEntity.class, OBJVertexColoring2.name);
//GameRegistry.registerTileEntity(OBJDynamicEyeTileEntity.class, OBJDynamicEye.name);
if (event.getSide() == Side.CLIENT)
clientPreInit();
}
use of net.minecraftforge.fml.common.Mod.EventHandler in project Bookshelf by Darkhax-Minecraft.
the class Bookshelf method onConstruction.
@EventHandler
public void onConstruction(FMLConstructionEvent event) {
CraftingManager.getInstance().recipes = new ModTrackingList(CraftingManager.getInstance().recipes);
AnnotationUtils.asmData = event.getASMHarvestedData();
MinecraftForge.EVENT_BUS.register(new BookshelfEvents());
}
use of net.minecraftforge.fml.common.Mod.EventHandler in project RecurrentComplex by Ivorforce.
the class RecurrentComplex method preInit.
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
logger = event.getModLog();
config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
RCConfig.loadConfig(null);
config.save();
// After loading config, re-test vanilla acceptance, because of lightweight mode
NetworkRegistry.INSTANCE.registry().get(Loader.instance().getIndexedModList().get(MOD_ID)).testVanillaAcceptance();
logger.trace(isLite() ? "Entering lightweight mode!" : "Entering default mode!");
loader = new FileLoader();
saver = new FileSaver();
remapper = new FMLRemapper();
specialRegistry = new MCRegistrySpecial(mcRegistry = new MCRegistryRemapping(new MCRegistryDefault(), remapper), remapper);
cremapper = new FMLRemapperConvenience(MOD_ID, specialRegistry, remapper);
missingRemapper = new FMLMissingRemapper(new MCRegistryDefault(), remapper);
forgeEventHandler = new RCForgeEventHandler();
forgeEventHandler.register();
terrainEventHandler = new RCTerrainGenEventHandler();
terrainEventHandler.register();
recurrentComplexEventHandler = new RCRecurrentComplexEventHandler();
recurrentComplexEventHandler.register();
guiHandler = new RCGuiHandler();
IvGuiRegistry.INSTANCE.register(MOD_ID, guiHandler);
communicationHandler = new RCCommunicationHandler(logger, MOD_ID, instance);
RCRegistryHandler.preInit(event, this);
proxy.preInit(event);
}
use of net.minecraftforge.fml.common.Mod.EventHandler in project Realistic-Terrain-Generation by Team-RTG.
the class RTG method initPre.
@EventHandler
public void initPre(FMLPreInitializationEvent event) {
instance = this;
worldtype = new WorldTypeRTG(ModInfo.WORLD_TYPE);
DimensionManagerRTG.addRTGDimension(DimensionManagerRTG.OVERWORLD);
RTGAPI.configPath = event.getModConfigurationDirectory() + File.separator + ModInfo.CONFIG_DIRECTORY + File.separator;
RTGAPI.rtgConfig = new RTGConfig();
RTGAPI.rtgConfig.load(configPath + "rtg.cfg");
this.registerStructures();
}
use of net.minecraftforge.fml.common.Mod.EventHandler in project Realistic-Terrain-Generation by Team-RTG.
the class RTG method init.
@EventHandler
public void init(FMLInitializationEvent event) {
eventMgr = new EventManagerRTG();
eventMgr.registerEventHandlers();
// This event handler unregisters itself, so it doesn't need to be a part of the event management system.
if (config().ENABLE_WORLD_TYPE_NOTIFICATION_SCREEN.get()) {
MinecraftForge.EVENT_BUS.register(WorldTypeMessageEventHandler.instance);
}
}
Aggregations