Reconstructor IMC

This commit is contained in:
Ellpeck 2015-11-23 19:30:21 +01:00
parent f1b54529e6
commit 88d6c18708
2 changed files with 27 additions and 0 deletions

View file

@ -40,3 +40,11 @@ The two Brackets will have to get replaced with one of the parts of Information
- To the Compound, add an int with the name "minAmount" that contains the minimum size of the ItemStack - To the Compound, add an int with the name "minAmount" that contains the minimum size of the ItemStack
- To the Compound, add an int with the name "maxAmount" that contains the maximum size of the ItemStack - To the Compound, add an int with the name "maxAmount" that contains the maximum size of the ItemStack
- Send the Message with "registerTreasureChestRecipe" as the [X] Argument, the Compound as the [Y] Argument. - Send the Message with "registerTreasureChestRecipe" as the [X] Argument, the Compound as the [Y] Argument.
##### Reconstructor Recipes
- Create an NBTTagCompound
- To the Compound, add a String with the name "input" that is the Input's OreDictionary Name
- To the Compound, add a String with the name "output" that is the Output's OreDictionary Name
- To the Compound, add an int with the name "energyUse" that is the amount of RF used
- To the Compound, add an int with the name "lensType" that contains the LensType's ID (found in LensType in ReconstructorRecipeHandler, the ID is the ordinal)
- Send the Message with "registerReconstructorRecipe" as the [X] Argument, the Compound as the [Y] Argument.

View file

@ -14,6 +14,7 @@ import cpw.mods.fml.common.event.FMLInterModComms;
import ellpeck.actuallyadditions.items.ItemCoffee; import ellpeck.actuallyadditions.items.ItemCoffee;
import ellpeck.actuallyadditions.recipe.CrusherRecipeRegistry; import ellpeck.actuallyadditions.recipe.CrusherRecipeRegistry;
import ellpeck.actuallyadditions.recipe.HairyBallHandler; import ellpeck.actuallyadditions.recipe.HairyBallHandler;
import ellpeck.actuallyadditions.recipe.ReconstructorRecipeHandler;
import ellpeck.actuallyadditions.recipe.TreasureChestHandler; import ellpeck.actuallyadditions.recipe.TreasureChestHandler;
import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -100,6 +101,24 @@ public class InterModCommunications{
} }
} }
} }
if(message.key.equalsIgnoreCase("registerReconstructorRecipe")){
NBTTagCompound compound = message.getNBTValue();
if(compound != null){
String input = compound.getString("input");
String output = compound.getString("output");
int energyUse = compound.getInteger("energyUse");
int lensType = compound.getInteger("lensType");
if(ReconstructorRecipeHandler.LensType.values().length > lensType && input != null && output != null){
ReconstructorRecipeHandler.addRecipe(input, output, energyUse, ReconstructorRecipeHandler.LensType.values()[lensType]);
ModUtil.LOGGER.info("Reconstructor Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+input+" -> "+output+" @ "+energyUse+" with LensType "+lensType);
}
else{
ModUtil.LOGGER.error("Reconstructor Recipe that was sent from Mod "+message.getSender()+" could not be registered: It's missing an Output, an Input or a LensType!");
}
}
}
} }
} }