當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。