use of net.minecraftforge.fml.common.Mod.EventHandler in project Geolosys by oitsjustjose.
the class Geolosys method preInit.
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
LOGGER = event.getModLog();
MinecraftForge.EVENT_BUS.register(new Config(event.getSuggestedConfigurationFile()));
configOres = getOresConfig(event.getModConfigurationDirectory());
clientRegistry = new ClientRegistry();
MinecraftForge.EVENT_BUS.register(clientRegistry);
chunkOreGen = new ChunkData();
userStates = new ArrayList<>();
ORE = new BlockOre();
ORE_VANILLA = new BlockOreVanilla();
ORE_SAMPLE = new BlockSample();
ORE_SAMPLE_VANILLA = new BlockSampleVanilla();
CLUSTER = new ItemCluster();
ALMANAC = new ItemFieldManual();
if (Config.getInstance().enableIngots) {
INGOT = new ItemIngot();
}
if (Config.getInstance().enableCoals) {
COAL = new ItemCoal();
}
if (Config.getInstance().enableProPick) {
PRO_PICK = new ItemProPick();
}
registerGeolosysOreGen();
registerVanillaOreGen();
}
use of net.minecraftforge.fml.common.Mod.EventHandler in project malmo by Microsoft.
the class MalmoMod method preInit.
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
if (!SchemaHelper.testSchemaVersionNumbers(Loader.instance().activeModContainer().getVersion()))
throw new RuntimeException("This mod has been incorrectly built; check schema version numbers.");
if (event.getModMetadata().version.equals("${version}")) {
// The mcmod.info version number is populated by gradle; if we've been built without gradle,
// via eclipse say, then we can just use the internal version number instead, which comes to us from the version.properties file.
// (There's no real benefit to doing this; it just looks nicer in the Mod GUI if the version number is filled in.)
event.getModMetadata().version = Loader.instance().activeModContainer().getVersion();
}
// Load the correct configs (client or server)
File configDir = event.getModConfigurationDirectory();
File sessionConfigFile = new File(configDir, MODID + event.getSide().toString() + ".cfg");
File permanentConfigFile = new File(configDir, MODID + event.getSide().toString() + "Permanent.cfg");
this.sessionConfig = new Configuration(sessionConfigFile);
this.sessionConfig.load();
this.permanentConfig = new Configuration(permanentConfigFile);
this.permanentConfig.load();
AddressHelper.update(this.sessionConfig);
ScreenHelper.update(this.permanentConfig);
TCPUtils.update(this.permanentConfig);
network = NetworkRegistry.INSTANCE.newSimpleChannel("Malmo");
network.registerMessage(ObservationFromFullStatsImplementation.FullStatsRequestMessageHandler.class, ObservationFromFullStatsImplementation.FullStatsRequestMessage.class, 1, Side.SERVER);
network.registerMessage(ObservationFromGridImplementation.GridRequestMessageHandler.class, ObservationFromGridImplementation.GridRequestMessage.class, 2, Side.SERVER);
// Malmo messages from server to client
network.registerMessage(MalmoMessageHandler.class, MalmoMessage.class, 3, Side.CLIENT);
network.registerMessage(SimpleCraftCommandsImplementation.CraftMessageHandler.class, SimpleCraftCommandsImplementation.CraftMessage.class, 4, Side.SERVER);
network.registerMessage(AbsoluteMovementCommandsImplementation.TeleportMessageHandler.class, AbsoluteMovementCommandsImplementation.TeleportMessage.class, 5, Side.SERVER);
// Malmo messages from client to server
network.registerMessage(MalmoMessageHandler.class, MalmoMessage.class, 6, Side.SERVER);
network.registerMessage(InventoryCommandsImplementation.InventoryMessageHandler.class, InventoryCommandsImplementation.InventoryMessage.class, 7, Side.SERVER);
network.registerMessage(DiscreteMovementCommandsImplementation.UseActionMessageHandler.class, DiscreteMovementCommandsImplementation.UseActionMessage.class, 8, Side.SERVER);
network.registerMessage(DiscreteMovementCommandsImplementation.AttackActionMessageHandler.class, DiscreteMovementCommandsImplementation.AttackActionMessage.class, 9, Side.SERVER);
network.registerMessage(ObservationFromFullInventoryImplementation.InventoryRequestMessageHandler.class, ObservationFromFullInventoryImplementation.InventoryRequestMessage.class, 10, Side.SERVER);
network.registerMessage(InventoryCommandsImplementation.InventoryChangeMessageHandler.class, InventoryCommandsImplementation.InventoryChangeMessage.class, 11, Side.CLIENT);
network.registerMessage(ObservationFromSystemImplementation.SystemRequestMessageHandler.class, ObservationFromSystemImplementation.SystemRequestMessage.class, 12, Side.SERVER);
}
use of net.minecraftforge.fml.common.Mod.EventHandler in project MorePlanets by SteveKunG.
the class MorePlanetsCore method preInit.
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
ConfigManagerMP.init(new File(event.getModConfigurationDirectory(), "MorePlanets.cfg"));
MorePlanetsCore.initModInfo(event.getModMetadata());
MorePlanetsCore.BLOCK_TAB = new CreativeTabsMP("MorePlanetsBlocks");
MorePlanetsCore.ITEM_TAB = new CreativeTabsMP("MorePlanetsItems");
MPBlocks.init();
MPItems.init();
MPEntities.init();
MPPlanets.init();
MPPotions.init();
MPBiomes.init();
MPOthers.init();
MorePlanetsCore.PROXY.registerPreRendering();
}
Aggregations