本文整理匯總了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");
}
示例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.");
}
示例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");
}
示例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());
}
示例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");
}
}
}
}
示例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");
}
示例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();
}
}
}
}
}
示例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());
}
示例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();
}
}
示例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);
}
示例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);
}
示例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");
}
示例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();
}
}
示例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();
}
示例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();
}