public static void addSmelter(int energy, final ItemStack a, final ItemStack b, final ItemStack output, final ItemStack altOutput, final int prob) {
if (a == null || b == null || output == null) {
return;
}
if (energy <= 0) {
energy = 4000;
}
final NBTTagCompound tag = new NBTTagCompound();
tag.setInteger("energy", energy);
tag.setTag("primaryInput", (NBTBase)getItemStackNBT(a));
tag.setTag("secondaryInput", (NBTBase)getItemStackNBT(b));
tag.setTag("primaryOutput", (NBTBase)getItemStackNBT(output));
if (altOutput != null) {
tag.setTag("secondaryOutput", (NBTBase)getItemStackNBT(altOutput));
tag.setInteger("secondaryChance", prob);
}
FMLInterModComms.sendMessage("ThermalExpansion", "SmelterRecipe", tag);
}
java类cpw.mods.fml.common.event.FMLInterModComms的实例源码
TE4IMC.java 文件源码
项目:ExtraUtilities
阅读 21
收藏 0
点赞 0
评论 0
Loader.java 文件源码
项目:TRHS_Club_Mod_2016
阅读 21
收藏 0
点赞 0
评论 0
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);
GameData.freezeData();
// Dump the custom registry data map, if necessary
GameData.dumpRegistry(minecraftDir);
FMLLog.info("Forge Mod Loader has successfully loaded %d mod%s", mods.size(), mods.size() == 1 ? "" : "s");
progressBar.step("Completing Minecraft initialization");
}
ClientProxy.java 文件源码
项目:RorysMod
阅读 20
收藏 0
点赞 0
评论 0
@Override
public void init(FMLInitializationEvent e) {
super.init(e);
Register.registerGlobalEntityID(EntityLaser.class, "laser");
Register.registerEntityRenderingHandler(EntityLaser.class, new RenderLaser());
Register.registerItemRenderer(RorysMod.items.rifle1, new RenderRifle());
Register.registerItemRenderer(RorysMod.items.rifle2, new RenderRifle());
Register.registerItemRenderer(RorysMod.items.rifle3, new RenderRifle());
Register.registerItemRenderer(RorysMod.items.rifle4, new RenderRifle());
Register.registerItemRenderer(RorysMod.items.rifle5, new RenderRifle());
TileEntitySpecialRenderer render = new RenderRifleTable();
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRifleTable.class, render);
Register.registerItemRenderer(Item.getItemFromBlock(RorysMod.blocks.upgradeTable), new ItemRender(render, new TileEntityRifleTable()));
render = new RenderPoweredChest();
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPoweredChest.class, render);
FMLInterModComms.sendMessage("Waila", "register", WailaConfig.class.getName() + ".callbackRegister");
}
Register.java 文件源码
项目:RorysMod
阅读 23
收藏 0
点赞 0
评论 0
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
if (input == null || primaryOutput == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("primaryOutput", new NBTTagCompound());
if (secondaryOutput != null) {
toSend.setTag("secondaryOutput", new NBTTagCompound());
}
input.writeToNBT(toSend.getCompoundTag("input"));
primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
if (secondaryOutput != null) {
secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
toSend.setInteger("secondaryChance", secondaryChance);
}
boolean bool = FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", toSend);
if (bool) recipies++;
}
Register.java 文件源码
项目:RorysMod
阅读 27
收藏 0
点赞 0
评论 0
public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
NBTTagCompound data = new NBTTagCompound();
data.setInteger("energy", energy);
NBTTagCompound input1Compound = new NBTTagCompound();
primaryInput.writeToNBT(input1Compound);
data.setTag("primaryInput", input1Compound);
NBTTagCompound input2Compound = new NBTTagCompound();
secondaryInput.writeToNBT(input2Compound);
data.setTag("secondaryInput", input2Compound);
NBTTagCompound output1Compound = new NBTTagCompound();
primaryOutput.writeToNBT(output1Compound);
data.setTag("primaryOutput", output1Compound);
if (secondaryOutput != null) {
NBTTagCompound output2Compound = new NBTTagCompound();
secondaryOutput.writeToNBT(output2Compound);
data.setTag("secondaryOutput", output2Compound);
data.setInteger("secondaryChance", secondaryChance);
}
boolean bool = FMLInterModComms.sendMessage("ThermalExpansion", "SmelterRecipe", data);
if (bool) recipies++;
}
GT_CustomLoader.java 文件源码
项目:NewHorizonsCoreMod
阅读 18
收藏 0
点赞 0
评论 0
private void fixEnderIO(){
//Example of how to add a recipe:
NBTTagCompound root = new NBTTagCompound();
root.setString(SoulBinderRecipeManager.KEY_RECIPE_UID, "sentientEnderMK2");
root.setInteger(SoulBinderRecipeManager.KEY_REQUIRED_ENERGY, 100000);
root.setInteger(SoulBinderRecipeManager.KEY_REQUIRED_XP, 10);
root.setString(SoulBinderRecipeManager.KEY_SOUL_TYPES, "SpecialMobs.SpecialWitch");
ItemStack is = new ItemStack(EnderIO.itemFrankenSkull, 1, FrankenSkull.ENDER_RESONATOR.ordinal());
NBTTagCompound stackRoot = new NBTTagCompound();
is.writeToNBT(stackRoot);
root.setTag(SoulBinderRecipeManager.KEY_INPUT_STACK, stackRoot);
is = new ItemStack(EnderIO.itemFrankenSkull, 1, FrankenSkull.SENTIENT_ENDER.ordinal());
stackRoot = new NBTTagCompound();
is.writeToNBT(stackRoot);
root.setTag(SoulBinderRecipeManager.KEY_OUTPUT_STACK, stackRoot);
SoulBinderRecipeManager.getInstance().addRecipeFromNBT(root);
FMLInterModComms.sendMessage("EnderIO", "recipe:soulbinder", root);
}
VersionCheck.java 文件源码
项目:ModpackInfo
阅读 33
收藏 0
点赞 0
评论 0
public static void register() {
if (Loader.isModLoaded("VersionChecker")) {
final NBTTagCompound nbt = new NBTTagCompound();
nbt.setString("curseProjectName", CURSE_PROJECT_NAME);
nbt.setString("curseFilenameParser", MOD_NAME_TEMPLATE);
FMLInterModComms.sendRuntimeMessage(ModpackInfo.MOD_ID,
"VersionChecker", "addVersionCheck", nbt);
}
if (ModOptions.getOnlineVersionChecking()) {
final VersionCheck test = new VersionCheck();
FMLCommonHandler.instance().bus().register(test);
new Thread(test).start();
}
}
ThermalExpansionHelper.java 文件源码
项目:Augury
阅读 16
收藏 0
点赞 0
评论 0
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
if (input == null || primaryOutput == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("primaryOutput", new NBTTagCompound());
if (secondaryOutput != null) {
toSend.setTag("secondaryOutput", new NBTTagCompound());
}
input.writeToNBT(toSend.getCompoundTag("input"));
primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
if (secondaryOutput != null) {
secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
toSend.setInteger("secondaryChance", secondaryChance);
}
FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", toSend);
}
ThermalExpansionHelper.java 文件源码
项目:Augury
阅读 23
收藏 0
点赞 0
评论 0
public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
if (input == null || primaryOutput == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("primaryOutput", new NBTTagCompound());
if (secondaryOutput != null) {
toSend.setTag("secondaryOutput", new NBTTagCompound());
}
input.writeToNBT(toSend.getCompoundTag("input"));
primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
if (secondaryOutput != null) {
secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
toSend.setInteger("secondaryChance", secondaryChance);
}
FMLInterModComms.sendMessage("ThermalExpansion", "SawmillRecipe", toSend);
}
ThermalExpansionHelper.java 文件源码
项目:Augury
阅读 15
收藏 0
点赞 0
评论 0
public static void addCrucibleRecipe(int energy, ItemStack input, FluidStack output) {
if (input == null || output == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("output", new NBTTagCompound());
input.writeToNBT(toSend.getCompoundTag("input"));
output.writeToNBT(toSend.getCompoundTag("output"));
FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend);
}
ThermalExpansionHelper.java 文件源码
项目:Augury
阅读 19
收藏 0
点赞 0
评论 0
public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid, boolean reversible) {
if (input == null || output == null || fluid == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("output", new NBTTagCompound());
toSend.setTag("fluid", new NBTTagCompound());
input.writeToNBT(toSend.getCompoundTag("input"));
output.writeToNBT(toSend.getCompoundTag("output"));
toSend.setBoolean("reversible", reversible);
fluid.writeToNBT(toSend.getCompoundTag("fluid"));
FMLInterModComms.sendMessage("ThermalExpansion", "TransposerFillRecipe", toSend);
}
ThermalExpansionHelper.java 文件源码
项目:Augury
阅读 17
收藏 0
点赞 0
评论 0
public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid, int chance, boolean reversible) {
if (input == null || output == null || fluid == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("output", new NBTTagCompound());
toSend.setTag("fluid", new NBTTagCompound());
input.writeToNBT(toSend.getCompoundTag("input"));
output.writeToNBT(toSend.getCompoundTag("output"));
toSend.setBoolean("reversible", reversible);
toSend.setInteger("chance", chance);
fluid.writeToNBT(toSend.getCompoundTag("fluid"));
FMLInterModComms.sendMessage("ThermalExpansion", "TransposerExtractRecipe", toSend);
}
EnderIOCompat.java 文件源码
项目:RFDrills
阅读 20
收藏 0
点赞 0
评论 0
public static void addAlloySmelterRecipe(String name, int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack tertiaryInput, ItemStack output) {
StringBuilder toSend = new StringBuilder();
toSend.append("<recipeGroup name=\"" + Reference.MOD_ID + "\">");
toSend.append("<recipe name=\"" + name + "\" energyCost=\"" + energy + "\">");
toSend.append("<input>");
writeItemStack(toSend, primaryInput);
writeItemStack(toSend, secondaryInput);
writeItemStack(toSend, tertiaryInput);
toSend.append("</input>");
toSend.append("<output>");
writeItemStack(toSend, output);
toSend.append("</output>");
toSend.append("</recipe>");
toSend.append("</recipeGroup>");
FMLInterModComms.sendMessage("EnderIO", "recipe:alloysmelter", toSend.toString());
}
ToggleBlocks.java 文件源码
项目:ToggleBlocks
阅读 20
收藏 0
点赞 0
评论 0
@Mod.EventHandler
public static void init(FMLInitializationEvent event)
{
if (Loader.isModLoaded("NotEnoughItems"))
{
try
{
System.out.println("Registering NEI comp.");
codechicken.nei.NEIModContainer.plugins.add(new NEIToggleConfig());
} catch (Exception ignored)
{
}
}
MinecraftForge.EVENT_BUS.register(new EventHandler());
proxy.registerRenderer();
FMLInterModComms.sendRuntimeMessage(ModInfo.MOD_ID, "VersionChecker", "addVersionCheck", "http://mrspring.dk/mods/tb/versions.json");
FMLInterModComms.sendMessage("tb", "register", "dk.mrspring.toggle.comp.vanilla.ToggleRegistryCallback.register");
FMLInterModComms.sendMessage("Waila", "register", "dk.mrspring.toggle.comp.waila.WailaCompatibility.callbackRegister");
Recipes.register();
}
MultipartMekanism.java 文件源码
项目:vsminecraft
阅读 22
收藏 0
点赞 0
评论 0
public void registerMicroMaterials()
{
for(int i = 0; i < 16; i++)
{
MicroMaterialRegistry.registerMaterial(new PlasticMicroMaterial(MekanismBlocks.PlasticBlock, i), BlockMicroMaterial.materialKey(MekanismBlocks.PlasticBlock, i));
MicroMaterialRegistry.registerMaterial(new PlasticMicroMaterial(MekanismBlocks.GlowPlasticBlock, i), BlockMicroMaterial.materialKey(MekanismBlocks.GlowPlasticBlock, i));
MicroMaterialRegistry.registerMaterial(new PlasticMicroMaterial(MekanismBlocks.SlickPlasticBlock, i), BlockMicroMaterial.materialKey(MekanismBlocks.SlickPlasticBlock, i));
MicroMaterialRegistry.registerMaterial(new PlasticMicroMaterial(MekanismBlocks.ReinforcedPlasticBlock, i), BlockMicroMaterial.materialKey(MekanismBlocks.ReinforcedPlasticBlock, i));
MicroMaterialRegistry.registerMaterial(new PlasticMicroMaterial(MekanismBlocks.RoadPlasticBlock, i), BlockMicroMaterial.materialKey(MekanismBlocks.RoadPlasticBlock, i));
FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.BasicBlock, 1, i));
if(!MachineType.get(MACHINE_BLOCK_1, i).hasModel)
{
FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.MachineBlock, 1, i));
}
if(!MachineType.get(MACHINE_BLOCK_2, i).hasModel)
{
FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.MachineBlock2, 1, i));
}
}
FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.BasicBlock2, 1, 0));
FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.CardboardBox));
}
ThermalExpansionHelper.java 文件源码
项目:PlayerInterfaceMod
阅读 19
收藏 0
点赞 0
评论 0
/**
* MACHINES
*/
/* Furnace */
public static void addFurnaceRecipe(int energy, ItemStack input, ItemStack output) {
if (input == null || output == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("output", new NBTTagCompound());
input.writeToNBT(toSend.getCompoundTag("input"));
output.writeToNBT(toSend.getCompoundTag("output"));
FMLInterModComms.sendMessage("ThermalExpansion", "FurnaceRecipe", toSend);
}
ThermalExpansionHelper.java 文件源码
项目:PlayerInterfaceMod
阅读 20
收藏 0
点赞 0
评论 0
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
if (input == null || primaryOutput == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("primaryOutput", new NBTTagCompound());
if (secondaryOutput != null) {
toSend.setTag("secondaryOutput", new NBTTagCompound());
}
input.writeToNBT(toSend.getCompoundTag("input"));
primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
if (secondaryOutput != null) {
secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
toSend.setInteger("secondaryChance", secondaryChance);
}
FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", toSend);
}
ThermalExpansionHelper.java 文件源码
项目:PlayerInterfaceMod
阅读 17
收藏 0
点赞 0
评论 0
public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
if (input == null || primaryOutput == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("primaryOutput", new NBTTagCompound());
if (secondaryOutput != null) {
toSend.setTag("secondaryOutput", new NBTTagCompound());
}
input.writeToNBT(toSend.getCompoundTag("input"));
primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
if (secondaryOutput != null) {
secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
toSend.setInteger("secondaryChance", secondaryChance);
}
FMLInterModComms.sendMessage("ThermalExpansion", "SawmillRecipe", toSend);
}
ThermalExpansionHelper.java 文件源码
项目:PlayerInterfaceMod
阅读 29
收藏 0
点赞 0
评论 0
public static void addCrucibleRecipe(int energy, ItemStack input, FluidStack output) {
if (input == null || output == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("output", new NBTTagCompound());
input.writeToNBT(toSend.getCompoundTag("input"));
output.writeToNBT(toSend.getCompoundTag("output"));
FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend);
}
ThermalExpansionHelper.java 文件源码
项目:PlayerInterfaceMod
阅读 16
收藏 0
点赞 0
评论 0
public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid, boolean reversible) {
if (input == null || output == null || fluid == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("output", new NBTTagCompound());
toSend.setTag("fluid", new NBTTagCompound());
input.writeToNBT(toSend.getCompoundTag("input"));
output.writeToNBT(toSend.getCompoundTag("output"));
toSend.setBoolean("reversible", reversible);
fluid.writeToNBT(toSend.getCompoundTag("fluid"));
FMLInterModComms.sendMessage("ThermalExpansion", "TransposerFillRecipe", toSend);
}
ThermalExpansionHelper.java 文件源码
项目:PlayerInterfaceMod
阅读 26
收藏 0
点赞 0
评论 0
public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid, int chance, boolean reversible) {
if (input == null || output == null || fluid == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("output", new NBTTagCompound());
toSend.setTag("fluid", new NBTTagCompound());
input.writeToNBT(toSend.getCompoundTag("input"));
output.writeToNBT(toSend.getCompoundTag("output"));
toSend.setBoolean("reversible", reversible);
toSend.setInteger("chance", chance);
fluid.writeToNBT(toSend.getCompoundTag("fluid"));
FMLInterModComms.sendMessage("ThermalExpansion", "TransposerExtractRecipe", toSend);
}
VersionChecker.java 文件源码
项目:WIIEMC
阅读 21
收藏 0
点赞 0
评论 0
private void sendMessage() {
if (Loader.isModLoaded("VersionChecker")) {
String changeLog = "";
for (String i : this.changeList)
changeLog += "- " + i;
NBTTagCompound tag = new NBTTagCompound();
tag.setString("modDisplayName", this.modname);
tag.setString("oldVersion", this.currentVer);
tag.setString("newVersion", this.version);
tag.setString("updateUrl", this.downloadURL);
tag.setBoolean("isDirectLink", this.isDirect);
tag.setString("changeLog", changeLog);
FMLInterModComms.sendMessage("VersionChecker", "addUpdate", tag);
}
Logger.logInfo(String.format(translate("update.wiiemc"), this.version, this.downloadURL));
}
Proxy.java 文件源码
项目:WIIEMC
阅读 27
收藏 0
点赞 0
评论 0
public void init() {
WIIEMC.config.initEvent();
Logger.logInfo("Beware the flower pots...they will confuse you and ambush you...");
if (Loader.isModLoaded("EE3")) {
FMLInterModComms.sendMessage("Waila", "register", "net.lomeli.wiiemc.providers.ee3.BlockEMCDataProvider.callbackRegister");
FMLInterModComms.sendMessage("Waila", "register", "net.lomeli.wiiemc.providers.ee3.EntityEMCDataProvider.callbackRegister");
FMLInterModComms.sendMessage("Waila", "register", "net.lomeli.wiiemc.providers.ee3.TileEMCDataProvider.callbackRegister");
MinecraftForge.EVENT_BUS.register(new EventHandler());
}
if (Loader.isModLoaded("ProjectE")) {
FMLInterModComms.sendMessage("Waila", "register", "net.lomeli.wiiemc.providers.projecte.BlockEMCDataProvider.callbackRegister");
FMLInterModComms.sendMessage("Waila", "register", "net.lomeli.wiiemc.providers.projecte.EntityEMCDataProvider.callbackRegister");
FMLInterModComms.sendMessage("Waila", "register", "net.lomeli.wiiemc.providers.projecte.TileEMCDataProvider.callbackRegister");
}
if (Loader.isModLoaded("simplecondenser"))
Logger.logInfo("Aww...I feel all special now...");
if (Loader.isModLoaded("EE3") && Loader.isModLoaded("ProjectE"))
Logger.logError("Greedy little fella, aren't ya?");
}
AMCore.java 文件源码
项目:AMCore
阅读 26
收藏 0
点赞 0
评论 0
@EventHandler
public void handleIMC(FMLInterModComms.IMCEvent event) {
// IMCHandler
try {
log.info("Processing IMC messages...");
IMCHandler.processIMC(event.getMessages());
log.info("IMC Messages processed.");
} catch (Exception e) {
log.error("=============================ERROR!=============================");
log.error("Failed to process IMC Messages, printing stacktrace...");
log.error("Please report this as a bug report with the stacktrace, the minecraft log and a mod list + version to: " + issueURL);
log.error("=============================ERROR!=============================");
e.printStackTrace();
}
}
AMCore.java 文件源码
项目:AMCore
阅读 27
收藏 0
点赞 0
评论 0
@EventHandler
public void loadComplete(FMLLoadCompleteEvent event) {
// Fetching runtime messages
try {
log.info("Fetching runtime IMC messages...");
IMCHandler.processIMC(FMLInterModComms.fetchRuntimeMessages(this));
log.info("Fetched runtime IMC messages.");
} catch (Exception e) {
log.error("=============================ERROR!=============================");
log.error("Failed to fetch IMC Runtime messages, printing stacktrace...");
log.error("Please report this as a bug report with the stacktrace, the minecraft log and a mod list + version to: " + issueURL);
log.error("=============================ERROR!=============================");
e.printStackTrace();
}
}
ThermalExpansionHelper.java 文件源码
项目:R0b0ts
阅读 24
收藏 0
点赞 0
评论 0
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setCompoundTag("input", new NBTTagCompound());
toSend.setCompoundTag("primaryOutput", new NBTTagCompound());
toSend.setCompoundTag("secondaryOutput", new NBTTagCompound());
input.writeToNBT(toSend.getCompoundTag("input"));
primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
toSend.setInteger("secondaryChance", secondaryChance);
FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", toSend);
}
ThermalExpansionHelper.java 文件源码
项目:Fluxed-Trinkets
阅读 19
收藏 0
点赞 0
评论 0
public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
if (input == null || primaryOutput == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("primaryOutput", new NBTTagCompound());
if (secondaryOutput != null) {
toSend.setTag("secondaryOutput", new NBTTagCompound());
}
input.writeToNBT(toSend.getCompoundTag("input"));
primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
if (secondaryOutput != null) {
secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
toSend.setInteger("secondaryChance", secondaryChance);
}
FMLInterModComms.sendMessage("ThermalExpansion", "SawmillRecipe", toSend);
}
ThermalExpansionHelper.java 文件源码
项目:R0b0ts
阅读 18
收藏 0
点赞 0
评论 0
public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid, int chance, boolean reversible) {
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setCompoundTag("input", new NBTTagCompound());
toSend.setCompoundTag("output", new NBTTagCompound());
toSend.setCompoundTag("fluid", new NBTTagCompound());
input.writeToNBT(toSend.getCompoundTag("input"));
output.writeToNBT(toSend.getCompoundTag("output"));
toSend.setBoolean("reversible", reversible);
toSend.setInteger("chance", chance);
fluid.writeToNBT(toSend.getCompoundTag("fluid"));
FMLInterModComms.sendMessage("ThermalExpansion", "TransposerExtractRecipe", toSend);
}
ModCartLivery.java 文件源码
项目:CartLivery
阅读 24
收藏 0
点赞 0
评论 0
@Mod.EventHandler
public void handleIMCMessage(FMLInterModComms.IMCEvent event) {
for (IMCMessage message : event.getMessages()) {
if ("addClassExclusion".equals(message.key) && message.isStringMessage()) {
try {
Class<?> clazz = Class.forName(message.getStringValue());
CommonProxy.excludedClasses.add(clazz);
} catch (ClassNotFoundException e) {
I18n.format("message.cartlivery.invalidExclusion", message.getSender(), message.getStringValue());
}
}
if ("addBuiltInLiveries".equals(message.key) && message.isStringMessage() && FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
String[] liveries = message.getStringValue().split(",");
log.info(I18n.format("message.cartlivery.registerBuiltIn", liveries.length, message.getSender()));
for(String livery : liveries) LiveryTextureRegistry.builtInLiveries.put(livery, message.getSender());
}
}
}
ThermalExpansionHelper.java 文件源码
项目:PeripheralsPlusPlus
阅读 20
收藏 0
点赞 0
评论 0
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
if (input == null || primaryOutput == null) {
return;
}
NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger("energy", energy);
toSend.setTag("input", new NBTTagCompound());
toSend.setTag("primaryOutput", new NBTTagCompound());
if (secondaryOutput != null) {
toSend.setTag("secondaryOutput", new NBTTagCompound());
}
input.writeToNBT(toSend.getCompoundTag("input"));
primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
if (secondaryOutput != null) {
secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
toSend.setInteger("secondaryChance", secondaryChance);
}
FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", toSend);
}