本文整理汇总了Java中cpw.mods.fml.common.Mod.EventHandler方法的典型用法代码示例。如果您正苦于以下问题:Java Mod.EventHandler方法的具体用法?Java Mod.EventHandler怎么用?Java Mod.EventHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cpw.mods.fml.common.Mod
的用法示例。
在下文中一共展示了Mod.EventHandler方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
Configurator.configure(new File("config/" + MODID + ".cfg"));
GameRegistry.registerWorldGenerator(new Decorator(), 4096);
FMLCommonHandler.instance().bus().register(this);
MinecraftForge.EVENT_BUS.register(this);
}
示例2: init
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{
proxy.init(event);
ItemLoader.LoadItems();
//BlockLoader.loadBlocks();
Recipes.registerRecpies();
//EntityLoader.LoadEntitys();
//OreDict.addores();
Achievements.loadAchievements();
Stats.RegisterStats();
PlayerChecker.checkPlayer(username);
LootRegistry.registerLoot();
}
示例3: init
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
proxy.registerNetworkStuff();
NetworkRegistry.INSTANCE.registerGuiHandler(this, new TechnicalGuiHandler());
TechnicalItem.removeVanillaRecipes();
Recipes.init();
FMLCommonHandler.instance().bus().register(new EventListener());
radioactivityPotion = (new PotionTechnical(radioactivityPotionId, true, 0)).setIconIndex(0, 0).setPotionName("potion.radioactivityPotion");
TechnicalAchievement.init();
AchievementPage.registerAchievementPage(technicalAchievementPage);
}
示例4: init
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
/**
* This is the second pass of logic in this mod.
*/
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{
InitEvent e;
e = new InitEvent();
e.Go(event);
}
示例5: postInit
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event) {
{
//Thread.currentThread().setName("EpicProportionsMod");
MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerChocolate));
MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerForJen));
MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerLove));
MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerPinkHeart));
MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerRainbow));
MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerRedHeart));
MinecraftForge.EVENT_BUS.register(new CustomPresentDrops());
MinecraftForge.EVENT_BUS.register(new VersionChecker());
MinecraftForge.EVENT_BUS.register(new CommandModInfo());
//MinecraftForge.EVENT_BUS.register(new PotionLoader(33, false, 8171462));
//MinecraftForge.EVENT_BUS.register(new PotionLoader(33, false, 8171462));
MinecraftForge.EVENT_BUS.register(new WorldGenPumpkin_Pat());
MinecraftForge.EVENT_BUS.register(new WorldGenPumpkin_Jen());
MinecraftForge.EVENT_BUS.register(new StructureVillagePieces());
//MinecraftForge.EVENT_BUS.register(new Yggdrasil());
MinecraftForge.EVENT_BUS.register(new LogHelper());
//MinecraftForge.EVENT_BUS.register(new CommandModInfo());
//MinecraftForge.EVENT_BUS.register(new BiomeGenPat(getBIOME_ID_PAT()));
//MinecraftForge.EVENT_BUS.register(new BiomeGenJen(getBIOME_ID_JEN()));
//MinecraftForge.EVENT_BUS.register(new WorldProviderEpicProportions());
//MinecraftForge.EVENT_BUS.register(new EpicProportionsBiomes(ENTITY_ID_0, null));
//MinecraftForge.EVENT_BUS.register(new RenderGuiHandler());
//MinecraftForge.ORE_GEN_BUS.register(new BiomeDecorator());
Recipes.registerRecpies();
MinecraftForge.EVENT_BUS.register(new CommandChangelog());
//MUhTTawz.maAzeRcL();
}
}
示例6: onInit
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void onInit(FMLInitializationEvent e){
/*
REGISTERS ALL COMMON THINGS SO FOR BOTH SERVER AND CLIENT...
*/
LOTRAddonsItems.registerRings();
LOTRAddonsBlocks.registerBlocks();
LOTRAddonsEntities.registerEntities();
NetworkRegistry.INSTANCE.registerGuiHandler(LOTRAddons.lotrAddons, new GuiHandler());
}
示例7: preInit
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){
if (event.getSide() == Side.SERVER) {
logger.info("Client side only mod - not doing anything on the server!");
return;
}
}
示例8: serverStarting
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
event.registerServerCommand(new CommandInvite());
event.registerServerCommand(new CommandPregen());
deserializePreload(new File(getSaveFolder(), "pregenData.json"));
}
示例9: serverStopping
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
if (!CreeperHost.instance.active)
return;
serverOn = false;
serializePreload();
pregenTasks.clear();
}
示例10: preInit
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e)
{
if (!CreeperHost.instance.active)
return;
MinecraftForge.EVENT_BUS.register(this);
FMLCommonHandler.instance().bus().register(this);
logger = e.getModLog();
}
示例11: preInit
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
TechnicalBlock.registerBlocks();
TechnicalItem.registerItems();
TechnicalTools.registerTools();
GameRegistry.registerWorldGenerator(this.eventWorldGen, 0);
proxy.registerTileEntities();
((Item) Item.itemRegistry.getObject("water_bucket")).setMaxStackSize(16);
for (int i = 0; i < 5; ++i) {
VillagerRegistry.instance().registerVillageTradeHandler(i, new TradeHandler());
}
Potion[] potionTypes;
for (Field f : Potion.class.getDeclaredFields()) {
f.setAccessible(true);
try {
if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) {
Field modfield = Field.class.getDeclaredField("modifiers");
modfield.setAccessible(true);
modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL);
potionTypes = (Potion[]) f.get(null);
final Potion[] newPotionTypes = new Potion[256];
System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length);
f.set(null, newPotionTypes);
}
} catch (Exception e) {
e.printStackTrace();
}
}
MinecraftForge.EVENT_BUS.register(new TechnicalEventHooks());
MinecraftForge.ORE_GEN_BUS.register(new TechnicalOreGenEventHooks());
}
示例12: postInit
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(islands.getPath()));
if (br.readLine() == null) {
logger.info("Islands file empty, placing a default value.");
IslandCreator.islandLocations.put("default", new IslandCreator.IslandPos(0, 60, 0));
try {
saveIslands(IslandCreator.islandLocations);
} catch (IOException e) {
e.printStackTrace();
}
}
br.close();
}
示例13: init
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
@SuppressWarnings("unused")
public void init(FMLInitializationEvent event) {
proxy.registerRenderer();
AntiMatterModRegistry.registerInit(event);
AMMRegistry.INSTANCE.handleInit();
RecipeRegister.beforeRemoveRecipeinit(event);
RecipeRegister.RecipeRegisterInit(event);
RecipeRegister.afterRemoveRecipeinit(event);
}
示例14: preInit
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
/**
* This is the first pass of logic in this mod.
*/
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
PreInitEvent e;
e = new PreInitEvent();
e.Go(event);
}
示例15: preInit
import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
@SideOnly(Side.CLIENT)
public void preInit(FMLPreInitializationEvent e)
{
Configuration config = new Configuration(e.getSuggestedConfigurationFile());
config.load();
//读取配置文件
ConfigVar.onlinecheck = config.get("Online", "Check", false).getBoolean();
ConfigVar.version = config.get("Online", "Version", "v1.0").getString();
ConfigVar.url = config.get("Online", "url", "http://127.0.0.1/").getString();
ConfigVar.IsTwoAddress = config.get("Server", "1sTwoAddress", false).getBoolean();
ConfigVar.ServerAddress = config.get("Server", "Address1", "127.0.0.1").getString();
ConfigVar.ServerAddress1 = config.get("Server", "Address2", "127.0.0.1").getString();
ConfigVar.Captain = config.get("Server", "Captain", "Minecraft 1.7.10").getString();
ConfigVar.announcement = config.get("Server", "Announcement", "").getString();
ConfigVar.announcementmove = config.get("Server", "AnnouncementMove", false).getBoolean();
ConfigVar.debug = config.get("General", "debugMode", false).getBoolean();
ConfigVar.ChangeLogFilename = config.get("Online", "ChangelogFilename", "NewMenuChangelog.txt").getString();
ConfigVar.JsonFilename = config.get("Online", "JsonFilename", "NewMenu.json").getString();
config.save();
//结束读取
if(ConfigVar.onlinecheck)
{
this.changeLog = InternetUtil.LoadText(ConfigVar.url + "/" + ConfigVar.ChangeLogFilename);
this.jsonString = InternetUtil.LoadText(ConfigVar.url + "/" + ConfigVar.JsonFilename);
}
Display.setTitle(ConfigVar.Captain);
MinecraftForge.EVENT_BUS.register(NewMenuHandler.instance);
}