diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-03-08 03:14:13 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-03-08 03:14:13 +0000 |
commit | 064c0dc0cfab1cc677dfffc4b3b56642017e412b (patch) | |
tree | 4ca26291abe64632a63bc0d72a510079a1766d7f /src/Java/gregtech | |
parent | 5ec18de508e12da48c68ef679f6b8646f12cb0c2 (diff) | |
download | GT5-Unofficial-064c0dc0cfab1cc677dfffc4b3b56642017e412b.tar.gz GT5-Unofficial-064c0dc0cfab1cc677dfffc4b3b56642017e412b.tar.bz2 GT5-Unofficial-064c0dc0cfab1cc677dfffc4b3b56642017e412b.zip |
+ Added some AgriChem. (You can now use Raw waste as a fuel source)
+ Added OreDict names to vanilla items, as was done in Forge 1.8.9.
+ Added functions to allow other mods to add Semifluid Fuels.
+ Added functions to handle String data into StringUtils.java.
% Renamed getItemStack -> getItemStackFromFQRN.
$ Fixed handling of custom cells for fluids using '.' within their names.
$ Fixed HF exploit.
Diffstat (limited to 'src/Java/gregtech')
-rw-r--r-- | src/Java/gregtech/api/util/SemiFluidFuelHandler.java | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/src/Java/gregtech/api/util/SemiFluidFuelHandler.java b/src/Java/gregtech/api/util/SemiFluidFuelHandler.java index f1c56c4e95..1414b3beb3 100644 --- a/src/Java/gregtech/api/util/SemiFluidFuelHandler.java +++ b/src/Java/gregtech/api/util/SemiFluidFuelHandler.java @@ -13,12 +13,58 @@ import net.minecraftforge.fluids.FluidStack; public class SemiFluidFuelHandler { + + public static boolean addSemiFluidFuel(ItemStack aFuelItem, int aFuelValue) { + FluidStack p = FluidContainerRegistry.getFluidForFilledItem(aFuelItem); + if (p != null && aFuelValue > 0) { + return addSemiFluidFuel(p, aFuelValue); + } else { + Logger.INFO("Fuel value for " + aFuelItem.getDisplayName() + " is <= 0, ignoring."); + } + return false; + } + + + public static boolean addSemiFluidFuel(FluidStack aFuel, int aFuelValue) { + FluidStack p = aFuel; + if (p != null && aFuelValue > 0) { + GT_Recipe aRecipe = + new Recipe_GT(true, + new ItemStack[] {}, + new ItemStack[] {}, + null, + new int[] {}, + new FluidStack[] { p }, + null, + 0, + 0, + aFuelValue); + if (aRecipe.mSpecialValue > 0) { + Logger.INFO("Added " + aRecipe.mFluidInputs[0].getLocalizedName() + " to the Semi-Fluid Generator fuel map. Fuel Produces "+(aRecipe.mSpecialValue*1000)+"EU per 1000L."); + sSemiFluidLiquidFuels.add(aRecipe); + return true; + } + } else { + Logger.INFO("Fuel value for " + p != null ? p.getLocalizedName() : "NULL Fluid" + " is <= 0, ignoring."); + } + return false; + } + + + + + + public static boolean generateFuels() { final FluidStack aCreosote = FluidUtils.getFluidStack("creosote", 1000); final FluidStack aHeavyFuel = FluidUtils.getFluidStack("liquid_heavy_fuel", 1000); final HashMap<Integer, Pair<FluidStack, Integer>> aFoundFluidsFromItems = new HashMap<Integer, Pair<FluidStack, Integer>>(); // Find Fluids From items - for (GT_Recipe g : gregtech.api.util.GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels.mRecipeList) { + for (final GT_Recipe r : gregtech.api.util.GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels.mRecipeList) { + + GT_Recipe g = r.copy(); + + if (g != null && g.mEnabled && g.mInputs.length > 0 && g.mInputs[0] != null) { for (ItemStack i : g.mInputs) { FluidStack f = FluidContainerRegistry.getFluidForFilledItem(i); |