diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2020-01-13 19:02:58 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2020-01-13 19:02:58 +0000 |
commit | bc630f3a7738e4a495cdc1672949d934f76838e3 (patch) | |
tree | 263bc63824d8db4e0c2f6f333a1ce7c7adbe87ec /src/Java/gtPlusPlus/xmod/gregtech/loaders/misc | |
parent | 8a7e602c8cbd1a82cd967fab2989d06e59f99e7a (diff) | |
download | GT5-Unofficial-bc630f3a7738e4a495cdc1672949d934f76838e3.tar.gz GT5-Unofficial-bc630f3a7738e4a495cdc1672949d934f76838e3.tar.bz2 GT5-Unofficial-bc630f3a7738e4a495cdc1672949d934f76838e3.zip |
+ Added Hazmat protection to EMT, Gravisuit and Adv. Solar items. Closes #590.
+ Added a hard crash if materials are not found within GT.
+ Added a check for KekzTech and cached some mod checks.
+ Added pollution/s to Geothermal generators. Fixes #579.
$ Fixed Wither Cages being unbreakable. Fixes #587
$ Fixed centrifuging of logs to Methane. Fixes #595.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders/misc')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/WoodCentrifuging.java | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/WoodCentrifuging.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/WoodCentrifuging.java new file mode 100644 index 0000000000..2d7cd1b73b --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/WoodCentrifuging.java @@ -0,0 +1,85 @@ +package gtPlusPlus.xmod.gregtech.loaders.misc; + +import java.util.ArrayList; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class WoodCentrifuging { + + private static final ArrayList<ItemStack> aLogData; + private static final ArrayList<ItemStack> aRubberLogs; + private static final ArrayList<ItemStack> aRubberLogs2; + + static { + aLogData = OreDictionary.getOres("logWood"); + aRubberLogs = OreDictionary.getOres("logRubber"); + aRubberLogs2 = OreDictionary.getOres("woodRubber"); + } + + private static boolean isNormalLog(ItemStack aStack) { + if (aLogData.contains(aStack) & !isRubberLog(aStack)) { + return true; + } + return false; + } + + private static boolean isRubberLog(ItemStack aStack) { + if (aRubberLogs.contains(aStack)) { + return true; + } + else if (aRubberLogs2.contains(aStack)) { + return true; + } + return false; + } + + + private static boolean addCentrifugeRecipe(ItemStack aStack) { + if (isNormalLog(aStack)) { + return addNormalLogCentrifugeRecipe(aStack); + } + else if (isRubberLog(aStack)) { + return addRubberLogCentrifugeRecipe(aStack); + } + return false; + } + + private static boolean addNormalLogCentrifugeRecipe(ItemStack aStack) { + GT_Recipe aFoundRecipe = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.findRecipe(null, false, gregtech.api.enums.GT_Values.V[1], null, new ItemStack[]{aStack}); + if (aFoundRecipe == null && GT_Values.RA.addCentrifugeRecipe(GT_Utility.copyAmount(1L, aStack), null, null, Materials.Methane.getGas(60L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 200, 20)) { + Logger.INFO("Added methane extraction for "+ItemUtils.getItemName(aStack)); + return true; + } + return false; + } + private static boolean addRubberLogCentrifugeRecipe(ItemStack aStack) { + GT_Recipe aFoundRecipe = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.findRecipe(null, false, gregtech.api.enums.GT_Values.V[1], null, new ItemStack[]{aStack}); + if (aFoundRecipe == null && GT_Values.RA.addCentrifugeRecipe(GT_Utility.copyAmount(1L, aStack), null, null, Materials.Methane.getGas(60L), ItemList.IC2_Resin.get(1L, new Object[0]), GT_ModHandler.getIC2Item("plantBall", 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Carbon, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), null, null, new int[] { 5000, 3750, 2500, 2500 }, 200, 20)) { + Logger.INFO("Added rubber plant based methane extraction for "+ItemUtils.getItemName(aStack)); + return true; + } + return false; + } + + public static void processLogsForMethane() { + //Try use all woods found, fix/add methane extraction. + if (!aLogData.isEmpty()) { + Logger.INFO("Fixing Methane output of centrifuged logs."); + for (ItemStack stack : aLogData) { + addCentrifugeRecipe(stack); + } + } + } + +} |