From 2f52d6e587f2a39d676c0f042fb93ca88be1f2c8 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 30 Dec 2019 00:42:09 +0000 Subject: % Adjusted Build Script, renamed some libs. (Soon to be available via Maven) $ Fixed Multis not working. --- .../interfaces/internal/IGregtech_RecipeAdder.java | 2 ++ .../base/GregtechMeta_MultiBlockBase.java | 8 ++++--- .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 26 ++++++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index 423073f546..83f052a983 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -281,5 +281,7 @@ public interface IGregtech_RecipeAdder { public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden); + public boolean addPulverisationRecipe(final ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, final ItemStack aOutput3); + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 03b8768240..3869adb7ab 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -101,6 +101,8 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult calculatePollutionReduction = GT_MetaTileEntity_Hatch_Muffler.class.getDeclaredMethod("calculatePollutionReduction", int.class); } catch (NoSuchMethodException | SecurityException e) {} + mCustomBehviours = new HashMap(); + } //Find Recipe Methods @@ -119,7 +121,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult public ArrayList mDischargeHatches = new ArrayList(); // Custom Behaviour Map - HashMap mCustomBehviours; + private static final HashMap mCustomBehviours; public GregtechMeta_MultiBlockBase(final int aID, final String aName, @@ -1022,8 +1024,8 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult */ // First populate the map if we need to. - if (mCustomBehviours.isEmpty()) { - mCustomBehviours = Multiblock_API.getSpecialBehaviourItemMap(); + if (mCustomBehviours == null || mCustomBehviours.isEmpty()) { + mCustomBehviours.putAll(Multiblock_API.getSpecialBehaviourItemMap()); } // We have a special slot object in the recipe diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 631796eb1f..efac0222af 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -7,10 +7,13 @@ import java.lang.reflect.Method; import java.util.List; import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.interfaces.internal.IGT_RecipeAdder; import gregtech.api.util.CustomRecipeMap; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; @@ -1278,6 +1281,29 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } } + @Override + public boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3) { + //return GT_Values.RA.addPulveriserRecipe(arg0, arg1, arg2, arg3, arg4) + + aOutput1 = GT_OreDictUnificator.get(true, aOutput1); + aOutput2 = GT_OreDictUnificator.get(true, aOutput2); + aOutput3 = GT_OreDictUnificator.get(true, aOutput3); + if ((GT_Utility.isStackInvalid(aInput)) || (GT_Utility.isStackInvalid(aOutput1))) { + return false; + } + if (GT_Utility.getContainerItem(aInput, false) == null) { + + if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.maceration, aInput, true)) { + GT_Utility.addSimpleIC2MachineRecipe(aInput, GT_ModHandler.getMaceratorRecipeList(), null, + new Object[] { aOutput1 }); + } + GT_Values.RA.addPulveriserRecipe(aInput, new ItemStack[] { aOutput1, aOutput2, aOutput3 }, + new int[] { 10000, 10000, 10000 }, 400, 2); + } + return true; + + } + -- cgit