Merge pull request #702 from TagnumElite/actadd-ingredient

Improve ActuallyAdditions support
This commit is contained in:
Jared 2019-01-29 03:15:12 +02:00 committed by GitHub
commit a1c0cccf46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 10 deletions

View file

@ -4,7 +4,9 @@ import com.blamejared.ModTweaker;
import com.blamejared.mtlib.helpers.*; import com.blamejared.mtlib.helpers.*;
import com.blamejared.mtlib.utils.*; import com.blamejared.mtlib.utils.*;
import crafttweaker.annotations.*; import crafttweaker.annotations.*;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack; import crafttweaker.api.item.IItemStack;
import crafttweaker.api.minecraft.CraftTweakerMC;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe; import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe;
import stanhebben.zenscript.annotations.*; import stanhebben.zenscript.annotations.*;
@ -17,8 +19,8 @@ import java.util.*;
public class AtomicReconstructor { public class AtomicReconstructor {
@ZenMethod @ZenMethod
public static void addRecipe(IItemStack output, IItemStack input, int energyUsed) { public static void addRecipe(IItemStack output, IIngredient input, int energyUsed) {
ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new LensConversionRecipe(InputHelper.toStack(input), InputHelper.toStack(output), energyUsed, ActuallyAdditionsAPI.lensDefaultConversion)))); ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new LensConversionRecipe(CraftTweakerMC.getIngredient(input), InputHelper.toStack(output), energyUsed, ActuallyAdditionsAPI.lensDefaultConversion))));
} }
@ZenMethod @ZenMethod

View file

@ -8,7 +8,9 @@ import com.blamejared.mtlib.utils.BaseListRemoval;
import crafttweaker.CraftTweakerAPI; import crafttweaker.CraftTweakerAPI;
import crafttweaker.annotations.ModOnly; import crafttweaker.annotations.ModOnly;
import crafttweaker.annotations.ZenRegister; import crafttweaker.annotations.ZenRegister;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack; import crafttweaker.api.item.IItemStack;
import crafttweaker.api.minecraft.CraftTweakerMC;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.CompostRecipe; import de.ellpeck.actuallyadditions.api.recipe.CompostRecipe;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -24,12 +26,12 @@ import java.util.List;
public class Compost { public class Compost {
@ZenMethod @ZenMethod
public static void addRecipe(IItemStack output, IItemStack outputDisplay, IItemStack input, IItemStack inputDisplay) { public static void addRecipe(IItemStack output, IItemStack outputDisplay, IIngredient input, IItemStack inputDisplay) {
if(!InputHelper.isABlock(outputDisplay) || !InputHelper.isABlock(inputDisplay)) { if(!InputHelper.isABlock(outputDisplay) || !InputHelper.isABlock(inputDisplay)) {
CraftTweakerAPI.logError("outputDisplay or InputDisplay is not a block!"); CraftTweakerAPI.logError("outputDisplay or InputDisplay is not a block!");
return; 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()))))); ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new CompostRecipe(CraftTweakerMC.getIngredient(input), Block.getBlockFromItem(InputHelper.toStack(inputDisplay).getItem()).getDefaultState(), InputHelper.toStack(output), Block.getBlockFromItem(InputHelper.toStack(outputDisplay).getItem()).getDefaultState()))));
} }
@ZenMethod @ZenMethod

View file

@ -4,7 +4,9 @@ import com.blamejared.ModTweaker;
import com.blamejared.mtlib.helpers.*; import com.blamejared.mtlib.helpers.*;
import com.blamejared.mtlib.utils.*; import com.blamejared.mtlib.utils.*;
import crafttweaker.annotations.*; import crafttweaker.annotations.*;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack; import crafttweaker.api.item.IItemStack;
import crafttweaker.api.minecraft.CraftTweakerMC;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
import stanhebben.zenscript.annotations.Optional; import stanhebben.zenscript.annotations.Optional;
@ -18,8 +20,8 @@ import java.util.*;
public class Crusher { public class Crusher {
@ZenMethod @ZenMethod
public static void addRecipe(IItemStack output, IItemStack input, @Optional IItemStack outputSecondary, @Optional int outputSecondaryChance) { public static void addRecipe(IItemStack output, IIngredient 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)))); ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new CrusherRecipe(CraftTweakerMC.getIngredient(input), InputHelper.toStack(output), InputHelper.toStack(outputSecondary), outputSecondaryChance))));
} }
@ZenMethod @ZenMethod

View file

@ -4,7 +4,9 @@ import com.blamejared.ModTweaker;
import com.blamejared.mtlib.helpers.*; import com.blamejared.mtlib.helpers.*;
import com.blamejared.mtlib.utils.*; import com.blamejared.mtlib.utils.*;
import crafttweaker.annotations.*; import crafttweaker.annotations.*;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack; import crafttweaker.api.item.IItemStack;
import crafttweaker.api.minecraft.CraftTweakerMC;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe; import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe;
import stanhebben.zenscript.annotations.Optional; import stanhebben.zenscript.annotations.Optional;
@ -18,11 +20,11 @@ import java.util.*;
public class Empowerer { public class Empowerer {
@ZenMethod @ZenMethod
public static void addRecipe(IItemStack output, IItemStack input, IItemStack modifier1, IItemStack modifier2, IItemStack modifier3, IItemStack modifier4, int energyPerStand, int time, @Optional float[] particleColourArray) { public static void addRecipe(IItemStack output, IIngredient input, IIngredient modifier1, IIngredient modifier2, IIngredient modifier3, IIngredient modifier4, int energyPerStand, int time, @Optional float[] particleColourArray) {
if(particleColourArray == null || particleColourArray.length == 0) { if(particleColourArray == null || particleColourArray.length == 0) {
particleColourArray = new float[]{0, 0, 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)))); ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new EmpowererRecipe(CraftTweakerMC.getIngredient(input), InputHelper.toStack(output), CraftTweakerMC.getIngredient(modifier1), CraftTweakerMC.getIngredient(modifier2), CraftTweakerMC.getIngredient(modifier3), CraftTweakerMC.getIngredient(modifier4), energyPerStand, time, particleColourArray))));
} }
@ZenMethod @ZenMethod

View file

@ -1,10 +1,8 @@
package com.blamejared.compat.actuallyaddition; package com.blamejared.compat.actuallyaddition;
import com.blamejared.ModTweaker; import com.blamejared.ModTweaker;
import com.blamejared.mtlib.helpers.*;
import com.blamejared.mtlib.utils.*; import com.blamejared.mtlib.utils.*;
import crafttweaker.annotations.*; import crafttweaker.annotations.*;
import crafttweaker.api.item.IItemStack;
import crafttweaker.api.liquid.ILiquidStack; import crafttweaker.api.liquid.ILiquidStack;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.*; import de.ellpeck.actuallyadditions.api.recipe.*;