From fb1dbb710e95bd0051b904085e601108ba1e291d Mon Sep 17 00:00:00 2001 From: Tagan Hoyle Date: Sat, 22 Dec 2018 17:23:19 +0200 Subject: [PATCH 1/2] Add Ore Dictionary support for the empowerer --- .../com/blamejared/compat/actuallyaddition/Empowerer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/blamejared/compat/actuallyaddition/Empowerer.java b/src/main/java/com/blamejared/compat/actuallyaddition/Empowerer.java index dece651..e698b93 100644 --- a/src/main/java/com/blamejared/compat/actuallyaddition/Empowerer.java +++ b/src/main/java/com/blamejared/compat/actuallyaddition/Empowerer.java @@ -4,7 +4,9 @@ import com.blamejared.ModTweaker; import com.blamejared.mtlib.helpers.*; import com.blamejared.mtlib.utils.*; import crafttweaker.annotations.*; +import crafttweaker.api.item.IIngredient; import crafttweaker.api.item.IItemStack; +import crafttweaker.api.minecraft.CraftTweakerMC; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe; import stanhebben.zenscript.annotations.Optional; @@ -18,11 +20,11 @@ import java.util.*; 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) { + 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) { 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 From db33216405c82f12096b40fb7273c2fc47c33584 Mon Sep 17 00:00:00 2001 From: Tagan Hoyle Date: Sat, 22 Dec 2018 17:40:25 +0200 Subject: [PATCH 2/2] Add more oredict support Add oredict support for - AtomicReconstructor - Compost - Crusher Remove unused imports in OilGen --- .../compat/actuallyaddition/AtomicReconstructor.java | 6 ++++-- .../com/blamejared/compat/actuallyaddition/Compost.java | 6 ++++-- .../com/blamejared/compat/actuallyaddition/Crusher.java | 6 ++++-- .../java/com/blamejared/compat/actuallyaddition/OilGen.java | 2 -- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/blamejared/compat/actuallyaddition/AtomicReconstructor.java b/src/main/java/com/blamejared/compat/actuallyaddition/AtomicReconstructor.java index ca68bb3..94cd7a3 100644 --- a/src/main/java/com/blamejared/compat/actuallyaddition/AtomicReconstructor.java +++ b/src/main/java/com/blamejared/compat/actuallyaddition/AtomicReconstructor.java @@ -4,7 +4,9 @@ import com.blamejared.ModTweaker; import com.blamejared.mtlib.helpers.*; import com.blamejared.mtlib.utils.*; import crafttweaker.annotations.*; +import crafttweaker.api.item.IIngredient; import crafttweaker.api.item.IItemStack; +import crafttweaker.api.minecraft.CraftTweakerMC; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe; import stanhebben.zenscript.annotations.*; @@ -17,8 +19,8 @@ import java.util.*; 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)))); + public static void addRecipe(IItemStack output, IIngredient input, int energyUsed) { + ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new LensConversionRecipe(CraftTweakerMC.getIngredient(input), InputHelper.toStack(output), energyUsed, ActuallyAdditionsAPI.lensDefaultConversion)))); } @ZenMethod diff --git a/src/main/java/com/blamejared/compat/actuallyaddition/Compost.java b/src/main/java/com/blamejared/compat/actuallyaddition/Compost.java index 849c411..447acf3 100644 --- a/src/main/java/com/blamejared/compat/actuallyaddition/Compost.java +++ b/src/main/java/com/blamejared/compat/actuallyaddition/Compost.java @@ -8,7 +8,9 @@ import com.blamejared.mtlib.utils.BaseListRemoval; import crafttweaker.CraftTweakerAPI; import crafttweaker.annotations.ModOnly; import crafttweaker.annotations.ZenRegister; +import crafttweaker.api.item.IIngredient; import crafttweaker.api.item.IItemStack; +import crafttweaker.api.minecraft.CraftTweakerMC; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.recipe.CompostRecipe; import net.minecraft.block.Block; @@ -24,12 +26,12 @@ import java.util.List; public class Compost { @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)) { 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()))))); + 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 diff --git a/src/main/java/com/blamejared/compat/actuallyaddition/Crusher.java b/src/main/java/com/blamejared/compat/actuallyaddition/Crusher.java index fd2f901..c3999b6 100644 --- a/src/main/java/com/blamejared/compat/actuallyaddition/Crusher.java +++ b/src/main/java/com/blamejared/compat/actuallyaddition/Crusher.java @@ -4,7 +4,9 @@ import com.blamejared.ModTweaker; import com.blamejared.mtlib.helpers.*; import com.blamejared.mtlib.utils.*; import crafttweaker.annotations.*; +import crafttweaker.api.item.IIngredient; import crafttweaker.api.item.IItemStack; +import crafttweaker.api.minecraft.CraftTweakerMC; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; import stanhebben.zenscript.annotations.Optional; @@ -18,8 +20,8 @@ import java.util.*; 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)))); + public static void addRecipe(IItemStack output, IIngredient input, @Optional IItemStack outputSecondary, @Optional int outputSecondaryChance) { + ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new CrusherRecipe(CraftTweakerMC.getIngredient(input), InputHelper.toStack(output), InputHelper.toStack(outputSecondary), outputSecondaryChance)))); } @ZenMethod diff --git a/src/main/java/com/blamejared/compat/actuallyaddition/OilGen.java b/src/main/java/com/blamejared/compat/actuallyaddition/OilGen.java index 98bdb88..b30607f 100644 --- a/src/main/java/com/blamejared/compat/actuallyaddition/OilGen.java +++ b/src/main/java/com/blamejared/compat/actuallyaddition/OilGen.java @@ -1,10 +1,8 @@ package com.blamejared.compat.actuallyaddition; import com.blamejared.ModTweaker; -import com.blamejared.mtlib.helpers.*; import com.blamejared.mtlib.utils.*; import crafttweaker.annotations.*; -import crafttweaker.api.item.IItemStack; import crafttweaker.api.liquid.ILiquidStack; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.recipe.*;