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


Java FMLInterModComms類代碼示例

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


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

示例1: init

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入依賴的package包/類
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{		
	FMLInterModComms.sendRuntimeMessage(MODID, "VersionChecker", "addVersionCheck", VERSION_LINK);
	
	instance = this;		
	proxy.init();
       
       EventHandler eventHandler = new EventHandler();
       MinecraftForge.EVENT_BUS.register(eventHandler);
	
       if(FMLCommonHandler.instance().getEffectiveSide().isClient())
           FMLCommonHandler.instance().bus().register(eventHandler);
       
       //Minecraft.getMinecraft().gameSettings.showInventoryAchievementHint = false;
       Minecraft.getMinecraft().gameSettings.saveOptions();
       
       //Stop space from activating buttons, allowing it to be used for adding keyframes in the timeline.
       InputMap im = (InputMap)UIManager.get("Button.focusInputMap");
       im.put(KeyStroke.getKeyStroke("pressed SPACE"), "none");
       im.put(KeyStroke.getKeyStroke("released SPACE"), "none");
}
 
開發者ID:ObsidianSuite,項目名稱:ObsidianSuite,代碼行數:23,代碼來源:ObsidianAnimator.java

示例2: onInit

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入依賴的package包/類
@Mod.EventHandler
public void onInit(FMLInitializationEvent ev) {
    info("Randores is Initializing...",
            "Sending handler message to WAILA.");
    FMLInterModComms.sendMessage("waila", "register", "com.gmail.socraticphoenix.randores.waila.RandoresWailaHandler.callbackRegister");
    if (Loader.isModLoaded("waila")) {
        info("WAILA was found and should have receieved the handler message.");
    } else {
        info("WAILA wasn't found. The handler message will be ignored.");
    }

    info("Registering up GUI handler and world generators...");
    NetworkRegistry.INSTANCE.registerGuiHandler(this, new RandoresGuiHandler());
    GameRegistry.registerWorldGenerator(new RandoresWorldGenerator(), 10);
    GameRegistry.registerWorldGenerator(new RandoresAltarGenerator(), -100);
    info("Registered GUI hander and world generators.", "Calling proxy Initialization...");
    Randores.PROXY.initSided(ev);
    info("Finished Initialization.");
}
 
開發者ID:Randores,項目名稱:Randores2,代碼行數:20,代碼來源:Randores.java

示例3: init

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入依賴的package包/類
@EventHandler
public void init(FMLInitializationEvent event) {
	proxy.init(event);

	NetworkRegistry.INSTANCE.registerGuiHandler(Currency.INSTANCE, new GuiHandler());

	AccountCapability.register();
	CartCapability.register();

	PacketDispatcher.registerPackets();

	FMLInterModComms.sendMessage("waila", "register", "com.zundrel.currency.common.compat.waila.CurrencyWailaProvider.callbackRegister");

	GameRegistry.registerTileEntity(TileEntityShopController.class, ModInfo.MODID + ":" + "shop_controller");
	GameRegistry.registerTileEntity(TileEntityDisplay.class, ModInfo.MODID + ":" + "display");
	GameRegistry.registerTileEntity(TileEntityStockCrate.class, ModInfo.MODID + ":" + "stock_crate");
}
 
開發者ID:Zundrel,項目名稱:Never-Enough-Currency,代碼行數:18,代碼來源:Currency.java

示例4: onInit

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入依賴的package包/類
@EventHandler
public void onInit(FMLInitializationEvent e) {
	proxy.init();
	//TODO: When smores has ore voting stabilized, update and re-enable this
	//NBTTagCompound oresTag = new NBTTagCompound();
	//oresTag.setBoolean("oreCopper", true);
	//oresTag.setBoolean("ingotCopper", true);
	//oresTag.setBoolean("dustCopper", true);
	//oresTag.setBoolean("gearCopper", true);
	//oresTag.setBoolean("plateCopper", true);
	//FMLInterModComms.sendMessage("smores", "recipeVote", oresTag);
	
	//Thermionics machines are *unusually* safe for charset to carry around
	FMLInterModComms.sendMessage("charset", "addCarry", ThermionicsBlocks.FIREBOX.getRegistryName());
	FMLInterModComms.sendMessage("charset", "addCarry", ThermionicsBlocks.OVEN.getRegistryName());
	FMLInterModComms.sendMessage("charset", "addCarry", ThermionicsBlocks.BATTERY_LEAD.getRegistryName()); //Avoid creative battery carry!
	FMLInterModComms.sendMessage("charset", "addCarry", ThermionicsBlocks.HAMMER_MILL.getRegistryName());
	FMLInterModComms.sendMessage("charset", "addCarry", ThermionicsBlocks.MOTOR_CONVECTION.getRegistryName());
	FMLInterModComms.sendMessage("charset", "addCarry", ThermionicsBlocks.SERGER.getRegistryName());
}
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:21,代碼來源:Thermionics.java

示例5: 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

示例6: initializeMods

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入依賴的package包/類
public void initializeMods()
{
    progressBar.step("Initializing mods Phase 2");
    // Mod controller should be in the initialization state here
    modController.distributeStateMessage(LoaderState.INITIALIZATION);
    progressBar.step("Initializing mods Phase 3");
    modController.transition(LoaderState.POSTINITIALIZATION, false);
    modController.distributeStateMessage(FMLInterModComms.IMCEvent.class);
    ItemStackHolderInjector.INSTANCE.inject();
    modController.distributeStateMessage(LoaderState.POSTINITIALIZATION);
    progressBar.step("Finishing up");
    modController.transition(LoaderState.AVAILABLE, false);
    modController.distributeStateMessage(LoaderState.AVAILABLE);
    PersistentRegistryManager.freezeData();
    FMLLog.info("Forge Mod Loader has successfully loaded %d mod%s", mods.size(), mods.size() == 1 ? "" : "s");
    progressBar.step("Completing Minecraft initialization");
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:18,代碼來源:Loader.java

示例7: 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

示例8: postInit

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入依賴的package包/類
@Override
public void postInit() {
	if (Loader.isModLoaded("VersionChecker")) {
		FMLInterModComms.sendRuntimeMessage(Reference.MOD_ID, "VersionChecker", "addVersionCheck", Reference.VersionURL);
	} else {
		VersionCheck versionCheck = new VersionCheck();
		Thread versionCheckThread = new Thread(versionCheck, "Version Check");
		versionCheckThread.start();
	}
	if (Loader.isModLoaded("CarpentersBlocks")) {
		MwChunk.carpenterdata();
	}
	if (Loader.isModLoaded("ForgeMultipart")) {
		MwChunk.FMPdata();

	}
	MwAPI.registerDataProvider("Slime", new OverlaySlime());
	MwAPI.registerDataProvider("Grid", new OverlayGrid());
}
 
開發者ID:tom5454,項目名稱:Toms-Mod,代碼行數:20,代碼來源:ClientProxy.java

示例9: init

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入依賴的package包/類
@EventHandler
public static void init(FMLInitializationEvent event) {
	OreRegistry.loadJson(new File(configDirectory, "OreRegistry.json"));
	loadConfigs();

	Recipes.init();
	OreRegistry.doRecipes();

	proxy.initOreModels();
	proxy.registerColorHandlers();

	FMLInterModComms.sendMessage("Waila", "register",
			"exnihiloadscensio.compatibility.CompatWaila.callbackRegister");
	
	if (Loader.isModLoaded("theoneprobe") && Config.doTOPCompat) {
		CompatTOP.init();
	}
}
 
開發者ID:MikeLydeamore,項目名稱:ExNihiloAdscensio,代碼行數:19,代碼來源:ExNihiloAdscensio.java

示例10: init

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入依賴的package包/類
@Override
public void init(FMLInitializationEvent event) {
/*    rollingmachine_recipes = RailcraftCraftingManager.rollingMachine.getRecipeList();
    crusher_recipes = RailcraftCraftingManager.rockCrusher.getRecipes();
    coke_oven = RailcraftCraftingManager.cokeOven.getRecipes();
    blast_furnace = RailcraftCraftingManager.blastFurnace.getRecipes(); */

    FMLInterModComms.sendMessage(DocumentationModule.modid, "AddRecipeCategory", "tile.railcraft.machine.alpha.rolling.machine.name|factorization.compat.railcraft.Compat_Railcraft|rollingmachine_recipes");
    //FMLInterModComms.sendMessage(DocumentationModule.modid, "AddRecipeCategory", "tile.railcraft.machine.alpha.rock.crusher.name|factorization.compat.railcraft.Compat_Railcraft|crusher_recipes");
    FMLInterModComms.sendMessage(DocumentationModule.modid, "AddRecipeCategory", "railcraft.gui.coke.oven|factorization.compat.railcraft.Compat_Railcraft|coke_oven");
    FMLInterModComms.sendMessage(DocumentationModule.modid, "AddRecipeCategory", "railcraft.gui.blast.furnace|factorization.compat.railcraft.Compat_Railcraft|blast_furnace");

    NBTTagCompound tag = new NBTTagCompound();
    tag.setString("category", "tile.railcraft.machine.alpha.rock.crusher.name|factorization.compat.railcraft.Compat_Railcraft|crusher_recipes");
    tag.setTag("input", list("getInput()"));
    tag.setTag("output", list("getPossibleOuputs()"));
    FMLInterModComms.sendMessage(DocumentationModule.modid, "AddRecipeCategoryGuided", tag);
}
 
開發者ID:purpleposeidon,項目名稱:Factorization,代碼行數:19,代碼來源:Compat_Railcraft.java

示例11: registerCraftingTweaks

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入依賴的package包/類
/**
 * 
 * https://minecraft.curseforge.com/projects/crafting-tweaks https://github.com/blay09/CraftingTweaks/blob/1.12/README.md
 */
private static void registerCraftingTweaks() {
  //first the players inventory 
  NBTTagCompound tagCompound = new NBTTagCompound();
  tagCompound.setString("ContainerClass", ContainerPlayerExtWorkbench.class.getName());
  tagCompound.setInteger("GridSlotNumber", 6);
  //    tagCompound.setInteger("GridSize", 9);
  FMLInterModComms.sendMessage("craftingtweaks", "RegisterProvider", tagCompound);
  //then the grey workbench 
  tagCompound = new NBTTagCompound();
  tagCompound.setString("ContainerClass", ContainerWorkBench.class.getName());
  tagCompound.setInteger("GridSlotNumber", 1);
  FMLInterModComms.sendMessage("craftingtweaks", "RegisterProvider", tagCompound);
  //then the purple autocrafter
  tagCompound = new NBTTagCompound();
  tagCompound.setString("ContainerClass", ContainerCrafter.class.getName());
  tagCompound.setInteger("GridSlotNumber", 10);
  FMLInterModComms.sendMessage("craftingtweaks", "RegisterProvider", tagCompound);
}
 
開發者ID:PrinceOfAmber,項目名稱:Cyclic,代碼行數:23,代碼來源:InterModCommsRegistry.java

示例12: preInit

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入依賴的package包/類
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    creativeBlockPlacer = new ItemCreativeBlockPlacer();
    GameRegistry.register(creativeBlockPlacer, blockPlacerResourceLocation);
    proxy.preInit(event);
    Config.preInit(event);
    sourceFile = event.getSourceFile();
    MinecraftForge.EVENT_BUS.register(this);

    JSONConfigHandler.setup(event.getModConfigurationDirectory());
    CreativeBlocksRegistry.init();
    NetworkHandler.init();


    FMLInterModComms.sendMessage("Waila", "register", "squeek.creativeblocks.integration.waila.WailaRegistrar.register");
    FMLInterModComms.sendMessage("VersionChecker", "addVersionCheck", "http://www.ryanliptak.com/minecraft/versionchecker/squeek502/CreativeBlocks");
}
 
開發者ID:squeek502,項目名稱:CreativeBlocks,代碼行數:19,代碼來源:CreativeBlocks.java

示例13: onIMCMessage

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入依賴的package包/類
public void onIMCMessage(FMLInterModComms.IMCMessage message, boolean server, boolean runtime)
{
    try
    {
        boolean didHandle = handleMessage(message, server, runtime);

        if (!didHandle)
        {
            logger.warn("Could not handle message with key '" + message.key + "' of type '" + message.getMessageType().getName() + "'");
        }
    }
    catch (Exception ex)
    {
        logger.error("Exception on message with key '" + message.key + "' of type '" + message.getMessageType().getName() + "'");
        ex.printStackTrace();
    }
}
 
開發者ID:Ivorforce,項目名稱:IvToolkit,代碼行數:18,代碼來源:IvFMLIntercommHandler.java

示例14: init

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入依賴的package包/類
@EventHandler
public void init(FMLInitializationEvent event){
	log("Setting up inter-mod stuff...");

	FMLInterModComms.sendMessage("Waila", "register", "net.geforcemods.securitycraft.imc.waila.WailaDataProvider.callbackRegister");

	if(config.checkForUpdates) {
		NBTTagCompound vcUpdateTag = VersionUpdateChecker.getNBTTagCompound();
		if(vcUpdateTag != null)
			FMLInterModComms.sendRuntimeMessage(MODID, "VersionChecker", "addUpdate", vcUpdateTag);
	}

	log("Registering mod content... (PT 2/2)");
	NetworkRegistry.INSTANCE.registerGuiHandler(this, guiHandler);
	RegistrationHandler.registerEntities();
	EnumCustomModules.refresh();
	serverProxy.registerRenderThings();
}
 
開發者ID:Geforce132,項目名稱:SecurityCraft,代碼行數:19,代碼來源:SecurityCraft.java

示例15: init

import net.minecraftforge.fml.common.event.FMLInterModComms; //導入依賴的package包/類
@EventHandler
public void init(FMLInitializationEvent event){
	log("Setting up inter-mod stuff...");

	FMLInterModComms.sendMessage("waila", "register", "net.geforcemods.securitycraft.imc.waila.WailaDataProvider.callbackRegister");

	if(config.checkForUpdates) {
		NBTTagCompound vcUpdateTag = VersionUpdateChecker.getNBTTagCompound();
		if(vcUpdateTag != null)
			FMLInterModComms.sendRuntimeMessage(MODID, "VersionChecker", "addUpdate", vcUpdateTag);
	}

	log("Regisering mod content... (PT 2/2)");
	NetworkRegistry.INSTANCE.registerGuiHandler(this, guiHandler);
	RegistrationHandler.registerEntities();
	EnumCustomModules.refresh();
	serverProxy.registerRenderThings();
}
 
開發者ID:Geforce132,項目名稱:SecurityCraft,代碼行數:19,代碼來源:SecurityCraft.java


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