当前位置: 首页>>代码示例>>Java>>正文


Java Mod.EventHandler方法代码示例

本文整理汇总了Java中net.minecraftforge.fml.common.Mod.EventHandler方法的典型用法代码示例。如果您正苦于以下问题:Java Mod.EventHandler方法的具体用法?Java Mod.EventHandler怎么用?Java Mod.EventHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.fml.common.Mod的用法示例。


在下文中一共展示了Mod.EventHandler方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
    CapabilityExtendedHealthSystem.register();

    int i = 0;
    NETWORKING = NetworkRegistry.INSTANCE.newSimpleChannel(MODID);
    NETWORKING.registerMessage(MessageReceiveDamage.Handler.class, MessageReceiveDamage.class, ++i, Side.CLIENT);
    NETWORKING.registerMessage(MessageApplyHealingItem.Handler.class, MessageApplyHealingItem.class, ++i , Side.SERVER);
    NETWORKING.registerMessage(MessageReceiveConfiguration.Handler.class, MessageReceiveConfiguration.class, ++i, Side.CLIENT);
    NETWORKING.registerMessage(MessageApplyAbsorption.Handler.class, MessageApplyAbsorption.class, ++i, Side.CLIENT);
    NETWORKING.registerMessage(MessageAddHealth.Handler.class, MessageAddHealth.class, ++i, Side.CLIENT);
    NETWORKING.registerMessage(MessagePlayHurtSound.Handler.class, MessagePlayHurtSound.class, ++i, Side.CLIENT);
    NETWORKING.registerMessage(MessageClientUpdate.Handler.class, MessageClientUpdate.class, ++i, Side.SERVER);
    NETWORKING.registerMessage(MessageResync.Handler.class, MessageResync.class, ++i, Side.CLIENT);
    MessageReceiveConfiguration.validate();

    if (Loader.isModLoaded("morpheus")) {
        enableMorpheusCompat = true;
        logger.info("Morpheus present - enabling compatibility module");
        MorpheusHelper.register();
    }

    RegistryManager.registerDefaults();
    checkEarlyExit();
}
 
开发者ID:ichttt,项目名称:FirstAid,代码行数:26,代码来源:FirstAid.java

示例2: preInit

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
/**
 * Run before anything else. Read your config, create blocks, items, etc, and
 * register them with the GameRegistry.
 */
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {
    logger = e.getModLog();
    creativeTab = new CompatCreativeTabs("lector") {
        @Override
        protected Item getItem() {
            return ModItems.manual;
        }
    };
    this.proxy.preInit(e);
}
 
开发者ID:McJty,项目名称:Lector,代码行数:16,代码来源:Lector.java

示例3: preInit

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {
   // register block
   GameRegistry.register(blockXPBox = new BlockXPBox());
   ItemBlock item = new ItemBlock(blockXPBox);
   GameRegistry.register(item, blockXPBox.getRegistryName());

   proxy.registerItemRenderer(item);

   // init network
   PacketHandler.init();
}
 
开发者ID:arucil,项目名称:mc-XPBox,代码行数:13,代码来源:XPBox.java

示例4: imcCallback

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void imcCallback(FMLInterModComms.IMCEvent event) {
    for (FMLInterModComms.IMCMessage message : event.getMessages()) {
        if (message.key.equalsIgnoreCase("getTheWheel")) {
            Optional<Function<IInteractionWheel, Void>> value = message.getFunctionValue(IInteractionWheel.class, Void.class);
            if (value.isPresent()) {
                value.get().apply(interactionWheelImp);
            } else {
                logger.warn("Some mod didn't return a valid result with getTheWheel!");
            }
        }
    }
}
 
开发者ID:McJty,项目名称:interactionwheel,代码行数:14,代码来源:InteractionWheel.java

示例5: init

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{		
	instance = this;		
	proxy.init();
	proxy.registerAnimations();

	AnimationNetworkHandler.init();
	
	if(FMLCommonHandler.instance().getEffectiveSide().isClient()) {
		EventHandlerDebug eventHandlerDebug = new EventHandlerDebug();
		MinecraftForge.EVENT_BUS.register(eventHandlerDebug);
		FMLCommonHandler.instance().bus().register(eventHandlerDebug);
	}
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:16,代码来源:ObsidianOverhaul.java

示例6: preInit

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e)
{
    if (!CreeperHost.instance.active)
        return;
    MinecraftForge.EVENT_BUS.register(this);
    logger = e.getModLog();
    setupPlayerKicker();
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:10,代码来源:CreeperHostServer.java

示例7: init

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
    logger.info("Start mod :)");
}
 
开发者ID:Kubithorg,项目名称:KubidibotsStreamDownloaderFromYoutubeAndDisplayerThanksToAForgeMod,代码行数:5,代码来源:Streamer.java

示例8: postInit

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent e) {
    proxy.postInit(e);
}
 
开发者ID:McJty,项目名称:InControl,代码行数:5,代码来源:InControl.java

示例9: init

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
	proxy.init(event);
	
}
 
开发者ID:coehlrich,项目名称:chunk-logger,代码行数:6,代码来源:ChunkLogger.java

示例10: postInit

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event)
{
	proxy.postInit(event);
}
 
开发者ID:DarkMorford,项目名称:Simple-Chunks,代码行数:6,代码来源:SimpleChunks.java

示例11: init

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
	proxy.init();
}
 
开发者ID:CJMinecraft01,项目名称:EntitiesTutorial,代码行数:5,代码来源:EntitiesTutorial.java

示例12: postInit

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event) {
    proxy.postInit(event);
}
 
开发者ID:MinecraftPangu,项目名称:Pangu,代码行数:5,代码来源:PanguCore.java

示例13: serverLoad

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void serverLoad(FMLServerStartingEvent event) {
    event.registerServerCommand(new CommandTestApi());
    event.registerServerCommand(new CommandClearActions());
    event.registerServerCommand(new CommandListActions());
}
 
开发者ID:McJty,项目名称:MeeCreeps,代码行数:7,代码来源:MeeCreeps.java

示例14: init

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event){ }
 
开发者ID:elytra,项目名称:tp-plus,代码行数:3,代码来源:TPPlus.java

示例15: init

import net.minecraftforge.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{
    proxy.init(event);
}
 
开发者ID:talandar,项目名称:ProgressiveDifficulty,代码行数:6,代码来源:ProgressiveDifficulty.java


注:本文中的net.minecraftforge.fml.common.Mod.EventHandler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。