當前位置: 首頁>>代碼示例>>Java>>正文


Java FMLInterModComms.IMCEvent方法代碼示例

本文整理匯總了Java中net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java FMLInterModComms.IMCEvent方法的具體用法?Java FMLInterModComms.IMCEvent怎麽用?Java FMLInterModComms.IMCEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.fml.common.event.FMLInterModComms的用法示例。


在下文中一共展示了FMLInterModComms.IMCEvent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onIMCMessage

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@EventHandler
public void onIMCMessage(FMLInterModComms.IMCEvent event)
{
    for(FMLInterModComms.IMCMessage message : event.getMessages())
    {
        if(message.key.equalsIgnoreCase("blacklist") && message.isItemStackMessage())
        {
            if(!blacklist.contains(message.getItemStackValue().getItem()))
            {
                blacklist.add(message.getItemStackValue().getItem());
                logger.info("Registered " + message.getItemStackValue().getItem().toString() + " to Item blacklist");
            }
        }
        else if(message.key.equalsIgnoreCase("backtool") && message.isItemStackMessage())
        {
            if(!orientationMap.containsKey(message.getItemStackValue().getItem().getClass()))
            {
                orientationMap.put(message.getItemStackValue().getItem().getClass(), message.getItemStackValue().getCount());
                logger.warn("Registered " + message.getItemStackValue().getItem().getClass().getName() + " to backtools");
            }
        }
    }
}
 
開發者ID:iChun,項目名稱:BackTools,代碼行數:24,代碼來源:BackTools.java

示例2: onReceiveIMC

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void onReceiveIMC(FMLInterModComms.IMCEvent event) {
    for (FMLInterModComms.IMCMessage message : event.getMessages()) {
        if (message.key.equalsIgnoreCase("possess_handler")) {
            if (message.isStringMessage()) {
                try {
                    Class<? extends EntityPossessHandler> clazz = (Class<? extends EntityPossessHandler>) Class.forName(message.getStringValue());
                    EntityPossessHandler handler = clazz.getDeclaredConstructor().newInstance();
                    PossessHandler.registerHandler(handler);
                } catch (Exception e) {
                    System.err.println("Received invalid IMC EntityPossessHandler class from mod " + message.getSender() + " (" + message.getStringValue() + ")");
                    e.printStackTrace();
                }
            }
        }
    }
}
 
開發者ID:Fararise,項目名稱:Possessed,代碼行數:18,代碼來源:Possessed.java

示例3: imcCallback

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的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

示例4: handleImc

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void handleImc(FMLInterModComms.IMCEvent event) {
    for (FMLInterModComms.IMCMessage message : event.getMessages()) {
        try {
            RecipeViewer.handleImc(message);
            handleImc(message);
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }
}
 
開發者ID:purpleposeidon,項目名稱:Factorization,代碼行數:12,代碼來源:DocumentationModule.java

示例5: onIMC

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
public static void onIMC(FMLInterModComms.IMCEvent event) {
    for (final FMLInterModComms.IMCMessage imcMessage : event.getMessages()) {
        if (imcMessage.key.toLowerCase().equals("lootblacklist") && imcMessage.isItemStackMessage()) {
            lootBlacklist.add(imcMessage.getItemStackValue());
        }
    }
}
 
開發者ID:AdlyTempleton,項目名稱:Aura-Cascade,代碼行數:8,代碼來源:IMCManager.java

示例6: onIMCMessage

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void onIMCMessage(FMLInterModComms.IMCEvent event)
{
    for(FMLInterModComms.IMCMessage message : event.getMessages())
    {
        if(message.key.equalsIgnoreCase("blacklist"))
        {
            try
            {
                Class clz = Class.forName(message.getStringValue());
                if(ModelBase.class.isAssignableFrom(clz))
                {
                    if(ModelList.modelBlacklist.contains(clz))
                    {
                        Tabula.LOGGER.warn(message.getStringValue() + " is already blacklisted");
                    }
                    else
                    {
                        ModelList.modelBlacklist.add(clz);
                        Tabula.LOGGER.warn(message.getStringValue() + " blacklisted from Tabula's import list");
                    }
                }
                else
                {
                    Tabula.LOGGER.warn(message.getStringValue() + " is not a model class!");
                }
            }
            catch(Exception e)
            {
                Tabula.LOGGER.warn("Could not find class " + message.getStringValue() + " for blacklist");
            }
        }
    }
}
 
開發者ID:iChun,項目名稱:Tabula,代碼行數:35,代碼來源:Tabula.java

示例7: processIMC

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
public void processIMC(final FMLInterModComms.IMCEvent event) {
    for (final FMLInterModComms.IMCMessage message : event.getMessages()) {
        if ("checkUpdate".equals(message.key) && message.isStringMessage()) {
            processMessage(message.getSender(), message.getStringValue());
        }
    }
}
 
開發者ID:Lunatrius,項目名稱:LunatriusCore,代碼行數:8,代碼來源:CommonProxy.java

示例8: processMessage

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@EventHandler
public void processMessage(FMLInterModComms.IMCEvent event) {
	for (FMLInterModComms.IMCMessage m : event.getMessages()) {
		if (m.isStringMessage() && "donateUrl".equalsIgnoreCase(m.key)) {
			DonationUrlManager.instance().addUrl(m.getSender(), m.getStringValue());
		}

		if (m.isItemStackMessage() && "bucket".equalsIgnoreCase(m.key)) {
			filledBuckets.add(m.getItemStackValue());
		}
	}
}
 
開發者ID:OpenMods,項目名稱:OpenBlocks,代碼行數:13,代碼來源:OpenBlocks.java

示例9: handleIMC

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void handleIMC(FMLInterModComms.IMCEvent event) {
    modCompat.processIMC(event.getMessages());
}
 
開發者ID:stuebz88,項目名稱:modName,代碼行數:5,代碼來源:ExampleMod.java

示例10: imcMessage

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void imcMessage(FMLInterModComms.IMCEvent event) {
    LogUtil.logInfo("Handling IMC Messages");
    IMCHandler.processIMCMessages(event.getMessages());
}
 
開發者ID:Lomeli12,項目名稱:arcadian-octo-duck,代碼行數:6,代碼來源:AOD.java

示例11: onIMC

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@EventHandler
public void onIMC(FMLInterModComms.IMCEvent event) {
    IMCManager.onIMC(event);

}
 
開發者ID:AdlyTempleton,項目名稱:Aura-Cascade,代碼行數:6,代碼來源:AuraCascade.java

示例12: processMessages

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void processMessages(FMLInterModComms.IMCEvent event) {
	for (final FMLInterModComms.IMCMessage msg : event.getMessages()) {
		WeaponRegistry.INSTANCE.processMessage(msg);
	}
}
 
開發者ID:coolAlias,項目名稱:ZeldaSwordSkills,代碼行數:7,代碼來源:ZSSMain.java

示例13: processIMC

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void processIMC(final FMLInterModComms.IMCEvent event) {
    proxy.processIMC(event);
}
 
開發者ID:Lunatrius,項目名稱:LunatriusCore,代碼行數:5,代碼來源:LunatriusCore.java

示例14: handleIMCMessages

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void handleIMCMessages(FMLInterModComms.IMCEvent event)
{
    IMCHandler.processMessages(event.getMessages());
}
 
開發者ID:Dynious,項目名稱:VersionChecker,代碼行數:6,代碼來源:VersionChecker.java

示例15: processIMCRequests

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@EventHandler
public void processIMCRequests(FMLInterModComms.IMCEvent event){
    proxy.processIMC(event);
}
 
開發者ID:MineMaarten,項目名稱:IGW-mod,代碼行數:5,代碼來源:IGWMod.java


注:本文中的net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。