mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Fixed intermodcomms
This commit is contained in:
parent
df551d5518
commit
0d9ab3bc0f
2 changed files with 15 additions and 11 deletions
|
@ -10,9 +10,11 @@ The two Brackets will have to get replaced with one of the parts of Information
|
||||||
|
|
||||||
##### Crusher Recipes
|
##### Crusher Recipes
|
||||||
- Create an NBTTagCompound
|
- Create an NBTTagCompound
|
||||||
- To the Compound, add an NBTTagCompound with the name "input" that contains the Input ItemStack saved to NBT (To do this, just use ItemStack.writeToNBT)
|
- To the Compound, add a String with the name "input" that contains the Input Oredict Name
|
||||||
- To the Compound, add an NBTTagCompound with the name "outputOne" that contains the first Output saved to NBT
|
- To the Compound, add a String with the name "outputOne" that contains the first Output Oredict Name
|
||||||
- To the Compound, add an NBTTagCompound with the name "outputTwo" that contains the second Output saved to NBT
|
- To the Compound, add an int with the name "outputOneAmount" the contains the first Output's amount
|
||||||
|
- To the Compound, add a String with the name "outputTwo" that contains the second Output Oredict Name
|
||||||
|
- To the Compound, add an int with the name "outputTwoAmount" the contains the second Output's amount
|
||||||
- To the Compound, add an int with the name "secondChance" that contains the Chance for the second Output to appear
|
- To the Compound, add an int with the name "secondChance" that contains the Chance for the second Output to appear
|
||||||
- Send the Message with "registerCrusherRecipe" as the [X] Argument, the Compound as the [Y] Argument.
|
- Send the Message with "registerCrusherRecipe" as the [X] Argument, the Compound as the [Y] Argument.
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ package ellpeck.actuallyadditions.communication;
|
||||||
|
|
||||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
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.HairyBallHandler;
|
import ellpeck.actuallyadditions.recipe.HairyBallHandler;
|
||||||
import ellpeck.actuallyadditions.recipe.TreasureChestHandler;
|
import ellpeck.actuallyadditions.recipe.TreasureChestHandler;
|
||||||
import ellpeck.actuallyadditions.util.ModUtil;
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
|
@ -26,24 +27,25 @@ public class InterModCommunications{
|
||||||
|
|
||||||
public static void processIMC(List<FMLInterModComms.IMCMessage> messages){
|
public static void processIMC(List<FMLInterModComms.IMCMessage> messages){
|
||||||
for(FMLInterModComms.IMCMessage message : messages){
|
for(FMLInterModComms.IMCMessage message : messages){
|
||||||
//TODO This
|
if(message.key.equalsIgnoreCase("registerCrusherRecipe")){
|
||||||
/*if(message.key.equalsIgnoreCase("registerCrusherRecipe")){
|
|
||||||
NBTTagCompound compound = message.getNBTValue();
|
NBTTagCompound compound = message.getNBTValue();
|
||||||
if(compound != null){
|
if(compound != null){
|
||||||
ItemStack input = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("input"));
|
String input = compound.getString("input");
|
||||||
ItemStack outputOne = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("outputOne"));
|
String outputOne = compound.getString("outputOne");
|
||||||
ItemStack outputTwo = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("outputTwo"));
|
int outputOneAmount = compound.getInteger("outputOneAmount");
|
||||||
|
String outputTwo = compound.getString("outputTwo");
|
||||||
|
int outputTwoAmount = compound.getInteger("outputTwoAmount");
|
||||||
int secondChance = compound.getInteger("secondChance");
|
int secondChance = compound.getInteger("secondChance");
|
||||||
|
|
||||||
if(input != null && outputOne != null){
|
if(input != null && outputOne != null){
|
||||||
CrusherRecipeManualRegistry.registerRecipe(input, outputOne, outputTwo, secondChance);
|
CrusherRecipeRegistry.addRecipe(input, outputOne, outputOneAmount, outputTwo, outputTwoAmount, secondChance);
|
||||||
ModUtil.LOGGER.info("Crusher Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+input.toString()+" -> "+outputOne.toString()+(outputTwo != null ? " + "+outputTwo.toString()+", Second Chance: "+secondChance : ""));
|
ModUtil.LOGGER.info("Crusher Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+input+" -> "+outputOne+(outputTwo != null && !outputTwo.isEmpty() ? " + "+outputTwo+", Second Chance: "+secondChance : ""));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
ModUtil.LOGGER.error("Crusher Recipe that was sent from Mod "+message.getSender()+" could not be registered: It's missing an Input or an Output!");
|
ModUtil.LOGGER.error("Crusher Recipe that was sent from Mod "+message.getSender()+" could not be registered: It's missing an Input or an Output!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
if(message.key.equalsIgnoreCase("registerCoffeeMachineRecipe")){
|
if(message.key.equalsIgnoreCase("registerCoffeeMachineRecipe")){
|
||||||
NBTTagCompound compound = message.getNBTValue();
|
NBTTagCompound compound = message.getNBTValue();
|
||||||
|
|
Loading…
Reference in a new issue