Added ActuallyAdditions support

This commit is contained in:
Jared 2017-07-25 22:56:09 +02:00
parent 5ddc0bbde0
commit d4a9c12add
7 changed files with 408 additions and 0 deletions

View file

@ -42,6 +42,9 @@ repositories {
maven { maven {
url "http://www.ryanliptak.com/maven/" url "http://www.ryanliptak.com/maven/"
} }
maven {
url "https://maven.chaosfield.at/"
}
} }
dependencies { dependencies {
@ -49,6 +52,8 @@ dependencies {
deobfCompile "com.blamejared:MTLib:3.0.0.1" deobfCompile "com.blamejared:MTLib:3.0.0.1"
deobfCompile "cofh:ThermalExpansion:1.12-5.3.3.15:deobf" deobfCompile "cofh:ThermalExpansion:1.12-5.3.3.15:deobf"
deobfCompile "betterwithmods:BetterWithMods:1.12-1.3.7-14" deobfCompile "betterwithmods:BetterWithMods:1.12-1.3.7-14"
deobfCompile "de.ellpeck.actuallyadditions:ActuallyAdditions:1.12-r113"
} }
processResources { processResources {

View file

@ -0,0 +1,63 @@
package com.blamejared.compat.actuallyaddition;
import com.blamejared.ModTweaker;
import com.blamejared.api.annotations.*;
import com.blamejared.mtlib.helpers.*;
import com.blamejared.mtlib.utils.*;
import crafttweaker.api.item.IItemStack;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe;
import stanhebben.zenscript.annotations.*;
import java.util.*;
@ZenClass("mods.actuallyadditions.AtomicReconstructor")
@Handler("actuallyadditions")
public class AtomicReconstructor {
@ZenMethod
public static void addRecipe(IItemStack output, IItemStack input, int energyUsed) {
ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new LensConversionRecipe(InputHelper.toStack(input), InputHelper.toStack(output), energyUsed, ActuallyAdditionsAPI.lensDefaultConversion))));
}
@ZenMethod
public static void removeRecipe(IItemStack output) {
ModTweaker.LATE_ADDITIONS.add(new Remove(output));
}
private static class Add extends BaseListAddition<LensConversionRecipe> {
protected Add(List<LensConversionRecipe> recipies) {
super("Atomic Reconstructor", ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES, recipies);
}
@Override
protected String getRecipeInfo(LensConversionRecipe recipe) {
return LogHelper.getStackDescription(recipe.outputStack);
}
}
private static class Remove extends BaseListRemoval<LensConversionRecipe> {
private IItemStack output;
protected Remove(IItemStack output) {
super("Atomic Reconstructor", ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES);
this.output = output;
}
@Override
public void apply() {
ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES.stream().filter(recipe -> output.matches(InputHelper.toIItemStack(recipe.outputStack))).forEach(recipes::add);
super.apply();
}
@Override
protected String getRecipeInfo(LensConversionRecipe recipe) {
return LogHelper.getStackDescription(recipe.outputStack);
}
}
}

View file

@ -0,0 +1,65 @@
package com.blamejared.compat.actuallyaddition;
import com.blamejared.ModTweaker;
import com.blamejared.api.annotations.*;
import com.blamejared.mtlib.helpers.*;
import com.blamejared.mtlib.utils.*;
import crafttweaker.api.item.IItemStack;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.BallOfFurReturn;
import stanhebben.zenscript.annotations.*;
import java.util.*;
@ZenClass("mods.actuallyadditions.BallOfFur")
@Handler("actuallyadditions")
public class BallOfFur {
@ZenMethod
public static void addReturn(IItemStack output, int chance) {
ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new BallOfFurReturn(InputHelper.toStack(output), chance))));
}
@ZenMethod
public static void removeReturn(IItemStack output) {
ModTweaker.LATE_ADDITIONS.add(new Remove(output));
}
private static class Add extends BaseListAddition<BallOfFurReturn> {
protected Add(List<BallOfFurReturn> recipes) {
super("BallOfFur", ActuallyAdditionsAPI.BALL_OF_FUR_RETURN_ITEMS, recipes);
}
@Override
protected String getRecipeInfo(BallOfFurReturn recipe) {
return LogHelper.getStackDescription(recipe.returnItem);
}
}
private static class Remove extends BaseListRemoval<BallOfFurReturn> {
private IItemStack output;
public Remove(IItemStack output) {
super("BallOfFur", ActuallyAdditionsAPI.BALL_OF_FUR_RETURN_ITEMS);
this.output = output;
}
@Override
public void apply() {
for(BallOfFurReturn recipe : ActuallyAdditionsAPI.BALL_OF_FUR_RETURN_ITEMS) {
if(output.matches(InputHelper.toIItemStack(recipe.returnItem))) {
recipes.add(recipe);
}
}
super.apply();
}
@Override
protected String getRecipeInfo(BallOfFurReturn recipe) {
return LogHelper.getStackDescription(recipe.returnItem);
}
}
}

View file

@ -0,0 +1,72 @@
package com.blamejared.compat.actuallyaddition;
import com.blamejared.ModTweaker;
import com.blamejared.api.annotations.*;
import com.blamejared.mtlib.helpers.*;
import com.blamejared.mtlib.utils.*;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IItemStack;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.CompostRecipe;
import net.minecraft.block.Block;
import stanhebben.zenscript.annotations.*;
import java.util.*;
@ZenClass("mods.actuallyadditions.Compost")
@Handler("actuallyadditions")
public class Compost {
@ZenMethod
public static void addRecipe(IItemStack output, IItemStack outputDisplay, IItemStack input, IItemStack inputDisplay) {
if(!InputHelper.isABlock(outputDisplay) || !InputHelper.isABlock(inputDisplay)) {
CraftTweakerAPI.logError("outputDisplay or InputDisplay is not a block!");
return;
}
ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new CompostRecipe(InputHelper.toStack(input), Block.getBlockFromItem(InputHelper.toStack(inputDisplay).getItem()), InputHelper.toStack(output), Block.getBlockFromItem(InputHelper.toStack(outputDisplay).getItem())))));
}
@ZenMethod
public static void removeRecipe(IItemStack output) {
ModTweaker.LATE_REMOVALS.add(new Remove(output));
}
private static class Add extends BaseListAddition<CompostRecipe> {
protected Add(List<CompostRecipe> recipes) {
super("Compost", ActuallyAdditionsAPI.COMPOST_RECIPES, recipes);
}
@Override
public String getRecipeInfo(CompostRecipe recipe) {
return LogHelper.getStackDescription(recipe.output);
}
}
private static class Remove extends BaseListRemoval<CompostRecipe> {
private IItemStack output;
protected Remove(IItemStack output) {
super("Compost", ActuallyAdditionsAPI.COMPOST_RECIPES);
this.output = output;
}
@Override
public void apply() {
for(CompostRecipe recipe : ActuallyAdditionsAPI.COMPOST_RECIPES) {
System.out.println(output);
if(output.matches(InputHelper.toIItemStack(recipe.output))) {
recipes.add(recipe);
}
}
super.apply();
}
@Override
public String getRecipeInfo(CompostRecipe recipe) {
return LogHelper.getStackDescription(recipe.output);
}
}
}

View file

@ -0,0 +1,68 @@
package com.blamejared.compat.actuallyaddition;
import com.blamejared.ModTweaker;
import com.blamejared.api.annotations.*;
import com.blamejared.mtlib.helpers.*;
import com.blamejared.mtlib.utils.*;
import crafttweaker.api.item.IItemStack;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
import stanhebben.zenscript.annotations.Optional;
import stanhebben.zenscript.annotations.*;
import java.util.*;
@Handler("actuallyadditions")
@ZenClass("mods.actuallyadditions.Crusher")
public class Crusher {
@ZenMethod
public static void addRecipe(IItemStack output, IItemStack input, @Optional IItemStack outputSecondary, @Optional int outputSecondaryChance) {
ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new CrusherRecipe(InputHelper.toStack(input), InputHelper.toStack(output), InputHelper.toStack(outputSecondary), outputSecondaryChance))));
}
@ZenMethod
public static void removeRecipe(IItemStack output) {
ModTweaker.LATE_REMOVALS.add(new Remove(output));
}
private static class Add extends BaseListAddition<CrusherRecipe> {
protected Add(List<CrusherRecipe> recipes) {
super("Crusher", ActuallyAdditionsAPI.CRUSHER_RECIPES, recipes);
}
@Override
public String getRecipeInfo(CrusherRecipe recipe) {
return LogHelper.getStackDescription(recipe.inputStack);
}
}
private static class Remove extends BaseListRemoval<CrusherRecipe> {
private IItemStack output;
protected Remove(IItemStack output) {
super("Crusher", ActuallyAdditionsAPI.CRUSHER_RECIPES);
this.output = output;
}
@Override
public void apply() {
ActuallyAdditionsAPI.CRUSHER_RECIPES.forEach(recipe -> {
if(output.matches(InputHelper.toIItemStack(recipe.outputOneStack))) {
recipes.add(recipe);
}
});
super.apply();
}
@Override
public String getRecipeInfo(CrusherRecipe recipe) {
return LogHelper.getStackDescription(recipe.outputOneStack);
}
}
}

View file

@ -0,0 +1,71 @@
package com.blamejared.compat.actuallyaddition;
import com.blamejared.ModTweaker;
import com.blamejared.api.annotations.*;
import com.blamejared.mtlib.helpers.*;
import com.blamejared.mtlib.utils.*;
import crafttweaker.api.item.IItemStack;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe;
import stanhebben.zenscript.annotations.Optional;
import stanhebben.zenscript.annotations.*;
import java.util.*;
@ZenClass("mods.actuallyadditions.Empowerer")
@Handler("actuallyadditions")
public class Empowerer {
@ZenMethod
public static void addRecipe(IItemStack output, IItemStack input, IItemStack modifier1, IItemStack modifier2, IItemStack modifier3, IItemStack modifier4, int energyPerStand, int time, @Optional float[] particleColourArray) {
if(particleColourArray == null || particleColourArray.length == 0) {
particleColourArray = new float[]{0, 0, 0};
}
ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new EmpowererRecipe(InputHelper.toStack(input), InputHelper.toStack(output), InputHelper.toStack(modifier1), InputHelper.toStack(modifier2), InputHelper.toStack(modifier3), InputHelper.toStack(modifier4), energyPerStand, time, particleColourArray))));
}
@ZenMethod
public static void removeRecipe(IItemStack output) {
ModTweaker.LATE_REMOVALS.add(new Remove(output));
}
private static class Add extends BaseListAddition<EmpowererRecipe> {
protected Add(List<EmpowererRecipe> recipes) {
super("Empowerer", ActuallyAdditionsAPI.EMPOWERER_RECIPES, recipes);
}
@Override
protected String getRecipeInfo(EmpowererRecipe recipe) {
return LogHelper.getStackDescription(recipe.output);
}
}
public static class Remove extends BaseListRemoval<EmpowererRecipe> {
private IItemStack output;
protected Remove(IItemStack output) {
super("Empowerer", ActuallyAdditionsAPI.EMPOWERER_RECIPES);
this.output = output;
}
@Override
public void apply() {
for(EmpowererRecipe recipe : ActuallyAdditionsAPI.EMPOWERER_RECIPES) {
if(output.matches(InputHelper.toIItemStack(recipe.output))) {
recipes.add(recipe);
}
}
super.apply();
}
@Override
protected String getRecipeInfo(EmpowererRecipe recipe) {
return LogHelper.getStackDescription(recipe.output);
}
}
}

View file

@ -0,0 +1,64 @@
package com.blamejared.compat.actuallyaddition;
import com.blamejared.ModTweaker;
import com.blamejared.api.annotations.*;
import com.blamejared.mtlib.helpers.*;
import com.blamejared.mtlib.utils.*;
import crafttweaker.api.item.IItemStack;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.TreasureChestLoot;
import stanhebben.zenscript.annotations.*;
import java.util.*;
@ZenClass("mods.actuallyadditions.TreasureChest")
@Handler("actuallyadditions")
public class TreasureChest {
@ZenMethod
public static void addLoot(IItemStack returnItem, int chance, int minAmount, int maxAmount) {
ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new TreasureChestLoot(InputHelper.toStack(returnItem), chance, minAmount, maxAmount))));
}
@ZenMethod
public static void removeLoot(IItemStack returnItem) {
ModTweaker.LATE_REMOVALS.add(new Remove(returnItem));
}
private static class Add extends BaseListAddition<TreasureChestLoot> {
protected Add(List<TreasureChestLoot> recipes) {
super("Treasure Chest", ActuallyAdditionsAPI.TREASURE_CHEST_LOOT, recipes);
}
@Override
protected String getRecipeInfo(TreasureChestLoot recipe) {
return LogHelper.getStackDescription(recipe.returnItem);
}
}
private static class Remove extends BaseListRemoval<TreasureChestLoot> {
private IItemStack output;
protected Remove(IItemStack output) {
super("Treasure Chest", ActuallyAdditionsAPI.TREASURE_CHEST_LOOT);
this.output = output;
}
@Override
public void apply() {
ActuallyAdditionsAPI.TREASURE_CHEST_LOOT.forEach(recipe -> {
if(output.matches(InputHelper.toIItemStack(recipe.returnItem))) {
recipes.add(recipe);
}
});
super.apply();
}
@Override
protected String getRecipeInfo(TreasureChestLoot recipe) {
return LogHelper.getStackDescription(recipe.returnItem);
}
}
}