diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-06 17:24:25 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-06 17:24:25 +0000 |
commit | 0941607a38160b0bced1652b91f38cd55480261d (patch) | |
tree | a2f908c3862bbf88e952af684983ecc7b1305bc1 /src/Java/gtPlusPlus/core | |
parent | 7f35f5cf2684d056e5cce278e555d685e20a5821 (diff) | |
download | GT5-Unofficial-0941607a38160b0bced1652b91f38cd55480261d.tar.gz GT5-Unofficial-0941607a38160b0bced1652b91f38cd55480261d.tar.bz2 GT5-Unofficial-0941607a38160b0bced1652b91f38cd55480261d.zip |
Greatly improved NEI handling.
Fixed broken Manure Slurry recipes.
Diffstat (limited to 'src/Java/gtPlusPlus/core')
7 files changed, 175 insertions, 15 deletions
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 4957a2b571..e66206a6bc 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -241,6 +241,7 @@ public final class ModItems { public static Fluid fluidLftrBlanket1; public static Fluid fluidLftrBlanket2; public static Fluid fluidLftrBlanket3; + public static Fluid fluidNuclearWaste; //Possibly missing base items that GT may be missing. @@ -728,14 +729,15 @@ public final class ModItems { fluidFLiBeSaltBurnt = FluidUtils.addGTFluidNoPrefix("Li2BeF2UF4", "Li2BeF2UF4", new short[]{50, 255, 50, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); // LFTR Core Fluid Processing - fluidLftrCore1 = FluidUtils.addGTFluidNoPrefix("LiBeF2UF4FP", "LiBeF2UF4FP", new short[]{110, 255, 110, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); - fluidLftrCore2 = FluidUtils.addGTFluidNoPrefix("UF6F2FP", "UF6F2FP", new short[]{150, 255, 150, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); - fluidLftrCore3 = FluidUtils.addGTFluidNoPrefix("LiFBeF2", "LiFBeF2", new short[]{100, 255, 50, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); - fluidLftrCore4 = FluidUtils.addGTFluidNoPrefix("LiFBeF2UF4", "LiFBeF2UF4", new short[]{50, 255, 100, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + //fluidLftrCore1 = FluidUtils.addGTFluidNoPrefix("LiBeF2UF4FP", "LiBeF2UF4FP", new short[]{110, 255, 110, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + //fluidLftrCore2 = FluidUtils.addGTFluidNoPrefix("UF6F2FP", "UF6F2FP", new short[]{150, 255, 150, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + //fluidLftrCore3 = FluidUtils.addGTFluidNoPrefix("LiFBeF2", "LiFBeF2", new short[]{100, 255, 50, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + //fluidLftrCore4 = FluidUtils.addGTFluidNoPrefix("LiFBeF2UF4", "LiFBeF2UF4", new short[]{50, 255, 100, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); // LFTR Blanket Fluid Processing - fluidLftrBlanket1 = FluidUtils.addGTFluidNoPrefix("LiFThF4", "LiFThF4", new short[]{50, 150, 255, 50}, 0, 500, null, CI.emptyCells(1), 1000, true); - fluidLftrBlanket2 = FluidUtils.addGTFluidNoPrefix("LiFBeF2ThF4", "LiFBeF2ThF4", new short[]{100, 150, 100, 100}, 0, 500, null, CI.emptyCells(1), 1000, true); - fluidLftrBlanket3 = FluidUtils.addGTFluidNoPrefix("UF6F2", "UF6F2", new short[]{10, 150, 10, 100}, 0, 500, null, CI.emptyCells(1), 1000, true); + //fluidLftrBlanket1 = FluidUtils.addGTFluidNoPrefix("LiFThF4", "LiFThF4", new short[]{50, 150, 255, 50}, 0, 500, null, CI.emptyCells(1), 1000, true); + //fluidLftrBlanket2 = FluidUtils.addGTFluidNoPrefix("LiFBeF2ThF4", "LiFBeF2ThF4", new short[]{100, 150, 100, 100}, 0, 500, null, CI.emptyCells(1), 1000, true); + //fluidLftrBlanket3 = FluidUtils.addGTFluidNoPrefix("UF6F2", "UF6F2", new short[]{10, 150, 10, 100}, 0, 500, null, CI.emptyCells(1), 1000, true); + fluidNuclearWaste = FluidUtils.addGTFluidNoPrefix("nuclear.waste", "Nuclear Waste", new short[]{10, 250, 10, 100}, 0, 1000, null, CI.emptyCells(1), 1000, true); //LFTR Control Circuit diff --git a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java index e11b163753..8e7a760195 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java @@ -296,7 +296,7 @@ public class AgriculturalChem extends ItemPackage { } if (aTiCon) { - aBlood = FluidUtils.getFluidStack("hell_blood", 100); + aBlood = FluidUtils.getFluidStack("blood", 100); if (aBlood != null) { Logger.INFO("Found Tinker's Construct, enabled Blood support."); CustomBlood = aBlood.getFluid(); @@ -435,7 +435,7 @@ public class AgriculturalChem extends ItemPackage { ItemStack aBone; ItemStack aMeat; ItemStack aEmptyCells = CI.emptyCells(2); - ItemStack aInputCells = ItemUtils.getItemStackOfAmountFromOreDict("cellRawWaste", 2); + ItemStack aInputCells = ItemUtils.getItemStackOfAmountFromOreDict("cellRawAnimalWaste", 2); FluidStack aOutput = FluidUtils.getFluidStack(FertileManureSlurry, 1000); for (FluidStack aBloodStack : mBloodFluids) { diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 81c16efa2c..b8e006b021 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -744,12 +744,24 @@ public class Material { Materials Erf = MaterialUtils.getMaterial(this.unlocalizedName); if (Erf != null && Erf != Materials._NULL) { ItemStack Erg = ItemUtils.getOrePrefixStack(aPrefix, Erf, stacksize); - if (Erg != null) { + if (Erg != null && ItemUtils.checkForInvalidItems(Erg)) { Logger.MATERIALS("Found \"" + aKey + this.unlocalizedName + "\" using backup GT Materials option."); g.put(aKey, Erg); mComponentMap.put(unlocalizedName, g); return Erg; } + else { + // Try get a molten cell + if (aPrefix == OrePrefixes.cell) { + Erg = ItemUtils.getOrePrefixStack(OrePrefixes.cellMolten, Erf, stacksize); + if (Erg != null && ItemUtils.checkForInvalidItems(Erg)) { + Logger.MATERIALS("Found \"" + OrePrefixes.cellMolten.name() + this.unlocalizedName + "\" using backup GT Materials option."); + g.put(aKey, Erg); + mComponentMap.put(unlocalizedName, g); + return Erg; + } + } + } } else { ItemStack u = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(aKey + this.unlocalizedName, stacksize); if (u != null) { diff --git a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java index 73751ac49d..9e59758f73 100644 --- a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java +++ b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java @@ -69,6 +69,135 @@ public final class NUCLIDE { new MaterialStack(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE, 6), new MaterialStack(ELEMENT.getInstance().URANIUM235, 14) }); + + + // LFTR Core Fluids + public static final Material LiBeF2UF4FP = new Material( + "LiBeF2UF4FP", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().LITHIUM, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1) + }); + + public static final Material UF6F2FP = new Material( + "UF6F2FP", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.URANIUM_HEXAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().FLUORINE, 3), + new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1) + }); + + public static final Material LiFBeF2 = new Material( + "LiFBeF2", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1) + }); + + public static final Material LiFBeF2UF4 = new Material( + "LiFBeF2UF4", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(LiFBeF2, 1), + new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1) + }); + + + + + + + // LFTR Blanket Fluids + + public static final Material LiFThF4 = new Material( + "LiFThF4", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1) + }); + + public static final Material LiFBeF2ThF4 = new Material( + "LiFBeF2ThF4", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1) + }); + + public static final Material UF6F2 = new Material( + "UF6F2", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.URANIUM_HEXAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().FLUORINE, 2) + }); + + + + + + + + + + + // Secondary material is molten metal public static final Material NAQ_FUEL_T1 = new Material( diff --git a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java index 4b9cda0b9b..1029d37a78 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java +++ b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java @@ -1,7 +1,7 @@ package gtPlusPlus.core.slots; -import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GT_Recipe; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -22,7 +22,7 @@ public class SlotChemicalPlantInput extends Slot { public static boolean isItemValidForChemicalPlantSlot(ItemStack aStack) { boolean validItem = GTPP_Recipe_Map.sChemicalPlantRecipes.containsInput(aStack); if (!validItem) { - for (GTPP_Recipe f : GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { + for (GT_Recipe f : GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { if (f.mFluidInputs.length > 0) { for (FluidStack g : f.mFluidInputs) { if (g != null) { diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java index 2f4db2efcc..7573e0d51c 100644 --- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java +++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.util.math; +import java.text.NumberFormat; import java.util.Map; import java.util.Random; @@ -15,6 +16,13 @@ public class MathUtils { final static Random rand = CORE.RANDOM; + /** Formats a number with group separator and at most 2 fraction digits. */ + private static final NumberFormat sNumberFormat = NumberFormat.getInstance(); + + static { + sNumberFormat.setMaximumFractionDigits(2); + } + /** * Returns a psuedo-random number between min and max, inclusive. * The difference between min and max can be at most @@ -766,6 +774,14 @@ public class MathUtils { public static Number max(Number a, Number b) { return (a.longValue() >= b.longValue()) ? a : b; } + + public static String formatNumbers(long aNumber) { + return sNumberFormat.format(aNumber); + } + + public static String formatNumbers(double aNumber) { + return sNumberFormat.format(aNumber); + } } diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java index 1e282fb849..6330efd694 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -913,10 +913,11 @@ public class ItemUtils { } public static ItemStack getErrorStack(int mAmount, String aName) { - ItemStack g = getSimpleStack(ModItems.AAA_Broken, 1); - NBTUtils.setString(g, "Lore", EnumChatFormatting.RED+aName); + ItemStack g = getSimpleStack(ModItems.AAA_Broken, 1); if (aName != null) { - NBTUtils.setBookTitle(g, EnumChatFormatting.YELLOW+"Maybe Alkalus should know about this"); + //NBTUtils.setString(g, "Lore", EnumChatFormatting.RED+aName); + NBTUtils.setBookTitle(g, EnumChatFormatting.RED+aName); + //NBTUtils.setBookTitle(g, EnumChatFormatting.YELLOW+"Maybe Alkalus should know about this"); } return g; } |