diff options
author | Raven Szewczyk <git@eigenraven.me> | 2023-04-10 17:49:16 +0100 |
---|---|---|
committer | Raven Szewczyk <git@eigenraven.me> | 2023-04-10 17:49:16 +0100 |
commit | 8ac58626bd4caa9e49f58acc6b97ac031f6c2107 (patch) | |
tree | 0a8c7b737f1f2607fa6875309f4c6a5c2b8b3331 /src/main/java/gregtech/api/util | |
parent | d795cf740c3b48b602d3bfb708ed9e6c492ad37d (diff) | |
download | GT5-Unofficial-8ac58626bd4caa9e49f58acc6b97ac031f6c2107.tar.gz GT5-Unofficial-8ac58626bd4caa9e49f58acc6b97ac031f6c2107.tar.bz2 GT5-Unofficial-8ac58626bd4caa9e49f58acc6b97ac031f6c2107.zip |
Update spotless config to 0.2.2
Diffstat (limited to 'src/main/java/gregtech/api/util')
46 files changed, 7370 insertions, 7862 deletions
diff --git a/src/main/java/gregtech/api/util/ColorsMetadataSection.java b/src/main/java/gregtech/api/util/ColorsMetadataSection.java index 05d0bd4059..fb9cc6dd56 100644 --- a/src/main/java/gregtech/api/util/ColorsMetadataSection.java +++ b/src/main/java/gregtech/api/util/ColorsMetadataSection.java @@ -18,7 +18,7 @@ public class ColorsMetadataSection implements IMetadataSection { private final boolean guiTintEnabled; public ColorsMetadataSection(Map<String, String> hexTextColorMap, Map<String, String> hexGuiTintMap, - boolean guiTintEnabled) { + boolean guiTintEnabled) { this.hexTextColors = hexTextColorMap; this.textColors = convertHexMapToIntMap(hexTextColorMap); @@ -54,7 +54,7 @@ public class ColorsMetadataSection implements IMetadataSection { private boolean isColorInMap(String key, Map<String, String> hexMap) { return hexMap.containsKey(key) && !hexMap.get(key) - .isEmpty(); + .isEmpty(); } public boolean sGuiTintingEnabled() { diff --git a/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java b/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java index ae480343b2..f898049e46 100644 --- a/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java +++ b/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java @@ -22,7 +22,7 @@ import gregtech.api.enums.Dyes; public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializer { public ColorsMetadataSection deserialize(JsonElement metadataColors, Type type, - JsonDeserializationContext context) { + JsonDeserializationContext context) { // Default values boolean enableGuiTint = GregTech_API.sColoredGUI; Map<String, String> hexGuiTintMap = new HashMap<>(); @@ -33,11 +33,11 @@ public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializ JsonObject textColors = JsonUtils.func_152754_s(jsonObject, "textColor"); for (Map.Entry<String, JsonElement> entry : textColors.entrySet()) { if (entry.getValue() - .isJsonPrimitive()) { + .isJsonPrimitive()) { hexTextColorMap.put( - entry.getKey(), - entry.getValue() - .getAsString()); + entry.getKey(), + entry.getValue() + .getAsString()); } else { GT_Mod.GT_FML_LOGGER.warn("ColorOverride expects primitive value for key `textColor`"); } @@ -46,10 +46,8 @@ public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializ if (jsonObject.has("guiTint")) { JsonObject guiTints = JsonUtils.func_152754_s(jsonObject, "guiTint"); - enableGuiTint = JsonUtils.getJsonObjectBooleanFieldValueOrDefault( - guiTints, - "enableGuiTintWhenPainted", - true); + enableGuiTint = JsonUtils + .getJsonObjectBooleanFieldValueOrDefault(guiTints, "enableGuiTintWhenPainted", true); for (Dyes dye : Dyes.values()) { hexGuiTintMap.put(dye.mName, GT_Util.toHexString(dye.getRGBA())); @@ -58,8 +56,8 @@ public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializ for (String key : hexGuiTintMap.keySet()) { if (enableGuiTint) { hexGuiTintMap.replace( - key, - JsonUtils.getJsonObjectStringFieldValueOrDefault(guiTints, key, hexGuiTintMap.get(key))); + key, + JsonUtils.getJsonObjectStringFieldValueOrDefault(guiTints, key, hexGuiTintMap.get(key))); } else { hexGuiTintMap.replace(key, GT_Util.toHexString(Dyes.dyeWhite.getRGBA())); } diff --git a/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java b/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java index 71c1e4716b..de46309a9f 100644 --- a/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java +++ b/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java @@ -141,12 +141,12 @@ public enum GT_ApiaryUpgrade { void apply(Consumer<GT_ApiaryUpgrade> fn) { UNIQUE_UPGRADE_LIST.get(this) - .forEach(fn); + .forEach(fn); } } private static final EnumMap<UNIQUE_INDEX, ArrayList<GT_ApiaryUpgrade>> UNIQUE_UPGRADE_LIST = new EnumMap<>( - UNIQUE_INDEX.class); + UNIQUE_INDEX.class); private int meta = 0; private int maxnumber = 1; @@ -158,7 +158,7 @@ public enum GT_ApiaryUpgrade { private final HashSet<GT_Utility.ItemId> blacklistedUpgrades = new HashSet<>(); GT_ApiaryUpgrade(UNIQUE_INDEX unique_index, int meta, int maxnumber, - BiConsumer<GT_ApiaryModifier, Integer> applier) { + BiConsumer<GT_ApiaryModifier, Integer> applier) { this.unique_index = unique_index; this.meta = meta; this.maxnumber = maxnumber; @@ -211,7 +211,7 @@ public enum GT_ApiaryUpgrade { static { EnumSet.allOf(GT_ApiaryUpgrade.class) - .forEach(GT_ApiaryUpgrade::setup_static_variables); + .forEach(GT_ApiaryUpgrade::setup_static_variables); speed8upgraded.blacklistedUpgrades.add(production.id); production.blacklistedUpgrades.add(speed8upgraded.id); } diff --git a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java b/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java index 7dc15f994d..b53cc4ba07 100644 --- a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java +++ b/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java @@ -137,9 +137,9 @@ public class GT_AssemblyLineUtils { } } if (!aTag.hasKey("output") || !aTag.hasKey("time") - || aTag.getInteger("time") <= 0 - || !aTag.hasKey("eu") - || !GT_Utility.isStackValid(aOutput)) { + || aTag.getInteger("time") <= 0 + || !aTag.hasKey("eu") + || !GT_Utility.isStackValid(aOutput)) { return LookupResultType.INVALID_STICK.getResult(); } if (GT_Values.D1) { @@ -152,14 +152,14 @@ public class GT_AssemblyLineUtils { // Try build a recipe instance if (aReturnBuiltRecipe) { return LookupResultType.VALID_STACK_AND_VALID_HASH.getResult( - new GT_Recipe_AssemblyLine( - null, - 0, - aInputs.toArray(new ItemStack[0]), - aFluidInputs.toArray(new FluidStack[0]), - aOutput, - aTime, - aEU)); + new GT_Recipe_AssemblyLine( + null, + 0, + aInputs.toArray(new ItemStack[0]), + aFluidInputs.toArray(new FluidStack[0]), + aOutput, + aTime, + aEU)); } for (GT_Recipe_AssemblyLine aRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) { @@ -192,7 +192,7 @@ public class GT_AssemblyLineUtils { private static boolean areStacksEqual(ItemStack[] lhs, List<ItemStack> rhs) { return lhs == null ? rhs.isEmpty() - : !rhs.isEmpty() && GT_Utility.areStackListsEqual(Arrays.asList(lhs), rhs, false, true); + : !rhs.isEmpty() && GT_Utility.areStackListsEqual(Arrays.asList(lhs), rhs, false, true); } /** @@ -279,8 +279,8 @@ public class GT_AssemblyLineUtils { */ public static boolean doesDataStickHaveOutput(ItemStack aDataStick) { if (isItemDataStick(aDataStick) && aDataStick.hasTagCompound() - && aDataStick.getTagCompound() - .hasKey("output")) { + && aDataStick.getTagCompound() + .hasKey("output")) { return true; } return false; @@ -312,7 +312,7 @@ public class GT_AssemblyLineUtils { if (isItemDataStick(aDataStick) && aDataStick.hasTagCompound()) { NBTTagCompound aNBT = aDataStick.getTagCompound(); if (aNBT.hasKey("Data.Recipe.Hash") && !aNBT.getString("Data.Recipe.Hash") - .equals("Hash.0")) { + .equals("Hash.0")) { return true; } } @@ -378,8 +378,8 @@ public class GT_AssemblyLineUtils { if (isItemDataStick(aDataStick)) { String s = aNewRecipe.mOutput.getDisplayName(); if (FMLCommonHandler.instance() - .getEffectiveSide() - .isServer()) { + .getEffectiveSide() + .isServer()) { s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mOutput.getDisplayName()); if (s == null) { s = aNewRecipe.mOutput.getDisplayName(); @@ -390,11 +390,11 @@ public class GT_AssemblyLineUtils { if (GT_Values.D1) { GT_Recipe_AssemblyLine aOldRecipe = findAssemblyLineRecipeFromDataStick(aDataStick, true).recipe; GT_FML_LOGGER.info( - "Updating data stick: " + aDataStick.getDisplayName() - + " | Old Recipe Hash: " - + generateRecipeHash(aOldRecipe) - + ", New Recipe Hash: " - + aHash); + "Updating data stick: " + aDataStick.getDisplayName() + + " | Old Recipe Hash: " + + generateRecipeHash(aOldRecipe) + + ", New Recipe Hash: " + + aHash); } String author = "Assembling Line Recipe Generator"; @@ -445,20 +445,20 @@ public class GT_AssemblyLineUtils { NBTTagList tNBTList = new NBTTagList(); s = aNewRecipe.mOutput.getDisplayName(); if (FMLCommonHandler.instance() - .getEffectiveSide() - .isServer()) { + .getEffectiveSide() + .isServer()) { s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mOutput.getDisplayName()); if (s == null) s = aNewRecipe.mOutput.getDisplayName(); } tNBTList.appendTag( - new NBTTagString( - "Construction plan for " + aNewRecipe.mOutput.stackSize - + " " - + s - + ". Needed EU/t: " - + aNewRecipe.mEUt - + " Production time: " - + (aNewRecipe.mDuration / 20))); + new NBTTagString( + "Construction plan for " + aNewRecipe.mOutput.stackSize + + " " + + s + + ". Needed EU/t: " + + aNewRecipe.mEUt + + " Production time: " + + (aNewRecipe.mDuration / 20))); for (int i = 0; i < aNewRecipe.mInputs.length; i++) { if (aNewRecipe.mOreDictAlt[i] != null) { int count = 0; @@ -467,16 +467,16 @@ public class GT_AssemblyLineUtils { if (tStack != null) { s = tStack.getDisplayName(); if (FMLCommonHandler.instance() - .getEffectiveSide() - .isServer()) { + .getEffectiveSide() + .isServer()) { s = GT_Assemblyline_Server.lServerNames.get(tStack.getDisplayName()); if (s == null) s = tStack.getDisplayName(); } tBuilder.append(count == 0 ? "" : "\nOr ") - .append(tStack.stackSize) - .append(" ") - .append(s); + .append(tStack.stackSize) + .append(" ") + .append(s); count++; } } @@ -484,28 +484,27 @@ public class GT_AssemblyLineUtils { } else if (aNewRecipe.mInputs[i] != null) { s = aNewRecipe.mInputs[i].getDisplayName(); if (FMLCommonHandler.instance() - .getEffectiveSide() - .isServer()) { + .getEffectiveSide() + .isServer()) { s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mInputs[i].getDisplayName()); if (s == null) s = aNewRecipe.mInputs[i].getDisplayName(); } tNBTList.appendTag( - new NBTTagString( - "Input Bus " + (i + 1) + ": " + aNewRecipe.mInputs[i].stackSize + " " + s)); + new NBTTagString("Input Bus " + (i + 1) + ": " + aNewRecipe.mInputs[i].stackSize + " " + s)); } } for (int i = 0; i < aNewRecipe.mFluidInputs.length; i++) { if (aNewRecipe.mFluidInputs[i] != null) { s = aNewRecipe.mFluidInputs[i].getLocalizedName(); if (FMLCommonHandler.instance() - .getEffectiveSide() - .isServer()) { + .getEffectiveSide() + .isServer()) { s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mFluidInputs[i].getLocalizedName()); if (s == null) s = aNewRecipe.mFluidInputs[i].getLocalizedName(); } tNBTList.appendTag( - new NBTTagString( - "Input Hatch " + (i + 1) + ": " + aNewRecipe.mFluidInputs[i].amount + "L " + s)); + new NBTTagString( + "Input Hatch " + (i + 1) + ": " + aNewRecipe.mFluidInputs[i].amount + "L " + s)); } } tNBT.setTag("pages", tNBTList); diff --git a/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java b/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java index 7a1515ec0c..e5889a6442 100644 --- a/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java +++ b/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java @@ -18,19 +18,19 @@ public class GT_Assemblyline_Server { public static LinkedHashMap<String, String> lServerNames = new LinkedHashMap<>(); private static LinkedHashMap<String, String> internal2 = new LinkedHashMap<>(), internal3 = new LinkedHashMap<>(), - internal4 = new LinkedHashMap<>(); + internal4 = new LinkedHashMap<>(); private static HashMap<String, Property> internal = new HashMap<>(); public static void fillMap(FMLPreInitializationEvent aEvent) { String s = new String( - aEvent.getModConfigurationDirectory() - .getAbsolutePath()); + aEvent.getModConfigurationDirectory() + .getAbsolutePath()); s = s.substring( - 0, - aEvent.getModConfigurationDirectory() - .getAbsolutePath() - .length() - 6); + 0, + aEvent.getModConfigurationDirectory() + .getAbsolutePath() + .length() - 6); s = s + "GregTech.lang"; File f = new File(s); s = ""; @@ -41,43 +41,38 @@ public class GT_Assemblyline_Server { for (Map.Entry<String, Property> entry : internal.entrySet()) { try { s = entry.getValue() - .getString() - .replaceAll("%", ""); + .getString() + .replaceAll("%", ""); if (entry.getKey() - .contains("metaitem") - && s.contains("material")) - internal2.put(entry.getKey(), s); + .contains("metaitem") && s.contains("material")) internal2.put(entry.getKey(), s); else if (entry.getKey() - .contains("blockmachines") - && s.contains("material")) - internal3.put(entry.getKey(), s); + .contains("blockmachines") && s.contains("material")) internal3.put(entry.getKey(), s); else if ((entry.getKey() - .contains("blockores") - || (entry.getKey() - .contains("blockmetal") - || entry.getKey() - .contains("blockgem"))) - && s.contains("material")) - internal4.put(entry.getKey(), s); + .contains("blockores") + || (entry.getKey() + .contains("blockmetal") + || entry.getKey() + .contains("blockgem"))) + && s.contains("material")) internal4.put(entry.getKey(), s); else lServerNames.put(entry.getKey(), s); } catch (Exception ignored) {} } for (Map.Entry<String, String> entry : internal2.entrySet()) { try { if (entry.getKey() - .contains("name")) { + .contains("name")) { int i = Integer.parseInt( - entry.getKey() - .substring( - "gt.metaitem.01.".length(), - entry.getKey() - .length() - ".name".length())); + entry.getKey() + .substring( + "gt.metaitem.01.".length(), + entry.getKey() + .length() - ".name".length())); i = i % 1000; if (GregTech_API.sGeneratedMaterials[i] != null) lServerNames.put( - entry.getKey(), - entry.getValue() - .replace("material", GregTech_API.sGeneratedMaterials[i].toString())); + entry.getKey(), + entry.getValue() + .replace("material", GregTech_API.sGeneratedMaterials[i].toString())); else lServerNames.put(entry.getKey(), null); } } catch (Exception ignored) {} @@ -85,237 +80,225 @@ public class GT_Assemblyline_Server { for (Map.Entry<String, String> entry : internal3.entrySet()) { try { if (entry.getKey() - .contains("cable")) + .contains("cable")) lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.cable.".length(), - entry.getKey() - .length() - ".01.name".length()))); + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.cable.".length(), + entry.getKey() + .length() - ".01.name".length()))); else if (entry.getKey() - .contains("gt_frame_")) + .contains("gt_frame_")) lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.gt_frame_".length(), - entry.getKey() - .length() - ".name".length()))); + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.gt_frame_".length(), + entry.getKey() + .length() - ".name".length()))); else if (entry.getKey() - .contains("gt_pipe_")) { - if (!entry.getKey() - .contains("_huge") - && !entry.getKey() - .contains("_large") - && !entry.getKey() - .contains("_nonuple") - && !entry.getKey() - .contains("_quadruple") - && !entry.getKey() - .contains("_small") - && !entry.getKey() - .contains("_tiny")) - lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.gt_pipe_".length(), - entry.getKey() - .length() - ".name".length()))); - else if (entry.getKey() - .contains("_huge") - || entry.getKey() - .contains("_tiny")) - lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.gt_pipe_".length(), - entry.getKey() - .length() - "_tiny.name".length()))); - else if (entry.getKey() - .contains("_large") - || entry.getKey() - .contains("_small")) - lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.gt_pipe_".length(), - entry.getKey() - .length() - "_large.name".length()))); - else if (entry.getKey() - .contains("_nonuple")) - lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.gt_pipe_".length(), - entry.getKey() - .length() - "_nonuple.name".length()))); - else if (entry.getKey() - .contains("_quadruple")) - lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.gt_pipe_".length(), - entry.getKey() - .length() - "_quadruple.name".length()))); - } else - if (entry.getKey() - .contains("wire")) - lServerNames.put( + .contains("gt_pipe_")) { + if (!entry.getKey() + .contains("_huge") + && !entry.getKey() + .contains("_large") + && !entry.getKey() + .contains("_nonuple") + && !entry.getKey() + .contains("_quadruple") + && !entry.getKey() + .contains("_small") + && !entry.getKey() + .contains("_tiny")) + lServerNames.put( + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.gt_pipe_".length(), + entry.getKey() + .length() - ".name".length()))); + else if (entry.getKey() + .contains("_huge") + || entry.getKey() + .contains("_tiny")) + lServerNames.put( + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.gt_pipe_".length(), + entry.getKey() + .length() - "_tiny.name".length()))); + else if (entry.getKey() + .contains("_large") + || entry.getKey() + .contains("_small")) + lServerNames.put( + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.gt_pipe_".length(), + entry.getKey() + .length() - "_large.name".length()))); + else if (entry.getKey() + .contains("_nonuple")) + lServerNames.put( + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.gt_pipe_".length(), + entry.getKey() + .length() - "_nonuple.name".length()))); + else if (entry.getKey() + .contains("_quadruple")) + lServerNames.put( entry.getKey(), entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.wire.".length(), - entry.getKey() - .length() - ".01.name".length()))); - else lServerNames.put(entry.getKey(), entry.getValue()); + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.gt_pipe_".length(), + entry.getKey() + .length() - "_quadruple.name".length()))); + } else if (entry.getKey() + .contains("wire")) + lServerNames.put( + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.wire.".length(), + entry.getKey() + .length() - ".01.name".length()))); + else lServerNames.put(entry.getKey(), entry.getValue()); } catch (Exception ignored) {} } for (Map.Entry<String, String> entry : internal4.entrySet()) { try { if (entry.getKey() - .contains("blockores")) { + .contains("blockores")) { int i = Integer.parseInt( - entry.getKey() - .substring( - "gt.blockores.".length(), - entry.getKey() - .length() - ".name".length())); + entry.getKey() + .substring( + "gt.blockores.".length(), + entry.getKey() + .length() - ".name".length())); i = i % 1000; if (GregTech_API.sGeneratedMaterials[i] != null) lServerNames.put( - entry.getKey(), - entry.getValue() - .replace("material", GregTech_API.sGeneratedMaterials[i].toString())); + entry.getKey(), + entry.getValue() + .replace("material", GregTech_API.sGeneratedMaterials[i].toString())); else lServerNames.put(entry.getKey(), null); } else if (entry.getKey() - .contains("blockmetal")) { - Materials[] mMats = null; - String t = entry.getKey() - .substring("gt.blockmetal".length()); - t = t.substring(0, 1); - int i = Integer.parseInt(t); - switch (i) { - case 1 -> mMats = new Materials[] { Materials.Adamantium, Materials.Aluminium, - Materials.Americium, Materials.AnnealedCopper, Materials.Antimony, - Materials.Arsenic, Materials.AstralSilver, Materials.BatteryAlloy, - Materials.Beryllium, Materials.Bismuth, Materials.BismuthBronze, - Materials.BlackBronze, Materials.BlackSteel, Materials.BlueAlloy, - Materials.BlueSteel, Materials.Brass }; - case 2 -> mMats = new Materials[] { Materials.Bronze, Materials.Caesium, - Materials.Cerium, Materials.Chrome, Materials.ChromiumDioxide, - Materials.Cobalt, Materials.CobaltBrass, Materials.Copper, - Materials.Cupronickel, Materials.DamascusSteel, Materials.DarkIron, - Materials.DeepIron, Materials.Desh, Materials.Duranium, - Materials.Dysprosium, Materials.Electrum }; - case 3 -> mMats = new Materials[] { Materials.ElectrumFlux, Materials.Enderium, - Materials.Erbium, Materials.Europium, Materials.FierySteel, - Materials.Gadolinium, Materials.Gallium, Materials.Holmium, - Materials.HSLA, Materials.Indium, Materials.InfusedGold, - Materials.Invar, Materials.Iridium, Materials.IronMagnetic, - Materials.IronWood, Materials.Kanthal }; - case 4 -> mMats = new Materials[] { Materials.Knightmetal, Materials.Lanthanum, - Materials.Lead, Materials.Lutetium, Materials.Magnalium, - Materials.Magnesium, Materials.Manganese, Materials.MeteoricIron, - Materials.MeteoricSteel, Materials.Trinium, Materials.Mithril, - Materials.Molybdenum, Materials.Naquadah, Materials.NaquadahAlloy, - Materials.NaquadahEnriched, Materials.Naquadria }; - case 5 -> mMats = new Materials[] { Materials.Neodymium, - Materials.NeodymiumMagnetic, Materials.Neutronium, Materials.Nichrome, - Materials.Nickel, Materials.Niobium, Materials.NiobiumNitride, - Materials.NiobiumTitanium, Materials.Osmiridium, Materials.Osmium, - Materials.Palladium, Materials.PigIron, Materials.Platinum, - Materials.Plutonium, Materials.Plutonium241, Materials.Praseodymium }; - case 6 -> mMats = new Materials[] { Materials.Promethium, Materials.RedAlloy, - Materials.RedSteel, Materials.RoseGold, Materials.Rubidium, - Materials.Samarium, Materials.Scandium, Materials.ShadowIron, - Materials.ShadowSteel, Materials.Silicon, Materials.Silver, - Materials.SolderingAlloy, Materials.StainlessSteel, Materials.Steel, - Materials.SteelMagnetic, Materials.SterlingSilver }; - case 7 -> mMats = new Materials[] { Materials.Sunnarium, Materials.Tantalum, - Materials.Tellurium, Materials.Terbium, Materials.Thaumium, - Materials.Thorium, Materials.Thulium, Materials.Tin, Materials.TinAlloy, - Materials.Titanium, Materials.Tritanium, Materials.Tungsten, - Materials.TungstenSteel, Materials.Ultimet, Materials.Uranium, - Materials.Uranium235 }; - case 8 -> mMats = new Materials[] { Materials.Vanadium, - Materials.VanadiumGallium, Materials.WroughtIron, Materials.Ytterbium, - Materials.Yttrium, Materials.YttriumBariumCuprate, Materials.Zinc, - Materials.TungstenCarbide, Materials.VanadiumSteel, Materials.HSSG, - Materials.HSSE, Materials.HSSS, Materials.Steeleaf, Materials.Ichorium, - Materials.Firestone }; - } - t = entry.getKey() - .substring( - "gt.blockmetal1.".length(), - entry.getKey() - .length() - ".name".length()); - i = Integer.parseInt(t); - lServerNames.put(entry.getKey(), "Block of " + mMats[i].toString()); - mMats = null; - } else - if (entry.getKey() - .contains("blockgem")) { - Materials[] mMats = null; - String t = entry.getKey() - .substring("gt.blockgem".length()); - t = t.substring(0, 1); - int i = Integer.parseInt(t); - switch (i) { - case 1 -> mMats = new Materials[] { Materials.InfusedAir, Materials.Amber, - Materials.Amethyst, Materials.InfusedWater, Materials.BlueTopaz, - Materials.CertusQuartz, Materials.Dilithium, Materials.EnderEye, - Materials.EnderPearl, Materials.FoolsRuby, Materials.Force, - Materials.Forcicium, Materials.Forcillium, Materials.GreenSapphire, - Materials.InfusedFire, Materials.Jasper, MaterialsBotania.ManaDiamond, - MaterialsBotania.BotaniaDragonstone }; - case 2 -> mMats = new Materials[] { Materials.Lazurite, Materials.Lignite, - Materials.Monazite, Materials.Niter, Materials.Olivine, Materials.Opal, - Materials.InfusedOrder, Materials.InfusedEntropy, Materials.Phosphorus, - Materials.Quartzite, Materials.GarnetRed, Materials.Ruby, - Materials.Sapphire, Materials.Sodalite, Materials.Tanzanite, - Materials.InfusedEarth }; - case 3 -> mMats = new Materials[] { Materials.Topaz, Materials.Vinteum, - Materials.GarnetYellow, Materials.NetherStar, Materials.Charcoal, - Materials.Blaze }; - } - t = entry.getKey() - .substring( - "gt.blockgem1.".length(), - entry.getKey() - .length() - ".name".length()); - i = Integer.parseInt(t); - lServerNames.put(entry.getKey(), "Block of " + mMats[i].toString()); - mMats = null; - } + .contains("blockmetal")) { + Materials[] mMats = null; + String t = entry.getKey() + .substring("gt.blockmetal".length()); + t = t.substring(0, 1); + int i = Integer.parseInt(t); + switch (i) { + case 1 -> mMats = new Materials[] { Materials.Adamantium, Materials.Aluminium, + Materials.Americium, Materials.AnnealedCopper, Materials.Antimony, Materials.Arsenic, + Materials.AstralSilver, Materials.BatteryAlloy, Materials.Beryllium, Materials.Bismuth, + Materials.BismuthBronze, Materials.BlackBronze, Materials.BlackSteel, + Materials.BlueAlloy, Materials.BlueSteel, Materials.Brass }; + case 2 -> mMats = new Materials[] { Materials.Bronze, Materials.Caesium, Materials.Cerium, + Materials.Chrome, Materials.ChromiumDioxide, Materials.Cobalt, Materials.CobaltBrass, + Materials.Copper, Materials.Cupronickel, Materials.DamascusSteel, Materials.DarkIron, + Materials.DeepIron, Materials.Desh, Materials.Duranium, Materials.Dysprosium, + Materials.Electrum }; + case 3 -> mMats = new Materials[] { Materials.ElectrumFlux, Materials.Enderium, + Materials.Erbium, Materials.Europium, Materials.FierySteel, Materials.Gadolinium, + Materials.Gallium, Materials.Holmium, Materials.HSLA, Materials.Indium, + Materials.InfusedGold, Materials.Invar, Materials.Iridium, Materials.IronMagnetic, + Materials.IronWood, Materials.Kanthal }; + case 4 -> mMats = new Materials[] { Materials.Knightmetal, Materials.Lanthanum, + Materials.Lead, Materials.Lutetium, Materials.Magnalium, Materials.Magnesium, + Materials.Manganese, Materials.MeteoricIron, Materials.MeteoricSteel, Materials.Trinium, + Materials.Mithril, Materials.Molybdenum, Materials.Naquadah, Materials.NaquadahAlloy, + Materials.NaquadahEnriched, Materials.Naquadria }; + case 5 -> mMats = new Materials[] { Materials.Neodymium, Materials.NeodymiumMagnetic, + Materials.Neutronium, Materials.Nichrome, Materials.Nickel, Materials.Niobium, + Materials.NiobiumNitride, Materials.NiobiumTitanium, Materials.Osmiridium, + Materials.Osmium, Materials.Palladium, Materials.PigIron, Materials.Platinum, + Materials.Plutonium, Materials.Plutonium241, Materials.Praseodymium }; + case 6 -> mMats = new Materials[] { Materials.Promethium, Materials.RedAlloy, + Materials.RedSteel, Materials.RoseGold, Materials.Rubidium, Materials.Samarium, + Materials.Scandium, Materials.ShadowIron, Materials.ShadowSteel, Materials.Silicon, + Materials.Silver, Materials.SolderingAlloy, Materials.StainlessSteel, Materials.Steel, + Materials.SteelMagnetic, Materials.SterlingSilver }; + case 7 -> mMats = new Materials[] { Materials.Sunnarium, Materials.Tantalum, + Materials.Tellurium, Materials.Terbium, Materials.Thaumium, Materials.Thorium, + Materials.Thulium, Materials.Tin, Materials.TinAlloy, Materials.Titanium, + Materials.Tritanium, Materials.Tungsten, Materials.TungstenSteel, Materials.Ultimet, + Materials.Uranium, Materials.Uranium235 }; + case 8 -> mMats = new Materials[] { Materials.Vanadium, Materials.VanadiumGallium, + Materials.WroughtIron, Materials.Ytterbium, Materials.Yttrium, + Materials.YttriumBariumCuprate, Materials.Zinc, Materials.TungstenCarbide, + Materials.VanadiumSteel, Materials.HSSG, Materials.HSSE, Materials.HSSS, + Materials.Steeleaf, Materials.Ichorium, Materials.Firestone }; + } + t = entry.getKey() + .substring( + "gt.blockmetal1.".length(), + entry.getKey() + .length() - ".name".length()); + i = Integer.parseInt(t); + lServerNames.put(entry.getKey(), "Block of " + mMats[i].toString()); + mMats = null; + } else if (entry.getKey() + .contains("blockgem")) { + Materials[] mMats = null; + String t = entry.getKey() + .substring("gt.blockgem".length()); + t = t.substring(0, 1); + int i = Integer.parseInt(t); + switch (i) { + case 1 -> mMats = new Materials[] { Materials.InfusedAir, Materials.Amber, + Materials.Amethyst, Materials.InfusedWater, Materials.BlueTopaz, + Materials.CertusQuartz, Materials.Dilithium, Materials.EnderEye, + Materials.EnderPearl, Materials.FoolsRuby, Materials.Force, Materials.Forcicium, + Materials.Forcillium, Materials.GreenSapphire, Materials.InfusedFire, + Materials.Jasper, MaterialsBotania.ManaDiamond, + MaterialsBotania.BotaniaDragonstone }; + case 2 -> mMats = new Materials[] { Materials.Lazurite, Materials.Lignite, + Materials.Monazite, Materials.Niter, Materials.Olivine, Materials.Opal, + Materials.InfusedOrder, Materials.InfusedEntropy, Materials.Phosphorus, + Materials.Quartzite, Materials.GarnetRed, Materials.Ruby, Materials.Sapphire, + Materials.Sodalite, Materials.Tanzanite, Materials.InfusedEarth }; + case 3 -> mMats = new Materials[] { Materials.Topaz, Materials.Vinteum, + Materials.GarnetYellow, Materials.NetherStar, Materials.Charcoal, Materials.Blaze }; + } + t = entry.getKey() + .substring( + "gt.blockgem1.".length(), + entry.getKey() + .length() - ".name".length()); + i = Integer.parseInt(t); + lServerNames.put(entry.getKey(), "Block of " + mMats[i].toString()); + mMats = null; + } } catch (Exception ignored) {} } diff --git a/src/main/java/gregtech/api/util/GT_BaseCrop.java b/src/main/java/gregtech/api/util/GT_BaseCrop.java index 12e6b86019..f3337a8c0a 100644 --- a/src/main/java/gregtech/api/util/GT_BaseCrop.java +++ b/src/main/java/gregtech/api/util/GT_BaseCrop.java @@ -57,28 +57,27 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { * @param aHarvestSize the size the Crop needs to be harvested. forced to be between 2 and max size */ public GT_BaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aBaseSeed, int aTier, int aMaxSize, - int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, - int aStatDefensive, int aStatColor, int aStatWeed, String[] aAttributes, ItemStack aDrop, - ItemStack[] aSpecialDrops) { + int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, int aStatDefensive, + int aStatColor, int aStatWeed, String[] aAttributes, ItemStack aDrop, ItemStack[] aSpecialDrops) { new GT_BaseCrop( - aID, - aCropName, - aDiscoveredBy, - aBaseSeed, - aTier, - aMaxSize, - aGrowthSpeed, - aAfterHarvestSize, - aHarvestSize, - aStatChemical, - aStatFood, - aStatDefensive, - aStatColor, - aStatWeed, - aAttributes, - null, - aDrop, - aSpecialDrops); + aID, + aCropName, + aDiscoveredBy, + aBaseSeed, + aTier, + aMaxSize, + aGrowthSpeed, + aAfterHarvestSize, + aHarvestSize, + aStatChemical, + aStatFood, + aStatDefensive, + aStatColor, + aStatWeed, + aAttributes, + null, + aDrop, + aSpecialDrops); } /** @@ -96,9 +95,9 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { * @param aBlock the block below needed for crop to grow. If null no block needed */ public GT_BaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aBaseSeed, int aTier, int aMaxSize, - int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, - int aStatDefensive, int aStatColor, int aStatWeed, String[] aAttributes, Materials aBlock, ItemStack aDrop, - ItemStack[] aSpecialDrops) { + int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, int aStatDefensive, + int aStatColor, int aStatWeed, String[] aAttributes, Materials aBlock, ItemStack aDrop, + ItemStack[] aSpecialDrops) { mName = aCropName; aID = GT_Config.addIDConfig(ConfigCategories.IDs.crops, mName.replaceAll(" ", "_"), aID); if (aDiscoveredBy != null && !aDiscoveredBy.equals(E)) mDiscoveredBy = aDiscoveredBy; @@ -126,13 +125,13 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { if (bIc2NeiLoaded) { try { Class.forName("speiger.src.crops.api.CropPluginAPI") - .getMethod("registerCropInfo", Class.forName("speiger.src.crops.api.ICropCardInfo")) - .invoke( - Class.forName("speiger.src.crops.api.CropPluginAPI") - .getField("instance"), - this); + .getMethod("registerCropInfo", Class.forName("speiger.src.crops.api.ICropCardInfo")) + .invoke( + Class.forName("speiger.src.crops.api.CropPluginAPI") + .getField("instance"), + this); } catch (IllegalAccessException | ClassNotFoundException | SecurityException | NoSuchMethodException - | NoSuchFieldException | InvocationTargetException | IllegalArgumentException ex) { + | NoSuchFieldException | InvocationTargetException | IllegalArgumentException ex) { bIc2NeiLoaded = false; } } @@ -207,11 +206,7 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { public ItemStack getGain(ICropTile aCrop) { int tDrop = 0; if (mSpecialDrops != null && (tDrop = java.util.concurrent.ThreadLocalRandom.current() - .nextInt( - 0, - (mSpecialDrops.length * 2) - + 2)) - < mSpecialDrops.length && mSpecialDrops[tDrop] != null) { + .nextInt(0, (mSpecialDrops.length * 2) + 2)) < mSpecialDrops.length && mSpecialDrops[tDrop] != null) { return GT_Utility.copyOrNull(mSpecialDrops[tDrop]); } return GT_Utility.copyOrNull(mDrop); @@ -234,19 +229,13 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { } for (int i = 1; i < this.getrootslength(aCrop); i++) { Block tBlock = aCrop.getWorld() - .getBlock( - aCrop.getLocation().posX, - aCrop.getLocation().posY - i, - aCrop.getLocation().posZ); + .getBlock(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ); if ((tBlock instanceof GT_Block_Ores_Abstract)) { TileEntity tTileEntity = aCrop.getWorld() - .getTileEntity( - aCrop.getLocation().posX, - aCrop.getLocation().posY - i, - aCrop.getLocation().posZ); + .getTileEntity(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ); if ((tTileEntity instanceof GT_TileEntity_Ores)) { Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData - % 1000)]; + % 1000)]; if ((tMaterial != null) && (tMaterial != Materials._NULL)) { if (tMaterial == mBlock) { return true; @@ -257,18 +246,14 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { } } else { int tMetaID = aCrop.getWorld() - .getBlockMetadata( - aCrop.getLocation().posX, - aCrop.getLocation().posY - i, - aCrop.getLocation().posZ); + .getBlockMetadata(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ); ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); if ((tAssotiation != null) && (tAssotiation.mPrefix.toString() - .startsWith("ore")) - && (tAssotiation.mMaterial.mMaterial == mBlock)) { + .startsWith("ore")) && (tAssotiation.mMaterial.mMaterial == mBlock)) { return true; } if ((tAssotiation != null) && (tAssotiation.mPrefix == OrePrefixes.block) - && (tAssotiation.mMaterial.mMaterial == mBlock)) { + && (tAssotiation.mMaterial.mMaterial == mBlock)) { return true; } } @@ -293,10 +278,10 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { if (mBlock != null) { ArrayList<String> result = new ArrayList<>(1); result.add( - String.format( - "Requires %s Ore or Block of %s as soil block to reach full growth.", - mBlock.mName, - mBlock.mName)); + String.format( + "Requires %s Ore or Block of %s as soil block to reach full growth.", + mBlock.mName, + mBlock.mName)); return result; } return null; diff --git a/src/main/java/gregtech/api/util/GT_CLS_Compat.java b/src/main/java/gregtech/api/util/GT_CLS_Compat.java index 4dff5f65f9..0d3864e26f 100644 --- a/src/main/java/gregtech/api/util/GT_CLS_Compat.java +++ b/src/main/java/gregtech/api/util/GT_CLS_Compat.java @@ -45,24 +45,24 @@ public class GT_CLS_Compat { } Optional.ofNullable(alexiilMinecraftDisplayer) - .ifPresent(e -> { - try { - getLastPercent = e.getMethod("getLastPercent"); - isReplacingVanillaMaterials = e.getField("isReplacingVanillaMaterials"); - isRegisteringGTmaterials = e.getField("isRegisteringGTmaterials"); - } catch (NoSuchMethodException | NoSuchFieldException ex) { - GT_Mod.GT_FML_LOGGER.catching(ex); - } - }); + .ifPresent(e -> { + try { + getLastPercent = e.getMethod("getLastPercent"); + isReplacingVanillaMaterials = e.getField("isReplacingVanillaMaterials"); + isRegisteringGTmaterials = e.getField("isRegisteringGTmaterials"); + } catch (NoSuchMethodException | NoSuchFieldException ex) { + GT_Mod.GT_FML_LOGGER.catching(ex); + } + }); Optional.ofNullable(alexiilProgressDisplayer) - .ifPresent(e -> { - try { - displayProgress = e.getMethod("displayProgress", String.class, float.class); - } catch (NoSuchMethodException ex) { - GT_Mod.GT_FML_LOGGER.catching(ex); - } - }); + .ifPresent(e -> { + try { + displayProgress = e.getMethod("displayProgress", String.class, float.class); + } catch (NoSuchMethodException ex) { + GT_Mod.GT_FML_LOGGER.catching(ex); + } + }); try { progressBarStep = cpwProgressBar.getDeclaredField("step"); @@ -75,7 +75,7 @@ public class GT_CLS_Compat { private GT_CLS_Compat() {} private static <T> void registerAndReportProgression(String materialsType, Collection<T> materials, - ProgressManager.ProgressBar progressBar, Function<T, Object> getName, Consumer<T> action) { + ProgressManager.ProgressBar progressBar, Function<T, Object> getName, Consumer<T> action) { int sizeStep = materials.size(); final long progressionReportsEvery = 100; final long bakingMsgEvery = 1000; @@ -89,7 +89,7 @@ public class GT_CLS_Compat { if (nextProgressionReportAt < now) { nextProgressionReportAt = now + progressionReportsEvery; String materialName = getName.apply(m) - .toString(); + .toString(); try { displayProgress.invoke(null, materialName, (float) currentStep / sizeStep); } catch (IllegalAccessException | InvocationTargetException iae) { @@ -104,8 +104,8 @@ public class GT_CLS_Compat { } if (nextBakingMsgAt < now) { nextBakingMsgAt = now + bakingMsgEvery; - GT_Mod.GT_FML_LOGGER.info( - String.format("%s - Baking: %d%%", materialsType, currentStep * 100 / sizeStep)); + GT_Mod.GT_FML_LOGGER + .info(String.format("%s - Baking: %d%%", materialsType, currentStep * 100 / sizeStep)); } action.accept(m); currentStep += 1; @@ -119,35 +119,35 @@ public class GT_CLS_Compat { } public static void stepMaterialsCLS(Collection<GT_Proxy.OreDictEventContainer> mEvents, - ProgressManager.ProgressBar progressBar) throws IllegalAccessException, InvocationTargetException { + ProgressManager.ProgressBar progressBar) throws IllegalAccessException, InvocationTargetException { try { isRegisteringGTmaterials.set(null, true); } catch (IllegalArgumentException | IllegalAccessException e) { GT_Mod.GT_FML_LOGGER.catching(e); } registerAndReportProgression( - "GregTech materials", - mEvents, - progressBar, - m -> m.mMaterial, - GT_Proxy::registerRecipes); + "GregTech materials", + mEvents, + progressBar, + m -> m.mMaterial, + GT_Proxy::registerRecipes); ProgressManager.pop(progressBar); isRegisteringGTmaterials.set(null, false); } public static void doActualRegistrationCLS(ProgressManager.ProgressBar progressBar, - Set<Materials> replacedVanillaItemsSet) throws InvocationTargetException, IllegalAccessException { + Set<Materials> replacedVanillaItemsSet) throws InvocationTargetException, IllegalAccessException { try { isReplacingVanillaMaterials.set(null, true); } catch (IllegalArgumentException | IllegalAccessException e) { GT_Mod.GT_FML_LOGGER.catching(e); } registerAndReportProgression( - "Vanilla materials", - replacedVanillaItemsSet, - progressBar, - m -> m.mDefaultLocalName, - GT_PostLoad::doActualRegistration); + "Vanilla materials", + replacedVanillaItemsSet, + progressBar, + m -> m.mDefaultLocalName, + GT_PostLoad::doActualRegistration); } public static void pushToDisplayProgress() throws InvocationTargetException, IllegalAccessException { diff --git a/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java b/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java index bfc6daf45f..bb73cf77ed 100644 --- a/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java +++ b/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java @@ -67,12 +67,12 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID private static final Map<String, GT_ChunkAssociatedData<?>> instances = new ConcurrentHashMap<>(); private static final int IO_PARALLELISM = Math.min( - 8, - Math.max( - 1, - Runtime.getRuntime() - .availableProcessors() * 2 - / 3)); + 8, + Math.max( + 1, + Runtime.getRuntime() + .availableProcessors() * 2 + / 3)); private static final ExecutorService IO_WORKERS = Executors.newWorkStealingPool(IO_PARALLELISM); private static final Pattern FILE_PATTERN = Pattern.compile("(.+)\\.(-?\\d+)\\.(-?\\d+)\\.dat"); @@ -103,7 +103,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID * changed. */ protected GT_ChunkAssociatedData(String aId, Class<T> elementType, int regionLength, byte version, - boolean saveDefaults) { + boolean saveDefaults) { if (regionLength * regionLength > Short.MAX_VALUE || regionLength <= 0) throw new IllegalArgumentException("Region invalid: " + regionLength); if (!IData.class.isAssignableFrom(elementType)) throw new IllegalArgumentException("Data type invalid"); @@ -138,13 +138,13 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID public final T get(World world, int chunkX, int chunkZ) { SuperRegion region = masterMap.computeIfAbsent(world.provider.dimensionId, ignored -> new ConcurrentHashMap<>()) - .computeIfAbsent(getRegionID(chunkX, chunkZ), c -> new SuperRegion(world, c)); + .computeIfAbsent(getRegionID(chunkX, chunkZ), c -> new SuperRegion(world, c)); return region.get(Math.floorMod(chunkX, regionLength), Math.floorMod(chunkZ, regionLength)); } protected final void set(World world, int chunkX, int chunkZ, T data) { SuperRegion region = masterMap.computeIfAbsent(world.provider.dimensionId, ignored -> new ConcurrentHashMap<>()) - .computeIfAbsent(getRegionID(chunkX, chunkZ), c -> new SuperRegion(world, c)); + .computeIfAbsent(getRegionID(chunkX, chunkZ), c -> new SuperRegion(world, c)); region.set(Math.floorMod(chunkX, regionLength), Math.floorMod(chunkZ, regionLength), data); } @@ -161,55 +161,54 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID public void clear() { if (GT_Values.debugWorldData) { long dirtyRegionCount = masterMap.values() - .stream() - .flatMap( - m -> m.values() - .stream()) - .filter(SuperRegion::isDirty) - .count(); + .stream() + .flatMap( + m -> m.values() + .stream()) + .filter(SuperRegion::isDirty) + .count(); if (dirtyRegionCount > 0) GT_Log.out.println( - "Clearing ChunkAssociatedData with " + dirtyRegionCount - + " regions dirty. Data might have been lost!"); + "Clearing ChunkAssociatedData with " + dirtyRegionCount + " regions dirty. Data might have been lost!"); } masterMap.clear(); } public void save() { saveRegions( - masterMap.values() - .stream() - .flatMap( - m -> m.values() - .stream())); + masterMap.values() + .stream() + .flatMap( + m -> m.values() + .stream())); } public void save(World world) { Map<ChunkCoordIntPair, SuperRegion> map = masterMap.get(world.provider.dimensionId); if (map != null) saveRegions( - map.values() - .stream()); + map.values() + .stream()); } private void saveRegions(Stream<SuperRegion> stream) { stream.filter(SuperRegion::isDirty) - .map(c -> (Runnable) c::save) - .map(r -> CompletableFuture.runAsync(r, IO_WORKERS)) - .reduce(CompletableFuture::allOf) - .ifPresent(f -> { - try { - f.get(); - } catch (Exception e) { - GT_Log.err.println("Data save error: " + mId); - e.printStackTrace(GT_Log.err); - } - }); + .map(c -> (Runnable) c::save) + .map(r -> CompletableFuture.runAsync(r, IO_WORKERS)) + .reduce(CompletableFuture::allOf) + .ifPresent(f -> { + try { + f.get(); + } catch (Exception e) { + GT_Log.err.println("Data save error: " + mId); + e.printStackTrace(GT_Log.err); + } + }); } protected abstract void writeElement(DataOutput output, T element, World world, int chunkX, int chunkZ) - throws IOException; + throws IOException; protected abstract T readElement(DataInput input, int version, World world, int chunkX, int chunkZ) - throws IOException; + throws IOException; protected abstract T createElement(World world, int chunkX, int chunkZ); @@ -235,43 +234,34 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID */ protected void loadAll(World w) { if (GT_Values.debugWorldData && masterMap.containsKey(w.provider.dimensionId)) GT_Log.err.println( - "Reloading ChunkAssociatedData " + mId - + " for world " - + w.provider.dimensionId - + " discards old data!"); + "Reloading ChunkAssociatedData " + mId + " for world " + w.provider.dimensionId + " discards old data!"); if (!getSaveDirectory(w).isDirectory()) // nothing to load... return; try (Stream<Path> stream = Files.list(getSaveDirectory(w).toPath())) { Map<ChunkCoordIntPair, SuperRegion> worldData = stream.map(f -> { Matcher matcher = FILE_PATTERN.matcher( - f.getFileName() - .toString()); + f.getFileName() + .toString()); return matcher.matches() ? matcher : null; }) - .filter(Objects::nonNull) - .filter(m -> mId.equals(m.group(1))) - .map( - m -> CompletableFuture.supplyAsync( - () -> new SuperRegion( - w, - Integer.parseInt(m.group(2)), - Integer.parseInt(m.group(3))), - IO_WORKERS)) - .map(f -> { - try { - return f.get(); - } catch (Exception e) { - GT_Log.err.println("Error loading region"); - e.printStackTrace(GT_Log.err); - return null; - } - }) - .filter(Objects::nonNull) - .collect( - Collectors.toMap( - SuperRegion::getCoord, - Function.identity())); + .filter(Objects::nonNull) + .filter(m -> mId.equals(m.group(1))) + .map( + m -> CompletableFuture.supplyAsync( + () -> new SuperRegion(w, Integer.parseInt(m.group(2)), Integer.parseInt(m.group(3))), + IO_WORKERS)) + .map(f -> { + try { + return f.get(); + } catch (Exception e) { + GT_Log.err.println("Error loading region"); + e.printStackTrace(GT_Log.err); + return null; + } + }) + .filter(Objects::nonNull) + .collect(Collectors.toMap(SuperRegion::getCoord, Function.identity())); masterMap.put(w.provider.dimensionId, worldData); } catch (IOException | UncheckedIOException e) { GT_Log.err.println("Error loading all region"); @@ -282,11 +272,11 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID protected File getSaveDirectory(World w) { File base; if (w.provider.getSaveFolder() == null) base = w.getSaveHandler() - .getWorldDirectory(); + .getWorldDirectory(); else base = new File( - w.getSaveHandler() - .getWorldDirectory(), - w.provider.getSaveFolder()); + w.getSaveHandler() + .getWorldDirectory(), + w.provider.getSaveFolder()); return new File(base, GregTech.ID); } @@ -319,8 +309,8 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID this.world = new WeakReference<>(world); this.coord = regionCoord; backingStorage = new File( - getSaveDirectory(world), - String.format("%s.%d.%d.dat", mId, regionCoord.chunkXPos, regionCoord.chunkZPos)); + getSaveDirectory(world), + String.format("%s.%d.%d.dat", mId, regionCoord.chunkXPos, regionCoord.chunkZPos)); if (backingStorage.isFile()) load(); } @@ -335,9 +325,9 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID if (datum == null) { World world = Objects.requireNonNull(this.world.get()); T newElem = createElement( - world, - coord.chunkXPos * regionLength + subRegionX, - coord.chunkZPos * regionLength + subRegionZ); + world, + coord.chunkXPos * regionLength + subRegionX, + coord.chunkZPos * regionLength + subRegionZ); data[index] = newElem; return newElem; } @@ -387,7 +377,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID private void save0() throws IOException { // noinspection ResultOfMethodCallIgnored backingStorage.getParentFile() - .mkdirs(); + .mkdirs(); File tmpFile = getTmpFile(); World world = Objects.requireNonNull(this.world.get(), "Attempting to save region of another world!"); try (DataOutputStream output = new DataOutputStream(new FileOutputStream(tmpFile))) { @@ -402,8 +392,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID // work out how long is this range int rangeStart = ptr; while (ptr < data.length - && (data[ptr] == null || (!saveDefaults && data[ptr].isSameAsDefault())) == nullRange) - ptr++; + && (data[ptr] == null || (!saveDefaults && data[ptr].isSameAsDefault())) == nullRange) ptr++; // write range length output.writeShort(ptr - rangeStart); if (!nullRange) @@ -418,10 +407,10 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID // since atomic operation, no need to keep the backup in place try { Files.move( - tmpFile.toPath(), - backingStorage.toPath(), - StandardCopyOption.REPLACE_EXISTING, - StandardCopyOption.ATOMIC_MOVE); + tmpFile.toPath(), + backingStorage.toPath(), + StandardCopyOption.REPLACE_EXISTING, + StandardCopyOption.ATOMIC_MOVE); } catch (AtomicMoveNotSupportedException ignored) { // in case some dumb system/jre combination would cause this // or if **somehow** two file inside the same directory belongs two separate filesystem diff --git a/src/main/java/gregtech/api/util/GT_CircuitryBehavior.java b/src/main/java/gregtech/api/util/GT_CircuitryBehavior.java index a8a39e341c..b15627bb05 100644 --- a/src/main/java/gregtech/api/util/GT_CircuitryBehavior.java +++ b/src/main/java/gregtech/api/util/GT_CircuitryBehavior.java @@ -37,13 +37,11 @@ public abstract class GT_CircuitryBehavior { public static boolean getAnyRedstone(IRedstoneCircuitBlock aRedstoneCircuitBlock) { for (byte side : ALL_VALID_SIDES) { if (side != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(side) - .letsRedstoneGoIn( - side, - aRedstoneCircuitBlock.getCoverID( - side), - aRedstoneCircuitBlock.getCoverVariable( - side), - aRedstoneCircuitBlock.getOwnTileEntity())) { + .letsRedstoneGoIn( + side, + aRedstoneCircuitBlock.getCoverID(side), + aRedstoneCircuitBlock.getCoverVariable(side), + aRedstoneCircuitBlock.getOwnTileEntity())) { if (aRedstoneCircuitBlock.getInputRedstone(side) > 0) { return true; } @@ -58,13 +56,11 @@ public abstract class GT_CircuitryBehavior { public static boolean getAllRedstone(IRedstoneCircuitBlock aRedstoneCircuitBlock) { for (byte side : ALL_VALID_SIDES) { if (side != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(side) - .letsRedstoneGoIn( - side, - aRedstoneCircuitBlock.getCoverID( - side), - aRedstoneCircuitBlock.getCoverVariable( - side), - aRedstoneCircuitBlock.getOwnTileEntity())) { + .letsRedstoneGoIn( + side, + aRedstoneCircuitBlock.getCoverID(side), + aRedstoneCircuitBlock.getCoverVariable(side), + aRedstoneCircuitBlock.getOwnTileEntity())) { if (aRedstoneCircuitBlock.getInputRedstone(side) == 0) { return false; } @@ -80,13 +76,11 @@ public abstract class GT_CircuitryBehavior { int tRedstoneAmount = 0; for (byte side : ALL_VALID_SIDES) { if (side != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(side) - .letsRedstoneGoIn( - side, - aRedstoneCircuitBlock.getCoverID( - side), - aRedstoneCircuitBlock.getCoverVariable( - side), - aRedstoneCircuitBlock.getOwnTileEntity())) { + .letsRedstoneGoIn( + side, + aRedstoneCircuitBlock.getCoverID(side), + aRedstoneCircuitBlock.getCoverVariable(side), + aRedstoneCircuitBlock.getOwnTileEntity())) { if (aRedstoneCircuitBlock.getInputRedstone(side) > 0) { tRedstoneAmount++; } @@ -102,13 +96,11 @@ public abstract class GT_CircuitryBehavior { byte tRedstoneAmount = 0; for (byte side : ALL_VALID_SIDES) { if (side != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(side) - .letsRedstoneGoIn( - side, - aRedstoneCircuitBlock.getCoverID( - side), - aRedstoneCircuitBlock.getCoverVariable( - side), - aRedstoneCircuitBlock.getOwnTileEntity())) { + .letsRedstoneGoIn( + side, + aRedstoneCircuitBlock.getCoverID(side), + aRedstoneCircuitBlock.getCoverVariable(side), + aRedstoneCircuitBlock.getOwnTileEntity())) { tRedstoneAmount = (byte) Math.max(tRedstoneAmount, aRedstoneCircuitBlock.getInputRedstone(side)); } } @@ -127,13 +119,11 @@ public abstract class GT_CircuitryBehavior { byte tRedstoneAmount = 15; for (byte side : ALL_VALID_SIDES) { if (side != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(side) - .letsRedstoneGoIn( - side, - aRedstoneCircuitBlock.getCoverID( - side), - aRedstoneCircuitBlock.getCoverVariable( - side), - aRedstoneCircuitBlock.getOwnTileEntity())) { + .letsRedstoneGoIn( + side, + aRedstoneCircuitBlock.getCoverID(side), + aRedstoneCircuitBlock.getCoverVariable(side), + aRedstoneCircuitBlock.getOwnTileEntity())) { if (aRedstoneCircuitBlock.getInputRedstone(side) > 0) tRedstoneAmount = (byte) Math.min(tRedstoneAmount, aRedstoneCircuitBlock.getInputRedstone(side)); } @@ -149,13 +139,11 @@ public abstract class GT_CircuitryBehavior { byte tRedstoneAmount = 15; for (byte side : ALL_VALID_SIDES) { if (side != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(side) - .letsRedstoneGoIn( - side, - aRedstoneCircuitBlock.getCoverID( - side), - aRedstoneCircuitBlock.getCoverVariable( - side), - aRedstoneCircuitBlock.getOwnTileEntity())) { + .letsRedstoneGoIn( + side, + aRedstoneCircuitBlock.getCoverID(side), + aRedstoneCircuitBlock.getCoverVariable(side), + aRedstoneCircuitBlock.getOwnTileEntity())) { tRedstoneAmount = (byte) Math.min(tRedstoneAmount, aRedstoneCircuitBlock.getInputRedstone(side)); } } @@ -195,7 +183,7 @@ public abstract class GT_CircuitryBehavior { * If the ItemStack should be displayed. Parameters are between 0 and 3. */ public abstract boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, - int aIndex); + int aIndex); /** * The Name of the Gate for the GUI diff --git a/src/main/java/gregtech/api/util/GT_ClientPreference.java b/src/main/java/gregtech/api/util/GT_ClientPreference.java index 0d5e39c1a8..e48af386cb 100644 --- a/src/main/java/gregtech/api/util/GT_ClientPreference.java +++ b/src/main/java/gregtech/api/util/GT_ClientPreference.java @@ -7,7 +7,7 @@ public class GT_ClientPreference { private final boolean mInputBusInitialFilter; public GT_ClientPreference(boolean mSingleBlockInitialFilter, boolean mSingleBlockInitialMultiStack, - boolean mInputBusInitialFilter) { + boolean mInputBusInitialFilter) { this.mSingleBlockInitialFilter = mSingleBlockInitialFilter; this.mSingleBlockInitialMultiStack = mSingleBlockInitialMultiStack; this.mInputBusInitialFilter = mInputBusInitialFilter; @@ -15,10 +15,8 @@ public class GT_ClientPreference { public GT_ClientPreference(GT_Config aClientDataFile) { this.mSingleBlockInitialFilter = aClientDataFile.get("preference", "mSingleBlockInitialFilter", false); - this.mSingleBlockInitialMultiStack = aClientDataFile.get( - "preference", - "mSingleBlockInitialAllowMultiStack", - false); + this.mSingleBlockInitialMultiStack = aClientDataFile + .get("preference", "mSingleBlockInitialAllowMultiStack", false); this.mInputBusInitialFilter = aClientDataFile.get("preference", "mInputBusInitialFilter", true); } diff --git a/src/main/java/gregtech/api/util/GT_Config.java b/src/main/java/gregtech/api/util/GT_Config.java index 40bff73ac7..36585559c2 100644 --- a/src/main/java/gregtech/api/util/GT_Config.java +++ b/src/main/java/gregtech/api/util/GT_Config.java @@ -33,10 +33,10 @@ public class GT_Config implements Runnable { public static int addIDConfig(Object aCategory, String aName, int aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = sConfigFileIDs.get( - aCategory.toString() - .replaceAll("\\|", "."), - aName.replaceAll("\\|", "."), - aDefault); + aCategory.toString() + .replaceAll("\\|", "."), + aName.replaceAll("\\|", "."), + aDefault); int rResult = tProperty.getInt(aDefault); if (!tProperty.wasRead() && shouldSave()) sConfigFileIDs.save(); return rResult; @@ -52,7 +52,7 @@ public class GT_Config implements Runnable { /* Do nothing */ } String sName = aStack.getItem() - .toString(); + .toString(); String[] tmp = sName.split("@"); if (tmp.length > 0) sName = tmp[0]; return sName + "." + aStack.getItemDamage(); @@ -66,10 +66,10 @@ public class GT_Config implements Runnable { public boolean get(Object aCategory, String aName, boolean aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString() - .replaceAll("\\|", "_"), - (aName + "_" + aDefault).replaceAll("\\|", "_"), - aDefault); + aCategory.toString() + .replaceAll("\\|", "_"), + (aName + "_" + aDefault).replaceAll("\\|", "_"), + aDefault); boolean rResult = tProperty.getBoolean(aDefault); if (!tProperty.wasRead() && shouldSave()) mConfig.save(); return rResult; @@ -82,10 +82,10 @@ public class GT_Config implements Runnable { public int get(Object aCategory, String aName, int aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString() - .replaceAll("\\|", "_"), - (aName + "_" + aDefault).replaceAll("\\|", "_"), - aDefault); + aCategory.toString() + .replaceAll("\\|", "_"), + (aName + "_" + aDefault).replaceAll("\\|", "_"), + aDefault); int rResult = tProperty.getInt(aDefault); if (!tProperty.wasRead() && shouldSave()) mConfig.save(); return rResult; @@ -98,10 +98,10 @@ public class GT_Config implements Runnable { public double get(Object aCategory, String aName, double aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString() - .replaceAll("\\|", "_"), - (aName + "_" + aDefault).replaceAll("\\|", "_"), - aDefault); + aCategory.toString() + .replaceAll("\\|", "_"), + (aName + "_" + aDefault).replaceAll("\\|", "_"), + aDefault); double rResult = tProperty.getDouble(aDefault); if (!tProperty.wasRead() && shouldSave()) mConfig.save(); return rResult; @@ -114,10 +114,10 @@ public class GT_Config implements Runnable { public String get(Object aCategory, String aName, String aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString() - .replaceAll("\\|", "_"), - (aName + "_" + aDefault).replaceAll("\\|", "_"), - aDefault); + aCategory.toString() + .replaceAll("\\|", "_"), + (aName + "_" + aDefault).replaceAll("\\|", "_"), + aDefault); String rResult = tProperty.getString(); if (!tProperty.wasRead() && shouldSave()) mConfig.save(); return rResult; @@ -130,10 +130,10 @@ public class GT_Config implements Runnable { public String[] get(Object aCategory, String aName, String... aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString() - .replaceAll("\\|", "_"), - aName.replaceAll("\\|", "_"), - aDefault); + aCategory.toString() + .replaceAll("\\|", "_"), + aName.replaceAll("\\|", "_"), + aDefault); String[] rResult = tProperty.getStringList(); if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save(); return rResult; diff --git a/src/main/java/gregtech/api/util/GT_CoverBehavior.java b/src/main/java/gregtech/api/util/GT_CoverBehavior.java index f12da42700..60196bd236 100644 --- a/src/main/java/gregtech/api/util/GT_CoverBehavior.java +++ b/src/main/java/gregtech/api/util/GT_CoverBehavior.java @@ -48,13 +48,13 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl @Override protected boolean isRedstoneSensitiveImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, long aTimer) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, long aTimer) { return isRedstoneSensitive(aSide, aCoverID, aCoverVariable.get(), aTileEntity, aTimer); } @Override protected ISerializableObject.LegacyCoverData doCoverThingsImpl(byte aSide, byte aInputRedstone, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, long aTimer) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, long aTimer) { if (aCoverVariable == null) aCoverVariable = new ISerializableObject.LegacyCoverData(); aCoverVariable.set(doCoverThings(aSide, aInputRedstone, aCoverID, aCoverVariable.get(), aTileEntity, aTimer)); return aCoverVariable; @@ -62,158 +62,158 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl @Override protected boolean onCoverRightClickImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, - float aY, float aZ) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, + float aY, float aZ) { return onCoverRightclick(aSide, aCoverID, convert(aCoverVariable), aTileEntity, aPlayer, aX, aY, aZ); } @Override protected ISerializableObject.LegacyCoverData onCoverScrewdriverClickImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, - float aY, float aZ) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, + float aY, float aZ) { if (aCoverVariable == null) aCoverVariable = new ISerializableObject.LegacyCoverData(); - aCoverVariable.set( - onCoverScrewdriverclick(aSide, aCoverID, convert(aCoverVariable), aTileEntity, aPlayer, aX, aY, aZ)); + aCoverVariable + .set(onCoverScrewdriverclick(aSide, aCoverID, convert(aCoverVariable), aTileEntity, aPlayer, aX, aY, aZ)); return aCoverVariable; } @Override protected boolean onCoverShiftRightClickImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer) { return onCoverShiftRightclick(aSide, aCoverID, convert(aCoverVariable), aTileEntity, aPlayer); } @Deprecated @Override protected Object getClientGUIImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { + ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { return getClientGUI(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected boolean onCoverRemovalImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity, boolean aForced) { + ICoverable aTileEntity, boolean aForced) { return onCoverRemoval(aSide, aCoverID, convert(aCoverVariable), aTileEntity, aForced); } @Override protected String getDescriptionImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getDescription(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected float getBlastProofLevelImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getBlastProofLevel(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected boolean letsRedstoneGoInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsRedstoneGoIn(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected boolean letsRedstoneGoOutImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { return letsRedstoneGoOut(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected boolean letsFibreGoInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsFibreGoIn(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected boolean letsFibreGoOutImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsFibreGoOut(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected boolean letsEnergyInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsEnergyIn(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected boolean letsEnergyOutImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsEnergyOut(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected boolean letsFluidInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - Fluid aFluid, ICoverable aTileEntity) { + Fluid aFluid, ICoverable aTileEntity) { return letsFluidIn(aSide, aCoverID, convert(aCoverVariable), aFluid, aTileEntity); } @Override protected boolean letsFluidOutImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - Fluid aFluid, ICoverable aTileEntity) { + Fluid aFluid, ICoverable aTileEntity) { return letsFluidOut(aSide, aCoverID, convert(aCoverVariable), aFluid, aTileEntity); } @Override protected boolean letsItemsInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - int aSlot, ICoverable aTileEntity) { + int aSlot, ICoverable aTileEntity) { return letsItemsIn(aSide, aCoverID, convert(aCoverVariable), aSlot, aTileEntity); } @Override protected boolean letsItemsOutImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - int aSlot, ICoverable aTileEntity) { + int aSlot, ICoverable aTileEntity) { return letsItemsOut(aSide, aCoverID, convert(aCoverVariable), aSlot, aTileEntity); } @Override protected boolean isGUIClickableImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return isGUIClickable(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected boolean manipulatesSidedRedstoneOutputImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { return manipulatesSidedRedstoneOutput(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected boolean alwaysLookConnectedImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { return alwaysLookConnected(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected byte getRedstoneInputImpl(byte aSide, byte aInputRedstone, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { return getRedstoneInput(aSide, aInputRedstone, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected int getTickRateImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getTickRate(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected byte getLensColorImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getLensColor(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } @Override protected ItemStack getDropImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getDrop(aSide, aCoverID, convert(aCoverVariable), aTileEntity); } // endregion public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - long aTimer) { + long aTimer) { return true; } @@ -221,7 +221,7 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl * Called by updateEntity inside the covered TileEntity. aCoverVariable is the Value you returned last time. */ public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - long aTimer) { + long aTimer) { return aCoverVariable; } @@ -231,7 +231,7 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl * return true, if something actually happens. */ public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + EntityPlayer aPlayer, float aX, float aY, float aZ) { return false; } @@ -241,7 +241,7 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl * return the new Value of the Cover Variable */ public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + EntityPlayer aPlayer, float aX, float aY, float aZ) { return aCoverVariable; } @@ -249,7 +249,7 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl * Called when someone shift-rightclicks this Cover with no tool. Doesn't call @onCoverRightclick in this Case. */ public boolean onCoverShiftRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer) { + EntityPlayer aPlayer) { if (hasCoverGUI() && aPlayer instanceof EntityPlayerMP) { lastPlayer = aPlayer; mPlayerNotified = false; @@ -257,13 +257,13 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl GT_UIInfos.openCoverUI(aTileEntity, aPlayer, aSide); } else { GT_Values.NW.sendToPlayer( - new GT_Packet_TileEntityCoverGUI( - aSide, - aCoverID, - aCoverVariable, - aTileEntity, - (EntityPlayerMP) aPlayer), - (EntityPlayerMP) aPlayer); + new GT_Packet_TileEntityCoverGUI( + aSide, + aCoverID, + aCoverVariable, + aTileEntity, + (EntityPlayerMP) aPlayer), + (EntityPlayerMP) aPlayer); } return true; } @@ -280,7 +280,7 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl * getting broken, only if you break the Cover away from the Machine. */ public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - boolean aForced) { + boolean aForced) { return true; } @@ -387,7 +387,7 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl * Needs to return true for Covers, which have a Redstone Output on their Facing. */ public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return false; } @@ -403,7 +403,7 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl * Cover should @letsRedstoneGoIn or the aInputRedstone Parameter is always 0. */ public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsRedstoneGoIn(aSide, aCoverID, aCoverVariable, aTileEntity) ? aInputRedstone : 0; } diff --git a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java b/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java index 33e8c9b1ce..1757d0375a 100644 --- a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java +++ b/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java @@ -93,7 +93,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * @return null if none, otherwise return facade target block */ public final Block getFacadeBlock(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getFacadeBlockImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -104,7 +104,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * @return 0 if none, otherwise return facade target meta */ public final int getFacadeMeta(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getFacadeMetaImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -121,7 +121,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * overloads. */ public final ITexture getSpecialCoverFGTexture(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getSpecialCoverFGTextureImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -130,7 +130,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * {@link gregtech.api.GregTech_API#registerCover(ItemStack, ITexture, GT_CoverBehaviorBase)} or its overloads. */ public final ITexture getSpecialCoverTexture(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getSpecialCoverTextureImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -141,7 +141,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * {@link ICoverable#issueCoverUpdate(byte)} This option only affects the initial sync. */ public final boolean isDataNeededOnClient(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return isDataNeededOnClientImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -149,7 +149,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * Called upon receiving data from network. Use {@link ICoverable#isClientSide()} to determine the side. */ public final void onDataChanged(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { onDataChangedImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -157,14 +157,14 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * Called before receiving data from network. Use {@link ICoverable#isClientSide()} to determine the side. */ public final void preDataChanged(byte aSide, int aCoverID, int aNewCoverId, ISerializableObject aCoverVariable, - ISerializableObject aNewCoverVariable, ICoverable aTileEntity) { + ISerializableObject aNewCoverVariable, ICoverable aTileEntity) { preDataChangedImpl( - aSide, - aCoverID, - aNewCoverId, - forceCast(aCoverVariable), - forceCast(aNewCoverVariable), - aTileEntity); + aSide, + aCoverID, + aNewCoverId, + forceCast(aCoverVariable), + forceCast(aNewCoverVariable), + aTileEntity); } /** @@ -175,7 +175,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { } public final boolean isRedstoneSensitive(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, long aTimer) { + ICoverable aTileEntity, long aTimer) { return isRedstoneSensitiveImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aTimer); } @@ -183,7 +183,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * Called by updateEntity inside the covered TileEntity. aCoverVariable is the Value you returned last time. */ public final T doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, long aTimer) { + ICoverable aTileEntity, long aTimer) { return doCoverThingsImpl(aSide, aInputRedstone, aCoverID, forceCast(aCoverVariable), aTileEntity, aTimer); } @@ -193,7 +193,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * return true, if something actually happens. */ public final boolean onCoverRightClick(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { return onCoverRightClickImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aPlayer, aX, aY, aZ); } @@ -203,29 +203,29 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * return the new Value of the Cover Variable */ public final T onCoverScrewdriverClick(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { return onCoverScrewdriverClickImpl( - aSide, - aCoverID, - forceCast(aCoverVariable), - aTileEntity, - aPlayer, - aX, - aY, - aZ); + aSide, + aCoverID, + forceCast(aCoverVariable), + aTileEntity, + aPlayer, + aX, + aY, + aZ); } /** * Called when someone shift-rightclicks this Cover with no tool. Doesn't call @onCoverRightclick in this Case. */ public final boolean onCoverShiftRightClick(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, EntityPlayer aPlayer) { + ICoverable aTileEntity, EntityPlayer aPlayer) { return onCoverShiftRightClickImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aPlayer); } @Deprecated public final Object getClientGUI(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { + ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { return getClientGUIImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aPlayer, aWorld); } @@ -234,7 +234,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * getting broken, only if you break the Cover away from the Machine. */ public final boolean onCoverRemoval(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, boolean aForced) { + ICoverable aTileEntity, boolean aForced) { return onCoverRemovalImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aForced); } @@ -243,7 +243,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * survival. */ public final void onBaseTEDestroyed(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { onBaseTEDestroyedImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -251,7 +251,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * Gives a small Text for the status of the Cover. */ public final String getDescription(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getDescriptionImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -259,7 +259,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * How Blast Proof the Cover is. 30 is normal. */ public final float getBlastProofLevel(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getBlastProofLevelImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -269,7 +269,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * This is just Informative so that Machines know if their Redstone Input is blocked or not */ public final boolean letsRedstoneGoIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsRedstoneGoInImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -277,7 +277,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * If it lets RS-Signals out of the Block */ public final boolean letsRedstoneGoOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsRedstoneGoOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -287,7 +287,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * This is just Informative so that Machines know if their Redstone Input is blocked or not */ public final boolean letsFibreGoIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsFibreGoInImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -295,7 +295,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * If it lets Fibre-Signals out of the Block */ public final boolean letsFibreGoOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsFibreGoOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -303,7 +303,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * If it lets Energy into the Block */ public final boolean letsEnergyIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsEnergyInImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -311,7 +311,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * If it lets Energy out of the Block */ public final boolean letsEnergyOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsEnergyOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -319,7 +319,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * If it lets Liquids into the Block, aFluid can be null meaning if this is generally allowing Fluids or not. */ public final boolean letsFluidIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsFluidInImpl(aSide, aCoverID, forceCast(aCoverVariable), aFluid, aTileEntity); } @@ -327,7 +327,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * If it lets Liquids out of the Block, aFluid can be null meaning if this is generally allowing Fluids or not. */ public final boolean letsFluidOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsFluidOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aFluid, aTileEntity); } @@ -337,7 +337,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * Slot). */ public final boolean letsItemsIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable, int aSlot, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsItemsInImpl(aSide, aCoverID, forceCast(aCoverVariable), aSlot, aTileEntity); } @@ -347,7 +347,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * Slot). */ public final boolean letsItemsOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable, int aSlot, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsItemsOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aSlot, aTileEntity); } @@ -355,7 +355,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * If it lets you rightclick the Machine normally */ public final boolean isGUIClickable(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return isGUIClickableImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -363,7 +363,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * Needs to return true for Covers, which have a Redstone Output on their Facing. */ public final boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return manipulatesSidedRedstoneOutputImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -371,7 +371,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * if this Cover should let Pipe Connections look connected even if it is not the case. */ public final boolean alwaysLookConnected(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return alwaysLookConnectedImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -380,7 +380,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * Cover should @letsRedstoneGoIn or the aInputRedstone Parameter is always 0. */ public final byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, - ISerializableObject aCoverVariable, ICoverable aTileEntity) { + ISerializableObject aCoverVariable, ICoverable aTileEntity) { return getRedstoneInputImpl(aSide, aInputRedstone, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -397,7 +397,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * The MC Color of this Lens. -1 for no Color (meaning this isn't a Lens then). */ public final byte getLensColor(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getLensColorImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -405,7 +405,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * @return the ItemStack dropped by this Cover */ public final ItemStack getDrop(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getDropImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } // endregion @@ -450,8 +450,8 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { addUIWidgets(builder); if (getUIBuildContext().isAnotherWindow()) { builder.widget( - ButtonWidget.closeWindowButton(true) - .setPos(getGUIWidth() - 15, 3)); + ButtonWidget.closeWindowButton(true) + .setPos(getGUIWidth() - 15, 3)); } return builder.build(); } @@ -472,8 +472,8 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { public T getCoverData() { if (isCoverValid()) { return forceCast( - getUIBuildContext().getTile() - .getComplexCoverDataAtSide(getUIBuildContext().getCoverSide())); + getUIBuildContext().getTile() + .getComplexCoverDataAtSide(getUIBuildContext().getCoverSide())); } else { return null; } @@ -482,13 +482,13 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { public boolean setCoverData(T data) { if (isCoverValid()) { getUIBuildContext().getTile() - .receiveCoverData( - getUIBuildContext().getCoverSide(), - getUIBuildContext().getCoverID(), - data, - getUIBuildContext().getPlayer() instanceof EntityPlayerMP - ? (EntityPlayerMP) getUIBuildContext().getPlayer() - : null); + .receiveCoverData( + getUIBuildContext().getCoverSide(), + getUIBuildContext().getCoverID(), + data, + getUIBuildContext().getPlayer() instanceof EntityPlayerMP + ? (EntityPlayerMP) getUIBuildContext().getPlayer() + : null); return true; } else { return false; @@ -497,22 +497,21 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { public boolean isCoverValid() { return !getUIBuildContext().getTile() - .isDead() - && getUIBuildContext().getTile() - .getCoverBehaviorAtSideNew(getUIBuildContext().getCoverSide()) - != GregTech_API.sNoBehavior; + .isDead() + && getUIBuildContext().getTile() + .getCoverBehaviorAtSideNew(getUIBuildContext().getCoverSide()) != GregTech_API.sNoBehavior; } protected void addTitleToUI(ModularWindow.Builder builder) { ItemStack coverItem = GT_Utility.intToStack(getUIBuildContext().getCoverID()); if (coverItem != null) { builder.widget( - new ItemDrawable(coverItem).asWidget() - .setPos(5, 5) - .setSize(16, 16)) - .widget( - new TextWidget(coverItem.getDisplayName()).setDefaultColor(COLOR_TITLE.get()) - .setPos(25, 9)); + new ItemDrawable(coverItem).asWidget() + .setPos(5, 5) + .setSize(16, 16)) + .widget( + new TextWidget(coverItem.getDisplayName()).setDefaultColor(COLOR_TITLE.get()) + .setPos(25, 9)); } } @@ -554,7 +553,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { } protected ITexture getSpecialCoverFGTextureImpl(byte aSide, int aCoverID, T aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return coverFGTexture; } @@ -569,14 +568,14 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { protected void onDataChangedImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {} protected void preDataChangedImpl(byte aSide, int aCoverID, int aNewCoverId, T aCoverVariable, T aNewCoverVariable, - ICoverable aTileEntity) {} + ICoverable aTileEntity) {} protected void onDroppedImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {} protected void onBaseTEDestroyedImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {} protected boolean isRedstoneSensitiveImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, - long aTimer) { + long aTimer) { return false; } @@ -584,7 +583,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * Called by updateEntity inside the covered TileEntity. aCoverVariable is the Value you returned last time. */ protected T doCoverThingsImpl(byte aSide, byte aInputRedstone, int aCoverID, T aCoverVariable, - ICoverable aTileEntity, long aTimer) { + ICoverable aTileEntity, long aTimer) { return aCoverVariable; } @@ -594,7 +593,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * return true, if something actually happens. */ protected boolean onCoverRightClickImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + EntityPlayer aPlayer, float aX, float aY, float aZ) { return false; } @@ -604,7 +603,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * return the new Value of the Cover Variable */ protected T onCoverScrewdriverClickImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + EntityPlayer aPlayer, float aX, float aY, float aZ) { return aCoverVariable; } @@ -612,20 +611,20 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * Called when someone shift-rightclicks this Cover with no tool. Doesn't call @onCoverRightclick in this Case. */ protected boolean onCoverShiftRightClickImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer) { + EntityPlayer aPlayer) { if (hasCoverGUI() && aPlayer instanceof EntityPlayerMP) { lastPlayer = aPlayer; if (useModularUI()) { GT_UIInfos.openCoverUI(aTileEntity, aPlayer, aSide); } else { GT_Values.NW.sendToPlayer( - new GT_Packet_TileEntityCoverGUI( - aSide, - aCoverID, - aCoverVariable, - aTileEntity, - (EntityPlayerMP) aPlayer), - (EntityPlayerMP) aPlayer); + new GT_Packet_TileEntityCoverGUI( + aSide, + aCoverID, + aCoverVariable, + aTileEntity, + (EntityPlayerMP) aPlayer), + (EntityPlayerMP) aPlayer); } return true; } @@ -634,7 +633,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { @Deprecated protected Object getClientGUIImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, World aWorld) { + EntityPlayer aPlayer, World aWorld) { return null; } @@ -643,7 +642,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * getting broken, only if you break the Cover away from the Machine. */ protected boolean onCoverRemovalImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, - boolean aForced) { + boolean aForced) { return true; } @@ -711,7 +710,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * If it lets Liquids into the Block, aFluid can be null meaning if this is generally allowing Fluids or not. */ protected boolean letsFluidInImpl(byte aSide, int aCoverID, T aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return false; } @@ -719,7 +718,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * If it lets Liquids out of the Block, aFluid can be null meaning if this is generally allowing Fluids or not. */ protected boolean letsFluidOutImpl(byte aSide, int aCoverID, T aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return false; } @@ -752,7 +751,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * Needs to return true for Covers, which have a Redstone Output on their Facing. */ protected boolean manipulatesSidedRedstoneOutputImpl(byte aSide, int aCoverID, T aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return false; } @@ -768,7 +767,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * Cover should @letsRedstoneGoIn or the aInputRedstone Parameter is always 0. */ protected byte getRedstoneInputImpl(byte aSide, byte aInputRedstone, int aCoverID, T aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsRedstoneGoIn(aSide, aCoverID, aCoverVariable, aTileEntity) ? aInputRedstone : 0; } @@ -825,7 +824,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * return true, if something actually happens. */ public boolean onCoverRightclickClient(byte aSide, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { return false; } diff --git a/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java b/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java index 9ca7a16031..dbb14222c0 100644 --- a/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java +++ b/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java @@ -24,7 +24,7 @@ public class GT_ExoticEnergyInputHelper { public static void register(Class<? extends GT_MetaTileEntity_Hatch> clazz) { if (!GT_MetaTileEntity_Hatch.class.isAssignableFrom(clazz)) throw new IllegalArgumentException( - clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName()); + clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName()); sExoticEnergyHatchType.add(clazz); } @@ -37,18 +37,18 @@ public class GT_ExoticEnergyInputHelper { return; } if (!GT_MetaTileEntity_Hatch.class.isAssignableFrom(clazz)) throw new IllegalArgumentException( - clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName()); + clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName()); sExoticEnergyHatchType.add((Class<? extends GT_MetaTileEntity_Hatch>) clazz); } public static boolean drainEnergy(long aEU, Collection<? extends GT_MetaTileEntity_Hatch> hatches) { for (GT_MetaTileEntity_Hatch tHatch : hatches) { long tDrain = Math.min( - tHatch.getBaseMetaTileEntity() - .getStoredEU(), - aEU); + tHatch.getBaseMetaTileEntity() + .getStoredEU(), + aEU); tHatch.getBaseMetaTileEntity() - .decreaseStoredEnergyUnits(tDrain, false); + .decreaseStoredEnergyUnits(tDrain, false); aEU -= tDrain; } return aEU <= 0; @@ -65,8 +65,7 @@ public class GT_ExoticEnergyInputHelper { long rEU = 0L; for (GT_MetaTileEntity_Hatch tHatch : hatches) if (isValidMetaTileEntity(tHatch)) rEU += tHatch.getBaseMetaTileEntity() - .getInputVoltage() - * tHatch.maxWorkingAmperesIn(); + .getInputVoltage() * tHatch.maxWorkingAmperesIn(); return rEU; } @@ -74,7 +73,7 @@ public class GT_ExoticEnergyInputHelper { long rVoltage = 0; for (GT_MetaTileEntity_Hatch tHatch : hatches) if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity() - .getInputVoltage(); + .getInputVoltage(); return rVoltage; } @@ -85,7 +84,7 @@ public class GT_ExoticEnergyInputHelper { } for (GT_MetaTileEntity_Hatch tHatch : hatches) if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity() - .getInputVoltage(); + .getInputVoltage(); return rVoltage / hatches.size(); } @@ -93,7 +92,7 @@ public class GT_ExoticEnergyInputHelper { long rAmp = 0; for (GT_MetaTileEntity_Hatch tHatch : hatches) if (isValidMetaTileEntity(tHatch)) rAmp += tHatch.getBaseMetaTileEntity() - .getInputAmperage(); + .getInputAmperage(); return rAmp; } diff --git a/src/main/java/gregtech/api/util/GT_FoodStat.java b/src/main/java/gregtech/api/util/GT_FoodStat.java index b658f3abe5..5eda76f9d0 100644 --- a/src/main/java/gregtech/api/util/GT_FoodStat.java +++ b/src/main/java/gregtech/api/util/GT_FoodStat.java @@ -33,7 +33,7 @@ public class GT_FoodStat implements IFoodStat { * III] The likelihood that this Potion Effect takes place upon being eaten [1 - 100] */ public GT_FoodStat(int aFoodLevel, float aSaturation, EnumAction aAction, ItemStack aEmptyContainer, - boolean aAlwaysEdible, boolean aInvisibleParticles, boolean aIsRotten, int... aPotionEffects) { + boolean aAlwaysEdible, boolean aInvisibleParticles, boolean aIsRotten, int... aPotionEffects) { mFoodLevel = aFoodLevel; mSaturation = aSaturation; mAction = aAction == null ? EnumAction.eat : aAction; @@ -72,12 +72,11 @@ public class GT_FoodStat implements IFoodStat { aPlayer.dropPlayerItemWithRandomChoice(tStack, true); new WorldSpawnedEventBuilder.SoundAtEntityEventBuilder().setIdentifier(SoundResource.RANDOM_BURP) - .setVolume(0.5F) - .setPitch( - aPlayer.worldObj.rand.nextFloat() * 0.1F + 0.9F) - .setEntity(aPlayer) - .setWorld(aPlayer.worldObj) - .run(); + .setVolume(0.5F) + .setPitch(aPlayer.worldObj.rand.nextFloat() * 0.1F + 0.9F) + .setEntity(aPlayer) + .setWorld(aPlayer.worldObj) + .run(); if (!aPlayer.worldObj.isRemote) { if (mMilk) { @@ -86,24 +85,21 @@ public class GT_FoodStat implements IFoodStat { for (int i = 3; i < mPotionEffects.length; i += 4) { if (aPlayer.worldObj.rand.nextInt(100) < mPotionEffects[i]) { aPlayer.addPotionEffect( - new PotionEffect( - mPotionEffects[i - 3], - mPotionEffects[i - 2], - mPotionEffects[i - 1], - mInvisibleParticles)); + new PotionEffect( + mPotionEffects[i - 3], + mPotionEffects[i - 2], + mPotionEffects[i - 1], + mInvisibleParticles)); } } if (mExplosive) { new WorldSpawnedEventBuilder.ExplosionEffectEventBuilder().setSmoking(true) - .setFlaming(true) - .setStrength(4f) - .setPosition( - aPlayer.posX, - aPlayer.posY, - aPlayer.posZ) - .setEntity(aPlayer) - .setWorld(aPlayer.worldObj) - .run(); + .setFlaming(true) + .setStrength(4f) + .setPosition(aPlayer.posX, aPlayer.posY, aPlayer.posZ) + .setEntity(aPlayer) + .setWorld(aPlayer.worldObj) + .run(); aPlayer.attackEntityFrom(GT_DamageSources.getExplodingDamage(), Float.MAX_VALUE); } } diff --git a/src/main/java/gregtech/api/util/GT_Forestry_Compat.java b/src/main/java/gregtech/api/util/GT_Forestry_Compat.java index 95efdf40f0..933c379db1 100644 --- a/src/main/java/gregtech/api/util/GT_Forestry_Compat.java +++ b/src/main/java/gregtech/api/util/GT_Forestry_Compat.java @@ -17,111 +17,111 @@ public class GT_Forestry_Compat { public static void populateFakeNeiRecipes() { if (ItemList.FR_Bee_Drone.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Bee_Drone.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Bee_Drone.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Bee_Princess.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Bee_Princess.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Bee_Princess.getWithName(1L, "Scanned Princess") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Bee_Princess.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Bee_Princess.getWithName(1L, "Scanned Princess") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Bee_Queen.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Bee_Queen.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Bee_Queen.getWithName(1L, "Scanned Queen") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Bee_Queen.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Bee_Queen.getWithName(1L, "Scanned Queen") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Tree_Sapling.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Tree_Sapling.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Tree_Sapling.getWithName(1L, "Scanned Sapling") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Tree_Sapling.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Tree_Sapling.getWithName(1L, "Scanned Sapling") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Butterfly.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Butterfly.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Butterfly.getWithName(1L, "Scanned Butterfly") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Butterfly.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Butterfly.getWithName(1L, "Scanned Butterfly") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Larvae.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Larvae.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Larvae.getWithName(1L, "Scanned Larvae") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Larvae.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Larvae.getWithName(1L, "Scanned Larvae") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Serum.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Serum.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Serum.getWithName(1L, "Scanned Serum") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Serum.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Serum.getWithName(1L, "Scanned Serum") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Caterpillar.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Caterpillar.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Caterpillar.getWithName(1L, "Scanned Caterpillar") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Caterpillar.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Caterpillar.getWithName(1L, "Scanned Caterpillar") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_PollenFertile.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_PollenFertile.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_PollenFertile.getWithName(1L, "Scanned Pollen") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_PollenFertile.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_PollenFertile.getWithName(1L, "Scanned Pollen") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } } @@ -135,31 +135,31 @@ public class GT_Forestry_Compat { for (Map.Entry<ItemStack, Float> entry : outputs.entrySet()) { tChances[i] = (int) (entry.getValue() * 10000); tOutputs[i] = entry.getKey() - .copy(); + .copy(); i++; } GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( - true, - new ItemStack[] { tRecipe.getInput() }, - tOutputs, - null, - tChances, - null, - null, - 128, - 5, - 0); + true, + new ItemStack[] { tRecipe.getInput() }, + tOutputs, + null, + tChances, + null, + null, + 128, + 5, + 0); GT_Recipe.GT_Recipe_Map.sMultiblockCentrifugeRecipes.addRecipe( - true, - new ItemStack[] { tRecipe.getInput() }, - tOutputs, - null, - tChances, - null, - null, - 128, - 5, - 0); + true, + new ItemStack[] { tRecipe.getInput() }, + tOutputs, + null, + tChances, + null, + null, + 128, + 5, + 0); } } catch (Throwable e) { if (GT_Values.D1) { @@ -173,16 +173,16 @@ public class GT_Forestry_Compat { for (ISqueezerRecipe tRecipe : RecipeManagers.squeezerManager.recipes()) { if ((tRecipe.getResources().length == 1) && (tRecipe.getFluidOutput() != null)) { GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe( - true, - new ItemStack[] { tRecipe.getResources()[0] }, - new ItemStack[] { tRecipe.getRemnants() }, - null, - new int[] { (int) (tRecipe.getRemnantsChance() * 10000) }, - null, - new FluidStack[] { tRecipe.getFluidOutput() }, - 32, - 8, - 0); + true, + new ItemStack[] { tRecipe.getResources()[0] }, + new ItemStack[] { tRecipe.getRemnants() }, + null, + new int[] { (int) (tRecipe.getRemnantsChance() * 10000) }, + null, + new FluidStack[] { tRecipe.getFluidOutput() }, + 32, + 8, + 0); } } } catch (Throwable e) { diff --git a/src/main/java/gregtech/api/util/GT_GC_Compat.java b/src/main/java/gregtech/api/util/GT_GC_Compat.java index 23b4a42930..3b9bd5bda9 100644 --- a/src/main/java/gregtech/api/util/GT_GC_Compat.java +++ b/src/main/java/gregtech/api/util/GT_GC_Compat.java @@ -18,21 +18,19 @@ public class GT_GC_Compat { // GC Compat if (GregTech_API.mGalacticraft && tTileEntity instanceof IEnergyHandlerGC) { if (!(tTileEntity instanceof IConnector) - || ((IConnector) tTileEntity).canConnect(tDirection, NetworkType.POWER)) { + || ((IConnector) tTileEntity).canConnect(tDirection, NetworkType.POWER)) { EnergySource eSource = new EnergySourceAdjacent(tDirection); float tSizeToReceive = aVoltage * EnergyConfigHandler.IC2_RATIO, - tStored = ((IEnergyHandlerGC) tTileEntity).getEnergyStoredGC(eSource); + tStored = ((IEnergyHandlerGC) tTileEntity).getEnergyStoredGC(eSource); if (tSizeToReceive >= tStored - || tSizeToReceive <= ((IEnergyHandlerGC) tTileEntity).getMaxEnergyStoredGC(eSource) - tStored) { + || tSizeToReceive <= ((IEnergyHandlerGC) tTileEntity).getMaxEnergyStoredGC(eSource) - tStored) { float tReceived = ((IEnergyHandlerGC) tTileEntity).receiveEnergyGC(eSource, tSizeToReceive, false); if (tReceived > 0) { tSizeToReceive -= tReceived; while (tSizeToReceive > 0) { - tReceived = ((IEnergyHandlerGC) tTileEntity).receiveEnergyGC( - eSource, - tSizeToReceive, - false); + tReceived = ((IEnergyHandlerGC) tTileEntity) + .receiveEnergyGC(eSource, tSizeToReceive, false); if (tReceived < 1) break; tSizeToReceive -= tReceived; } @@ -48,8 +46,8 @@ public class GT_GC_Compat { public static boolean canConnect(TileEntity tTileEntity, ForgeDirection tDirection) { // GC Compat if (GregTech_API.mGalacticraft && tTileEntity instanceof IEnergyHandlerGC - && (!(tTileEntity instanceof IConnector) - || ((IConnector) tTileEntity).canConnect(tDirection, NetworkType.POWER))) + && (!(tTileEntity instanceof IConnector) + || ((IConnector) tTileEntity).canConnect(tDirection, NetworkType.POWER))) return true; return false; } diff --git a/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java b/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java index c3057f3caa..ba9e3b9773 100644 --- a/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java +++ b/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java @@ -58,21 +58,21 @@ public class GT_HatchElementBuilder<T> { public final GT_HatchElementBuilder<T> anyOf(IHatchElement<? super T>... elements) { if (elements == null || elements.length == 0) throw new IllegalArgumentException(); return adder( - Arrays.stream(elements) - .map( - e -> e.adder() - .rebrand()) - .reduce(IGT_HatchAdder::orElse) - .get()).hatchClasses( - Arrays.stream(elements) - .map(IHatchElement::mteClasses) - .flatMap(Collection::stream) - .collect(Collectors.toList())) - .cacheHint( - () -> Arrays.stream(elements) - .map(IHatchElement::name) - .sorted() - .collect(Collectors.joining(" or ", "of type ", ""))); + Arrays.stream(elements) + .map( + e -> e.adder() + .rebrand()) + .reduce(IGT_HatchAdder::orElse) + .get()).hatchClasses( + Arrays.stream(elements) + .map(IHatchElement::mteClasses) + .flatMap(Collection::stream) + .collect(Collectors.toList())) + .cacheHint( + () -> Arrays.stream(elements) + .map(IHatchElement::name) + .sorted() + .collect(Collectors.joining(" or ", "of type ", ""))); } /** @@ -84,8 +84,8 @@ public class GT_HatchElementBuilder<T> { public final GT_HatchElementBuilder<T> atLeast(IHatchElement<? super T>... elements) { if (elements == null || elements.length == 0) throw new IllegalArgumentException(); return atLeast( - Arrays.stream(elements) - .collect(Collectors.groupingBy(Function.identity(), LinkedHashMap::new, Collectors.counting()))); + Arrays.stream(elements) + .collect(Collectors.groupingBy(Function.identity(), LinkedHashMap::new, Collectors.counting()))); } /** @@ -96,9 +96,8 @@ public class GT_HatchElementBuilder<T> { public final GT_HatchElementBuilder<T> atLeastList(List<IHatchElement<? super T>> elements) { if (elements == null || elements.isEmpty()) throw new IllegalArgumentException(); return atLeast( - elements.stream() - .collect( - Collectors.groupingBy(Function.identity(), LinkedHashMap::new, Collectors.counting()))); + elements.stream() + .collect(Collectors.groupingBy(Function.identity(), LinkedHashMap::new, Collectors.counting()))); } /** @@ -108,57 +107,51 @@ public class GT_HatchElementBuilder<T> { if (elements == null || elements.isEmpty() || elements.containsKey(null) || elements.containsValue(null)) throw new IllegalArgumentException(); List<Class<? extends IMetaTileEntity>> list = elements.keySet() - .stream() - .map(IHatchElement::mteClasses) - .flatMap(Collection::stream) - .collect(Collectors.toList()); + .stream() + .map(IHatchElement::mteClasses) + .flatMap(Collection::stream) + .collect(Collectors.toList()); // map cannot be null or empty, so assert Optional isPresent return adder( - elements.keySet() - .stream() - .map( - e -> e.adder() - .rebrand()) - .reduce(IGT_HatchAdder::orElse) - .orElseThrow(AssertionError::new)) - .hatchItemFilter( - obj -> GT_StructureUtility.filterByMTEClass( - elements.entrySet() - .stream() - .filter( - entry -> entry.getKey() - .count(obj) - < entry.getValue() - .longValue()) - .flatMap( - entry -> entry.getKey() - .mteClasses() - .stream()) - .collect(Collectors.toList()))) - .shouldReject( - obj -> elements.entrySet() - .stream() - .allMatch( - e -> e.getKey() - .count(obj) - >= e.getValue() - .longValue())) - .shouldSkip( - (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) ( - c, t) -> t != null && list.stream() - .anyMatch( - clazz -> clazz.isInstance( - t.getMetaTileEntity()))) - .cacheHint( - () -> elements.keySet() - .stream() - .map(IHatchElement::name) - .sorted() - .collect( - Collectors.joining( - " or ", - "of type ", - ""))); + elements.keySet() + .stream() + .map( + e -> e.adder() + .rebrand()) + .reduce(IGT_HatchAdder::orElse) + .orElseThrow(AssertionError::new)) + .hatchItemFilter( + obj -> GT_StructureUtility.filterByMTEClass( + elements.entrySet() + .stream() + .filter( + entry -> entry.getKey() + .count(obj) + < entry.getValue() + .longValue()) + .flatMap( + entry -> entry.getKey() + .mteClasses() + .stream()) + .collect(Collectors.toList()))) + .shouldReject( + obj -> elements.entrySet() + .stream() + .allMatch( + e -> e.getKey() + .count(obj) + >= e.getValue() + .longValue())) + .shouldSkip( + (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c, + t) -> t != null && list.stream() + .anyMatch(clazz -> clazz.isInstance(t.getMetaTileEntity()))) + .cacheHint( + () -> elements.keySet() + .stream() + .map(IHatchElement::name) + .sorted() + .collect(Collectors.joining(" or ", "of type ", ""))); } // endregion @@ -198,34 +191,34 @@ public class GT_HatchElementBuilder<T> { } public GT_HatchElementBuilder<T> hatchItemFilter( - Function<? super T, ? extends Predicate<ItemStack>> aHatchItemFilter) { + Function<? super T, ? extends Predicate<ItemStack>> aHatchItemFilter) { if (aHatchItemFilter == null) throw new IllegalArgumentException(); mHatchItemFilter = (t, s) -> aHatchItemFilter.apply(t); return this; } public GT_HatchElementBuilder<T> hatchItemFilterAnd( - Function<? super T, ? extends Predicate<ItemStack>> aHatchItemFilter) { + Function<? super T, ? extends Predicate<ItemStack>> aHatchItemFilter) { if (aHatchItemFilter == null) throw new IllegalArgumentException(); BiFunction<? super T, ItemStack, ? extends Predicate<ItemStack>> tOldFilter = mHatchItemFilter; mHatchItemFilter = (t, s) -> tOldFilter.apply(t, s) - .and(aHatchItemFilter.apply(t)); + .and(aHatchItemFilter.apply(t)); return this; } public GT_HatchElementBuilder<T> hatchItemFilter( - BiFunction<? super T, ItemStack, ? extends Predicate<ItemStack>> aHatchItemFilter) { + BiFunction<? super T, ItemStack, ? extends Predicate<ItemStack>> aHatchItemFilter) { if (aHatchItemFilter == null) throw new IllegalArgumentException(); mHatchItemFilter = aHatchItemFilter; return this; } public GT_HatchElementBuilder<T> hatchItemFilterAnd( - BiFunction<? super T, ItemStack, ? extends Predicate<ItemStack>> aHatchItemFilter) { + BiFunction<? super T, ItemStack, ? extends Predicate<ItemStack>> aHatchItemFilter) { if (aHatchItemFilter == null) throw new IllegalArgumentException(); BiFunction<? super T, ItemStack, ? extends Predicate<ItemStack>> tOldFilter = mHatchItemFilter; mHatchItemFilter = (t, s) -> tOldFilter.apply(t, s) - .and(aHatchItemFilter.apply(t, s)); + .and(aHatchItemFilter.apply(t, s)); return this; } @@ -297,14 +290,11 @@ public class GT_HatchElementBuilder<T> { // region intermediate public GT_HatchElementBuilder<T> hatchClass(Class<? extends IMetaTileEntity> clazz) { - return hatchItemFilter( - c -> is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is))).cacheHint( - () -> "of class " + clazz.getSimpleName()) - .shouldSkip( - (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) ( - c, - t) -> clazz.isInstance( - t.getMetaTileEntity())); + return hatchItemFilter(c -> is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is))) + .cacheHint(() -> "of class " + clazz.getSimpleName()) + .shouldSkip( + (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c, t) -> clazz + .isInstance(t.getMetaTileEntity())); } @SafeVarargs @@ -315,26 +305,22 @@ public class GT_HatchElementBuilder<T> { public final GT_HatchElementBuilder<T> hatchClasses(List<? extends Class<? extends IMetaTileEntity>> classes) { List<? extends Class<? extends IMetaTileEntity>> list = new ArrayList<>(classes); return hatchItemFilter(obj -> GT_StructureUtility.filterByMTEClass(list)).cacheHint( - () -> list.stream() - .map(Class::getSimpleName) - .sorted() - .collect(Collectors.joining(" or ", "of class ", ""))) - .shouldSkip( - (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) ( - c, t) -> t != null - && list.stream() - .anyMatch( - clazz -> clazz.isInstance( - t.getMetaTileEntity()))); + () -> list.stream() + .map(Class::getSimpleName) + .sorted() + .collect(Collectors.joining(" or ", "of class ", ""))) + .shouldSkip( + (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c, t) -> t != null && list.stream() + .anyMatch(clazz -> clazz.isInstance(t.getMetaTileEntity()))); } public GT_HatchElementBuilder<T> hatchId(int aId) { return hatchItemFilter( - c -> is -> GT_Utility.isStackValid(is) && is.getItem() instanceof GT_Item_Machines - && is.getItemDamage() == aId).cacheHint(() -> "of id " + aId) - .shouldSkip( - (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) ( - c, t) -> t != null && t.getMetaTileID() == aId); + c -> is -> GT_Utility.isStackValid(is) && is.getItem() instanceof GT_Item_Machines + && is.getItemDamage() == aId).cacheHint(() -> "of id " + aId) + .shouldSkip( + (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c, t) -> t != null + && t.getMetaTileID() == aId); } public GT_HatchElementBuilder<T> hatchIds(int... aIds) { @@ -342,16 +328,15 @@ public class GT_HatchElementBuilder<T> { if (aIds.length == 1) return hatchId(aIds[0]); TIntCollection coll = aIds.length < 16 ? new TIntArrayList(aIds) : new TIntHashSet(aIds); return hatchItemFilter( - c -> is -> GT_Utility.isStackValid(is) && is.getItem() instanceof GT_Item_Machines - && coll.contains(is.getItemDamage())).cacheHint( - () -> Arrays.stream(coll.toArray()) - .sorted() - .mapToObj(String::valueOf) - .collect(Collectors.joining(" or ", "of id ", ""))) - .shouldSkip( - (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) ( - c, t) -> t != null && coll.contains( - t.getMetaTileID())); + c -> is -> GT_Utility.isStackValid(is) && is.getItem() instanceof GT_Item_Machines + && coll.contains(is.getItemDamage())).cacheHint( + () -> Arrays.stream(coll.toArray()) + .sorted() + .mapToObj(String::valueOf) + .collect(Collectors.joining(" or ", "of id ", ""))) + .shouldSkip( + (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c, t) -> t != null + && coll.contains(t.getMetaTileID())); } // endregion @@ -382,7 +367,7 @@ public class GT_HatchElementBuilder<T> { public boolean check(T t, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); return tileEntity instanceof IGregTechTileEntity - && mAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) mCasingIndex); + && mAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) mCasingIndex); } @Override @@ -400,7 +385,7 @@ public class GT_HatchElementBuilder<T> { public boolean check(T t, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); return tileEntity instanceof IGregTechTileEntity - && mAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) mCasingIndex); + && mAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) mCasingIndex); } @Override @@ -432,55 +417,54 @@ public class GT_HatchElementBuilder<T> { @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { return BlocksToPlace.create(mHatchItemFilter.apply(t, trigger)); } @Deprecated @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { + IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { return survivalPlaceBlock( - t, - world, - x, - y, - z, - trigger, - AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); + t, + world, + x, + y, + z, + trigger, + AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { if (mShouldSkip != null) { TileEntity tileEntity = world.getTileEntity(x, y, z); if (tileEntity instanceof IGregTechTileEntity - && mShouldSkip.test(t, (IGregTechTileEntity) tileEntity)) - return PlaceResult.SKIP; + && mShouldSkip.test(t, (IGregTechTileEntity) tileEntity)) return PlaceResult.SKIP; } if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, env.getActor())) return PlaceResult.REJECT; if (mReject != null && mReject.test(t)) return PlaceResult.REJECT; ItemStack taken = env.getSource() - .takeOne(mHatchItemFilter.apply(t, trigger), true); + .takeOne(mHatchItemFilter.apply(t, trigger), true); if (GT_Utility.isStackInvalid(taken)) { String type = getHint(); env.getChatter() - .accept(new ChatComponentTranslation("GT5U.autoplace.error.no_hatch", type)); + .accept(new ChatComponentTranslation("GT5U.autoplace.error.no_hatch", type)); return PlaceResult.REJECT; } if (StructureUtility.survivalPlaceBlock( - taken, - ItemStackPredicate.NBTMode.IGNORE, - null, - true, - world, - x, - y, - z, - env.getSource(), - env.getActor()) != PlaceResult.ACCEPT) { + taken, + ItemStackPredicate.NBTMode.IGNORE, + null, + true, + world, + x, + y, + z, + env.getSource(), + env.getActor()) != PlaceResult.ACCEPT) { return PlaceResult.REJECT; } // try to infer facing @@ -497,9 +481,7 @@ public class GT_HatchElementBuilder<T> { // explicitly rejected, probably obstructed by another slice if (mDisallowedDirection.contains(direction)) continue; ForgeDirection rotated = env.getFacing() - .getWorldDirection( - direction.offsetY != 0 ? direction.getOpposite() - : direction); + .getWorldDirection(direction.offsetY != 0 ? direction.getOpposite() : direction); allowed.add(rotated); } } diff --git a/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java b/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java index 7097e877bd..d6b41e69b0 100644 --- a/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java +++ b/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java @@ -13,6 +13,6 @@ public class GT_ItsNotMyFaultException extends RuntimeException { @Override public String toString() { return "The GregTech-Addon has a Problem.\nIT'S NOT MY FAULT!!! Below is how to fix it.\n" + mError - + "\nDO NOT COME TO ME WITH THIS CRASH. YOU CAUSED IT YOURSELF, AND I TOLD YOU HOW TO FIX IT!!!"; + + "\nDO NOT COME TO ME WITH THIS CRASH. YOU CAUSED IT YOURSELF, AND I TOLD YOU HOW TO FIX IT!!!"; } } diff --git a/src/main/java/gregtech/api/util/GT_LanguageManager.java b/src/main/java/gregtech/api/util/GT_LanguageManager.java index 26651b42a3..eeaa12a9ed 100644 --- a/src/main/java/gregtech/api/util/GT_LanguageManager.java +++ b/src/main/java/gregtech/api/util/GT_LanguageManager.java @@ -20,15 +20,15 @@ import gregtech.api.GregTech_API; public class GT_LanguageManager { public static final HashMap<String, String> TEMPMAP = new HashMap<>(), BUFFERMAP = new HashMap<>(), - LANGMAP = new HashMap<>(); + LANGMAP = new HashMap<>(); public static Configuration sEnglishFile; public static String sLanguage = "en_US"; public static boolean sUseEnglishFile = false; public static boolean i18nPlaceholder = true; public static String FACE_ANY = "gt.lang.face.any", FACE_BOTTOM = "gt.lang.face.bottom", - FACE_TOP = "gt.lang.face.top", FACE_LEFT = "gt.lang.face.left", FACE_FRONT = "gt.lang.face.front", - FACE_RIGHT = "gt.lang.face.right", FACE_BACK = "gt.lang.face.back", FACE_NONE = "gt.lang.face.none"; + FACE_TOP = "gt.lang.face.top", FACE_LEFT = "gt.lang.face.left", FACE_FRONT = "gt.lang.face.front", + FACE_RIGHT = "gt.lang.face.right", FACE_BACK = "gt.lang.face.back", FACE_NONE = "gt.lang.face.none"; public static String[] FACES = { FACE_BOTTOM, FACE_TOP, FACE_LEFT, FACE_FRONT, FACE_RIGHT, FACE_BACK, FACE_NONE }; @@ -36,17 +36,13 @@ public class GT_LanguageManager { static { try { - Field fieldStringTranslateLanguageList = ReflectionHelper.findField( - net.minecraft.util.StringTranslate.class, - "languageList", - "field_74816_c"); - Field fieldStringTranslateInstance = ReflectionHelper.findField( - net.minecraft.util.StringTranslate.class, - "instance", - "field_74817_a"); + Field fieldStringTranslateLanguageList = ReflectionHelper + .findField(net.minecraft.util.StringTranslate.class, "languageList", "field_74816_c"); + Field fieldStringTranslateInstance = ReflectionHelper + .findField(net.minecraft.util.StringTranslate.class, "instance", "field_74817_a"); // noinspection unchecked - stringTranslateLanguageList = (Map<String, String>) fieldStringTranslateLanguageList.get( - fieldStringTranslateInstance.get(null)); + stringTranslateLanguageList = (Map<String, String>) fieldStringTranslateLanguageList + .get(fieldStringTranslateInstance.get(null)); } catch (Exception e) { e.printStackTrace(); } @@ -67,7 +63,7 @@ public class GT_LanguageManager { } TEMPMAP.put(aKey.trim(), aEnglish); LanguageRegistry.instance() - .injectLanguage(sLanguage, TEMPMAP); + .injectLanguage(sLanguage, TEMPMAP); TEMPMAP.clear(); if (sUseEnglishFile && !aWriteIntoLangFile) { if (!LANGMAP.containsKey(aKey)) { @@ -95,7 +91,7 @@ public class GT_LanguageManager { Property tProperty = sEnglishFile.get("LanguageFile", aKey.trim(), aEnglish); if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) sEnglishFile.save(); if (sEnglishFile.get("EnableLangFile", "UseThisFileAsLanguageFile", false) - .getBoolean(false)) { + .getBoolean(false)) { aEnglish = tProperty.getString(); sUseEnglishFile = true; } @@ -108,7 +104,7 @@ public class GT_LanguageManager { String tTrimmedKey = aKey.trim(), rTranslation; if (sUseEnglishFile) { rTranslation = LanguageRegistry.instance() - .getStringLocalization(tTrimmedKey); + .getStringLocalization(tTrimmedKey); } else { rTranslation = StatCollector.translateToLocal(tTrimmedKey); } @@ -148,7 +144,7 @@ public class GT_LanguageManager { NBTTagCompound tNBT = aStack.getTagCompound(); if (tNBT != null && tNBT.hasKey("display")) { String tName = tNBT.getCompoundTag("display") - .getString("Name"); + .getString("Name"); if (GT_Utility.isStringValid(tName)) { return tName; } @@ -219,13 +215,13 @@ public class GT_LanguageManager { addStringLocalization("Interaction_DESCRIPTION_Index_065", "Emit if 5 Maintenance Needed(inverted)"); addStringLocalization("Interaction_DESCRIPTION_Index_066", "Emit if rotor needs maintenance low accuracy mod"); addStringLocalization( - "Interaction_DESCRIPTION_Index_067", - "Emit if rotor needs maintenance low accuracy mod(inverted)"); + "Interaction_DESCRIPTION_Index_067", + "Emit if rotor needs maintenance low accuracy mod(inverted)"); addStringLocalization("Interaction_DESCRIPTION_Index_068", "Emit if rotor needs maintenance high accuracy mod"); addStringLocalization("Interaction_DESCRIPTION_Index_068.1", "Emit if any Player is close"); addStringLocalization( - "Interaction_DESCRIPTION_Index_069", - "Emit if rotor needs maintenance high accuracy mod(inverted)"); + "Interaction_DESCRIPTION_Index_069", + "Emit if rotor needs maintenance high accuracy mod(inverted)"); addStringLocalization("Interaction_DESCRIPTION_Index_069.1", "Emit if other Player is close"); addStringLocalization("Interaction_DESCRIPTION_Index_070", "Emit if you are close"); addStringLocalization("Interaction_DESCRIPTION_Index_071", "Conducts strongest Input"); @@ -373,8 +369,8 @@ public class GT_LanguageManager { addStringLocalization("Interaction_DESCRIPTION_Index_204", "No Pollution in Chunk! HAYO!"); addStringLocalization("Interaction_DESCRIPTION_Index_206", "Scan for Assembly Line"); addStringLocalization( - "Interaction_DESCRIPTION_Index_207", - "Pump speed: %dL every %d ticks, %.2f L/sec on average"); + "Interaction_DESCRIPTION_Index_207", + "Pump speed: %dL every %d ticks, %.2f L/sec on average"); addStringLocalization("Interaction_DESCRIPTION_Index_208", " L"); addStringLocalization("Interaction_DESCRIPTION_Index_209", " ticks"); addStringLocalization("Interaction_DESCRIPTION_Index_209.1", " tick"); @@ -391,8 +387,8 @@ public class GT_LanguageManager { addStringLocalization("Interaction_DESCRIPTION_Index_222", "Fluid threshold"); addStringLocalization("Interaction_DESCRIPTION_Index_222.1", "Energy threshold"); addStringLocalization( - "Interaction_DESCRIPTION_Index_223", - "Single recipe locking enabled. Will lock to next recipe."); + "Interaction_DESCRIPTION_Index_223", + "Single recipe locking enabled. Will lock to next recipe."); addStringLocalization("Interaction_DESCRIPTION_Index_224", "Always On"); addStringLocalization("Interaction_DESCRIPTION_Index_225", "Active with Redstone Signal"); addStringLocalization("Interaction_DESCRIPTION_Index_226", "Inactive with Redstone Signal"); @@ -436,8 +432,8 @@ public class GT_LanguageManager { addStringLocalization("Interaction_DESCRIPTION_Index_262", "Fluid Auto Output Disabled"); addStringLocalization("Interaction_DESCRIPTION_Index_263", "Fluid Auto Output Enabled"); addStringLocalization( - "Interaction_DESCRIPTION_Index_264", - "currently none, will be locked to the next that is put in"); + "Interaction_DESCRIPTION_Index_264", + "currently none, will be locked to the next that is put in"); addStringLocalization("Interaction_DESCRIPTION_Index_265", "1 specific Fluid"); addStringLocalization("Interaction_DESCRIPTION_Index_266", "Lock Fluid Mode Disabled"); addStringLocalization("Interaction_DESCRIPTION_Index_267", "Overflow Voiding Mode Disabled"); diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java index 3ed707822a..58cadd9d7d 100644 --- a/src/main/java/gregtech/api/util/GT_ModHandler.java +++ b/src/main/java/gregtech/api/util/GT_ModHandler.java @@ -84,7 +84,7 @@ public class GT_ModHandler { private static final Map<String, ItemStack> sIC2ItemMap = new HashMap<>(); private static final List<IRecipe> sAllRecipeList = new ArrayList<>(5000), - sBufferRecipeList = new ArrayList<>(1000); + sBufferRecipeList = new ArrayList<>(1000); private static final List<ItemStack> delayedRemovalByOutput = new ArrayList<>(); private static final List<InventoryCrafting> delayedRemovalByRecipe = new ArrayList<>(); @@ -106,50 +106,50 @@ public class GT_ModHandler { private static final ItemStack sMt1 = new ItemStack(Blocks.dirt, 1, 0), sMt2 = new ItemStack(Blocks.dirt, 1, 0); private static final String s_H = "h", s_F = "f", s_I = "I", s_P = "P", s_R = "R"; private static final ItemStack[][] sShapes1 = new ItemStack[][] { - { sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null }, - { sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1 }, - { null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1 }, - { sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null }, - { sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1 }, - { sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1 }, - { null, null, null, sMt1, null, sMt1, sMt1, null, sMt1 }, - { null, sMt1, null, null, sMt1, null, null, sMt2, null }, - { sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null }, - { null, sMt1, null, null, sMt2, null, null, sMt2, null }, - { sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null }, - { null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null }, - { sMt1, sMt1, null, null, sMt2, null, null, sMt2, null }, - { null, sMt1, sMt1, null, sMt2, null, null, sMt2, null }, - { null, sMt1, null, sMt1, null, null, null, sMt1, sMt2 }, - { null, sMt1, null, null, null, sMt1, sMt2, sMt1, null }, - { null, sMt1, null, sMt1, null, sMt1, null, null, sMt2 }, - { null, sMt1, null, sMt1, null, sMt1, sMt2, null, null }, - { null, sMt2, null, null, sMt1, null, null, sMt1, null }, - { null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1 }, - { null, sMt2, null, null, sMt2, null, null, sMt1, null }, - { null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null }, - { null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1 }, - { null, sMt2, null, null, sMt2, null, sMt1, sMt1, null }, - { sMt1, null, null, null, sMt2, null, null, null, sMt2 }, - { null, null, sMt1, null, sMt2, null, sMt2, null, null }, - { sMt1, null, null, null, sMt2, null, null, null, null }, - { null, null, sMt1, null, sMt2, null, null, null, null }, - { sMt1, sMt2, null, null, null, null, null, null, null }, - { sMt2, sMt1, null, null, null, null, null, null, null }, - { sMt1, null, null, sMt2, null, null, null, null, null }, - { sMt2, null, null, sMt1, null, null, null, null, null }, - { sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null }, - { sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null }, - { null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1 }, - { null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1 }, - { sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null }, - { sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null }, - { null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1 }, - { null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1 }, - { sMt1, null, null, null, sMt1, null, null, null, null }, - { null, sMt1, null, sMt1, null, null, null, null, null }, - { sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null }, - { null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2 } }; + { sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null }, + { sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1 }, + { null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1 }, + { sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null }, + { sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1 }, + { sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1 }, + { null, null, null, sMt1, null, sMt1, sMt1, null, sMt1 }, + { null, sMt1, null, null, sMt1, null, null, sMt2, null }, + { sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null }, + { null, sMt1, null, null, sMt2, null, null, sMt2, null }, + { sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null }, + { null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null }, + { sMt1, sMt1, null, null, sMt2, null, null, sMt2, null }, + { null, sMt1, sMt1, null, sMt2, null, null, sMt2, null }, + { null, sMt1, null, sMt1, null, null, null, sMt1, sMt2 }, + { null, sMt1, null, null, null, sMt1, sMt2, sMt1, null }, + { null, sMt1, null, sMt1, null, sMt1, null, null, sMt2 }, + { null, sMt1, null, sMt1, null, sMt1, sMt2, null, null }, + { null, sMt2, null, null, sMt1, null, null, sMt1, null }, + { null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1 }, + { null, sMt2, null, null, sMt2, null, null, sMt1, null }, + { null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null }, + { null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1 }, + { null, sMt2, null, null, sMt2, null, sMt1, sMt1, null }, + { sMt1, null, null, null, sMt2, null, null, null, sMt2 }, + { null, null, sMt1, null, sMt2, null, sMt2, null, null }, + { sMt1, null, null, null, sMt2, null, null, null, null }, + { null, null, sMt1, null, sMt2, null, null, null, null }, + { sMt1, sMt2, null, null, null, null, null, null, null }, + { sMt2, sMt1, null, null, null, null, null, null, null }, + { sMt1, null, null, sMt2, null, null, null, null, null }, + { sMt2, null, null, sMt1, null, null, null, null, null }, + { sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null }, + { sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null }, + { null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1 }, + { null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1 }, + { sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null }, + { sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null }, + { null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1 }, + { null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1 }, + { sMt1, null, null, null, sMt1, null, null, null, null }, + { null, sMt1, null, sMt1, null, null, null, null, null }, + { sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null }, + { null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2 } }; public static List<Integer> sSingleNonBlockDamagableRecipeList_validsShapes1 = new ArrayList<>(44); public static boolean sSingleNonBlockDamagableRecipeList_validsShapes1_update = false; public static List<Integer> sSingleNonBlockDamagableRecipeList_warntOutput = new ArrayList<>(50); @@ -397,10 +397,8 @@ public class GT_ModHandler { if (GT_Utility.isStringInvalid(aItem) || !GregTech_API.sPreloadStarted) { result = null; } else { - result = GT_Utility.copyAmount( - aAmount, - GameRegistry.findItemStack(aModID, aItem, (int) aAmount), - aReplacement); + result = GT_Utility + .copyAmount(aAmount, GameRegistry.findItemStack(aModID, aItem, (int) aAmount), aReplacement); } if (result == null) { @@ -413,10 +411,10 @@ public class GT_ModHandler { reason = "the item was not found in the game registry"; } String log_message = "getModItem call: object \"" + aItem - + "\" with mod id \"" - + aModID - + "\" has returned null because " - + reason; + + "\" with mod id \"" + + aModID + + "\" has returned null because " + + reason; GT_Log.out.println(log_message); new Exception().printStackTrace(GT_Log.out); } @@ -472,8 +470,8 @@ public class GT_ModHandler { if (aValue <= 0) return false; try { Class.forName("ic2.core.IC2") - .getMethod("addValuableOre", IRecipeInput.class, int.class) - .invoke(null, new RecipeInputItemStack(new ItemStack(aBlock, 1, aMeta)), aValue); + .getMethod("addValuableOre", IRecipeInput.class, int.class) + .invoke(null, new RecipeInputItemStack(new ItemStack(aBlock, 1, aMeta)), aValue); } catch (Throwable e) { /* Do nothing */ } @@ -492,21 +490,21 @@ public class GT_ModHandler { if (aChance <= 0) return false; try { GT_Utility.callMethod( - GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true, true), - "addDrop", - true, - false, - true, - GT_Utility.copyOrNull(aOutput), - aChance); + GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true, true), + "addDrop", + true, + false, + true, + GT_Utility.copyOrNull(aOutput), + aChance); GT_Utility.callMethod( - GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true, true), - "addRecipe", - true, - true, - false, - GT_Utility.copyOrNull(aOutput), - aChance); + GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true, true), + "addRecipe", + true, + true, + false, + GT_Utility.copyOrNull(aOutput), + aChance); } catch (Throwable e) { /* Do nothing */ } @@ -534,7 +532,7 @@ public class GT_ModHandler { if (aInput == null || aOutput == null || GT_Utility.getContainerItem(aInput, false) != null) return false; if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.smelting, aInput, true)) return false; FurnaceRecipes.smelting() - .func_151394_a(aInput, GT_Utility.copyOrNull(aOutput), 0.0F); + .func_151394_a(aInput, GT_Utility.copyOrNull(aOutput), 0.0F); return true; } @@ -546,21 +544,21 @@ public class GT_ModHandler { boolean temp = false; if (aInput.stackSize == 1 && addSmeltingRecipe(aInput, aOutput)) temp = true; return (RA.addAlloySmelterRecipe( - aInput, - OrePrefixes.ingot.contains(aOutput) ? ItemList.Shape_Mold_Ingot.get(0) - : OrePrefixes.block.contains(aOutput) ? ItemList.Shape_Mold_Block.get(0) - : OrePrefixes.nugget.contains(aOutput) ? ItemList.Shape_Mold_Nugget.get(0) : null, - aOutput, - 130, - 3, - hidden)); + aInput, + OrePrefixes.ingot.contains(aOutput) ? ItemList.Shape_Mold_Ingot.get(0) + : OrePrefixes.block.contains(aOutput) ? ItemList.Shape_Mold_Block.get(0) + : OrePrefixes.nugget.contains(aOutput) ? ItemList.Shape_Mold_Nugget.get(0) : null, + aOutput, + 130, + 3, + hidden)); } /** * LiquidTransposer Recipe for both directions */ public static boolean addLiquidTransposerRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, - ItemStack aFullContainer, int aMJ) { + ItemStack aFullContainer, int aMJ) { return true; } @@ -568,7 +566,7 @@ public class GT_ModHandler { * LiquidTransposer Recipe for filling Containers */ public static boolean addLiquidTransposerFillRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, - ItemStack aFullContainer, int aMJ) { + ItemStack aFullContainer, int aMJ) { return true; } @@ -576,7 +574,7 @@ public class GT_ModHandler { * LiquidTransposer Recipe for emptying Containers */ public static boolean addLiquidTransposerEmptyRecipe(ItemStack aFullContainer, FluidStack aLiquid, - ItemStack aEmptyContainer, int aMJ) { + ItemStack aEmptyContainer, int aMJ) { return true; } @@ -608,7 +606,7 @@ public class GT_ModHandler { } public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, - int aChance) { + int aChance) { return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, false); } @@ -617,12 +615,12 @@ public class GT_ModHandler { } public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, - boolean aOverwrite) { + boolean aOverwrite) { return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, aOverwrite); } public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance, - boolean aOverwrite) { + boolean aOverwrite) { return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, null, 0, aOverwrite); } @@ -630,24 +628,24 @@ public class GT_ModHandler { * Adds Several Pulverizer-Type Recipes. */ public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, - ItemStack aOutput3, int aChance3, boolean aOverwrite) { + ItemStack aOutput3, int aChance3, boolean aOverwrite) { aOutput1 = GT_OreDictUnificator.get(true, aOutput1); aOutput2 = GT_OreDictUnificator.get(true, aOutput2); if (GT_Utility.isStackInvalid(aInput) || GT_Utility.isStackInvalid(aOutput1)) return false; if (GT_Utility.getContainerItem(aInput, false) == null) { RA.addPulveriserRecipe( - aInput, - new ItemStack[] { aOutput1, aOutput2, aOutput3 }, - new int[] { 10000, aChance2 <= 0 ? 1000 : 100 * aChance2, aChance3 <= 0 ? 1000 : 100 * aChance3 }, - 400, - 2); + aInput, + new ItemStack[] { aOutput1, aOutput2, aOutput3 }, + new int[] { 10000, aChance2 <= 0 ? 1000 : 100 * aChance2, aChance3 <= 0 ? 1000 : 100 * aChance3 }, + 400, + 2); } return true; } public static boolean addPulverisationRecipe(ItemStack aInputItem, ItemStack[] aOutputArray, int[] aChanceArray, - int aEUt, int aRecipeDurationInTicks) { + int aEUt, int aRecipeDurationInTicks) { ItemStack[] aUnifiedOutputArray = new ItemStack[aOutputArray.length]; int counter = 0; @@ -663,12 +661,12 @@ public class GT_ModHandler { } public static boolean addImmersiveEngineeringRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, - int aChance2, ItemStack aOutput3, int aChance3) { + int aChance2, ItemStack aOutput3, int aChance3) { return true; } public static boolean addMagneticraftRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, - ItemStack aOutput3, int aChance3) { + ItemStack aOutput3, int aChance3) { return true; } @@ -683,7 +681,7 @@ public class GT_ModHandler { * Induction Smelter Recipes and Alloy Smelter Recipes */ public static boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, - int aEUt, boolean aAllowSecondaryInputEmpty) { + int aEUt, boolean aAllowSecondaryInputEmpty) { if (aInput1 == null || (aInput2 == null && !aAllowSecondaryInputEmpty) || aOutput1 == null) return false; aOutput1 = GT_OreDictUnificator.get(true, aOutput1); return RA.addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt); @@ -693,7 +691,7 @@ public class GT_ModHandler { * Induction Smelter Recipes for TE */ public static boolean addInductionSmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, - ItemStack aOutput2, int aEnergy, int aChance) { + ItemStack aOutput2, int aEnergy, int aChance) { return true; } @@ -704,7 +702,7 @@ public class GT_ModHandler { aOutput = GT_OreDictUnificator.get(true, aOutput); if (aInput == null || aOutput == null) return false; FurnaceRecipes.smelting() - .func_151394_a(aInput, GT_Utility.copyOrNull(aOutput), 0.0F); + .func_151394_a(aInput, GT_Utility.copyOrNull(aOutput), 0.0F); return true; } @@ -712,32 +710,33 @@ public class GT_ModHandler { * Adds GT versions of the IC2 recipes from the supplied IC2RecipeList. */ public static void addIC2RecipesToGT(Map<IRecipeInput, RecipeOutput> aIC2RecipeList, - GT_Recipe.GT_Recipe_Map aGTRecipeMap, boolean aAddGTRecipe, boolean aRemoveIC2Recipe, - boolean aExcludeGTIC2Items) { + GT_Recipe.GT_Recipe_Map aGTRecipeMap, boolean aAddGTRecipe, boolean aRemoveIC2Recipe, + boolean aExcludeGTIC2Items) { Map<ItemStack, ItemStack> aRecipesToRemove = new HashMap<>(); for (Entry<IRecipeInput, RecipeOutput> iRecipeInputRecipeOutputEntry : aIC2RecipeList.entrySet()) { if (!iRecipeInputRecipeOutputEntry.getValue().items.isEmpty()) { for (ItemStack tStack : (iRecipeInputRecipeOutputEntry.getKey()).getInputs()) { if (GT_Utility.isStackValid(tStack)) { if (aAddGTRecipe - && (aGTRecipeMap.findRecipe(null, false, Long.MAX_VALUE, null, tStack) == null)) { + && (aGTRecipeMap.findRecipe(null, false, Long.MAX_VALUE, null, tStack) == null)) { try { if (aExcludeGTIC2Items && ((tStack.getUnlocalizedName() - .contains("gt.metaitem.01") - || tStack.getUnlocalizedName() - .contains("gt.blockores") - || tStack.getUnlocalizedName() - .contains("ic2.itemCrushed") - || tStack.getUnlocalizedName() - .contains("ic2.itemPurifiedCrushed")))) + .contains("gt.metaitem.01") + || tStack.getUnlocalizedName() + .contains("gt.blockores") + || tStack.getUnlocalizedName() + .contains("ic2.itemCrushed") + || tStack.getUnlocalizedName() + .contains("ic2.itemPurifiedCrushed")))) continue; switch (aGTRecipeMap.mUnlocalizedName) { - case "gt.recipe.macerator", "gt.recipe.extractor", "gt.recipe.compressor" -> aGTRecipeMap.addRecipe( + case "gt.recipe.macerator", "gt.recipe.extractor", "gt.recipe.compressor" -> aGTRecipeMap + .addRecipe( true, new ItemStack[] { GT_Utility.copyAmount( - iRecipeInputRecipeOutputEntry.getKey() - .getAmount(), - tStack) }, + iRecipeInputRecipeOutputEntry.getKey() + .getAmount(), + tStack) }, iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0]), null, null, @@ -747,19 +746,19 @@ public class GT_ModHandler { 2, 0); case "gt.recipe.thermalcentrifuge" -> aGTRecipeMap.addRecipe( - true, - new ItemStack[] { GT_Utility.copyAmount( - iRecipeInputRecipeOutputEntry.getKey() - .getAmount(), - tStack) }, - iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0]), - null, - null, - null, - null, - 500, - 48, - 0); + true, + new ItemStack[] { GT_Utility.copyAmount( + iRecipeInputRecipeOutputEntry.getKey() + .getAmount(), + tStack) }, + iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0]), + null, + null, + null, + null, + 500, + 48, + 0); } } catch (Exception e) { System.err.println(e); @@ -835,13 +834,13 @@ public class GT_ModHandler { if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false; if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.thermalcentrifuge, aInput, true)) return false; RA.addThermalCentrifugeRecipe( - aInput, - aOutput.length >= 1 ? (ItemStack) aOutput[0] : null, - aOutput.length >= 2 ? (ItemStack) aOutput[1] : null, - aOutput.length >= 3 ? (ItemStack) aOutput[2] : null, - aChances, - 500, - 48); + aInput, + aOutput.length >= 1 ? (ItemStack) aOutput[0] : null, + aOutput.length >= 2 ? (ItemStack) aOutput[1] : null, + aOutput.length >= 3 ? (ItemStack) aOutput[2] : null, + aChances, + 500, + 48); return true; } @@ -849,12 +848,12 @@ public class GT_ModHandler { if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false; if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.thermalcentrifuge, aInput, true)) return false; RA.addThermalCentrifugeRecipe( - aInput, - aOutput.length >= 1 ? (ItemStack) aOutput[0] : null, - aOutput.length >= 2 ? (ItemStack) aOutput[1] : null, - aOutput.length >= 3 ? (ItemStack) aOutput[2] : null, - 500, - 48); + aInput, + aOutput.length >= 1 ? (ItemStack) aOutput[0] : null, + aOutput.length >= 2 ? (ItemStack) aOutput[1] : null, + aOutput.length >= 3 ? (ItemStack) aOutput[2] : null, + 500, + 48); return true; } @@ -865,23 +864,23 @@ public class GT_ModHandler { if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false; if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.orewashing, aInput, true)) return false; RA.addOreWasherRecipe( - aInput, - (ItemStack) aOutput[0], - (ItemStack) aOutput[1], - (ItemStack) aOutput[2], - GT_ModHandler.getWater(aWaterAmount), - aChances, - 500, - 16); + aInput, + (ItemStack) aOutput[0], + (ItemStack) aOutput[1], + (ItemStack) aOutput[2], + GT_ModHandler.getWater(aWaterAmount), + aChances, + 500, + 16); RA.addOreWasherRecipe( - aInput, - (ItemStack) aOutput[0], - (ItemStack) aOutput[1], - (ItemStack) aOutput[2], - GT_ModHandler.getDistilledWater(aWaterAmount / 5), - aChances, - 300, - 16); + aInput, + (ItemStack) aOutput[0], + (ItemStack) aOutput[1], + (ItemStack) aOutput[2], + GT_ModHandler.getDistilledWater(aWaterAmount / 5), + aChances, + 300, + 16); return true; } @@ -889,21 +888,21 @@ public class GT_ModHandler { if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false; if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.orewashing, aInput, true)) return false; RA.addOreWasherRecipe( - aInput, - (ItemStack) aOutput[0], - (ItemStack) aOutput[1], - (ItemStack) aOutput[2], - GT_ModHandler.getWater(aWaterAmount), - 500, - 16); + aInput, + (ItemStack) aOutput[0], + (ItemStack) aOutput[1], + (ItemStack) aOutput[2], + GT_ModHandler.getWater(aWaterAmount), + 500, + 16); RA.addOreWasherRecipe( - aInput, - (ItemStack) aOutput[0], - (ItemStack) aOutput[1], - (ItemStack) aOutput[2], - GT_ModHandler.getDistilledWater(aWaterAmount / 5), - 300, - 16); + aInput, + (ItemStack) aOutput[0], + (ItemStack) aOutput[1], + (ItemStack) aOutput[2], + GT_ModHandler.getDistilledWater(aWaterAmount / 5), + 300, + 16); return true; } @@ -934,14 +933,8 @@ public class GT_ModHandler { try { NBTTagCompound tNBT = new NBTTagCompound(); tNBT.setInteger("amplification", aValue); - GT_Utility.callMethod( - ic2.api.recipe.Recipes.matterAmplifier, - "addRecipe", - false, - false, - false, - aAmplifier, - tNBT); + GT_Utility + .callMethod(ic2.api.recipe.Recipes.matterAmplifier, "addRecipe", false, false, false, aAmplifier, tNBT); } catch (Throwable e) { /* Do nothing */ } @@ -956,11 +949,7 @@ public class GT_ModHandler { if (aResult == null || aRecipe == null || aResult.stackSize <= 0) return false; try { mods.railcraft.api.crafting.RailcraftCraftingManager.rollingMachine.getRecipeList() - .add( - new ShapedOreRecipe( - GT_Utility.copyOrNull( - aResult), - aRecipe)); + .add(new ShapedOreRecipe(GT_Utility.copyOrNull(aResult), aRecipe)); } catch (Throwable e) { return addCraftingRecipe(GT_Utility.copyOrNull(aResult), aRecipe); } @@ -983,25 +972,25 @@ public class GT_ModHandler { * Shapeless Crafting Recipes. Deletes conflicting Recipes too. */ public static boolean addCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, - int[] aEnchantmentLevelsAdded, Object[] aRecipe) { + int[] aEnchantmentLevelsAdded, Object[] aRecipe) { return addCraftingRecipe( - aResult, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - false, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - aRecipe); + aResult, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + aRecipe); } /** @@ -1046,34 +1035,34 @@ public class GT_ModHandler { */ public static boolean addCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) { return addCraftingRecipe( - aResult, - new Enchantment[0], - new int[0], - (aBitMask & RecipeBits.MIRRORED) != 0, - (aBitMask & RecipeBits.BUFFERED) != 0, - (aBitMask & RecipeBits.KEEPNBT) != 0, - (aBitMask & RecipeBits.DISMANTLEABLE) != 0, - (aBitMask & RecipeBits.NOT_REMOVABLE) == 0, - (aBitMask & RecipeBits.REVERSIBLE) != 0, - (aBitMask & RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0, - (aBitMask & RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0, - (aBitMask & RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0, - (aBitMask & RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0, - (aBitMask & RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0, - (aBitMask & RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0, - (aBitMask & RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0, - aRecipe); + aResult, + new Enchantment[0], + new int[0], + (aBitMask & RecipeBits.MIRRORED) != 0, + (aBitMask & RecipeBits.BUFFERED) != 0, + (aBitMask & RecipeBits.KEEPNBT) != 0, + (aBitMask & RecipeBits.DISMANTLEABLE) != 0, + (aBitMask & RecipeBits.NOT_REMOVABLE) == 0, + (aBitMask & RecipeBits.REVERSIBLE) != 0, + (aBitMask & RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0, + (aBitMask & RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0, + (aBitMask & RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0, + (aBitMask & RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0, + (aBitMask & RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0, + (aBitMask & RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0, + (aBitMask & RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0, + aRecipe); } /** * Internal realisation of the Crafting Recipe adding Process. */ private static boolean addCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, - int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, - boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, - boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, - boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, - boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { + int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, + boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, + boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, + boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, + boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { aResult = GT_OreDictUnificator.get(true, aResult); if (aOnlyAddIfResultIsNotNull && aResult == null) return false; if (aResult != null && Items.feather.getDamage(aResult) == W) Items.feather.setDamage(aResult, 0); @@ -1086,10 +1075,9 @@ public class GT_ModHandler { if (aRecipe[i] instanceof IItemContainer) aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); else if (aRecipe[i] instanceof Enum) aRecipe[i] = ((Enum<?>) aRecipe[i]).name(); else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack - || aRecipe[i] instanceof ItemData - || aRecipe[i] instanceof String - || aRecipe[i] instanceof Character)) - aRecipe[i] = aRecipe[i].toString(); + || aRecipe[i] instanceof ItemData + || aRecipe[i] instanceof String + || aRecipe[i] instanceof Character)) aRecipe[i] = aRecipe[i].toString(); } try { @@ -1108,7 +1096,7 @@ public class GT_ModHandler { if (s.length() > 3) throw new IllegalArgumentException(); for (char c : s.toString() - .toCharArray()) { + .toCharArray()) { switch (c) { case 'b' -> { tRecipeList.add(c); @@ -1185,8 +1173,8 @@ public class GT_ModHandler { if (aRecipe[idx] == null || aRecipe[idx + 1] == null) { if (D1) { GT_Log.err.println( - "WARNING: Missing Item for shaped Recipe: " - + (aResult == null ? "null" : aResult.getDisplayName())); + "WARNING: Missing Item for shaped Recipe: " + + (aResult == null ? "null" : aResult.getDisplayName())); for (Object tContent : aRecipe) GT_Log.err.println(tContent); } return false; @@ -1234,8 +1222,7 @@ public class GT_ModHandler { ItemData[] tData = new ItemData[9]; int x = -1; for (char chr : shape.toString() - .toCharArray()) - tData[++x] = tItemDataMap.get(chr); + .toCharArray()) tData[++x] = tItemDataMap.get(chr); if (GT_Utility.arrayContainsNonNull(tData)) GT_OreDictUnificator.addItemData(aResult, new ItemData(tData)); } @@ -1244,7 +1231,7 @@ public class GT_ModHandler { ItemStack[] tRecipe = new ItemStack[9]; int x = -1; for (char chr : shape.toString() - .toCharArray()) { + .toCharArray()) { tRecipe[++x] = tItemStackMap.get(chr); if (tRecipe[x] != null && Items.feather.getDamage(tRecipe[x]) == W) Items.feather.setDamage(tRecipe[x], 0); @@ -1260,25 +1247,25 @@ public class GT_ModHandler { if (aResult == null || aResult.stackSize <= 0) return false; if (aRemoveAllOthersWithSameOutput || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT - || aRemoveAllOtherShapedsWithSameOutput - || aRemoveAllOtherNativeRecipes) { + || aRemoveAllOtherShapedsWithSameOutput + || aRemoveAllOtherNativeRecipes) { if (tDoWeCareIfThereWasARecipe || !aBuffered) tThereWasARecipe = removeRecipeByOutput( - aResult, - !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, - aRemoveAllOtherShapedsWithSameOutput, - aRemoveAllOtherNativeRecipes) || tThereWasARecipe; + aResult, + !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, + aRemoveAllOtherShapedsWithSameOutput, + aRemoveAllOtherNativeRecipes) || tThereWasARecipe; else removeRecipeByOutputDelayed(aResult); } if (aOnlyAddIfThereIsAnyRecipeOutputtingThis && !tDoWeCareIfThereWasARecipe && !tThereWasARecipe) { ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); int tList_sS = tList.size(); for (int i = 0; i < tList_sS && !tThereWasARecipe; i++) { IRecipe tRecipe = tList.get(i); if (sSpecialRecipeClasses.contains( - tRecipe.getClass() - .getName())) + tRecipe.getClass() + .getName())) continue; if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) { tList.remove(i--); @@ -1295,23 +1282,23 @@ public class GT_ModHandler { if (tThereWasARecipe || !aOnlyAddIfThereIsAnyRecipeOutputtingThis) { if (sBufferCraftingRecipes && aBuffered) sBufferRecipeList.add( - new GT_Shaped_Recipe( - GT_Utility.copyOrNull(aResult), - aDismantleable, - aRemovable, - aKeepNBT, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - aRecipe).setMirrored(aMirrored)); + new GT_Shaped_Recipe( + GT_Utility.copyOrNull(aResult), + aDismantleable, + aRemovable, + aKeepNBT, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + aRecipe).setMirrored(aMirrored)); else GameRegistry.addRecipe( - new GT_Shaped_Recipe( - GT_Utility.copyOrNull(aResult), - aDismantleable, - aRemovable, - aKeepNBT, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - aRecipe).setMirrored(aMirrored)); + new GT_Shaped_Recipe( + GT_Utility.copyOrNull(aResult), + aDismantleable, + aRemovable, + aKeepNBT, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + aRecipe).setMirrored(aMirrored)); } return true; } @@ -1320,16 +1307,16 @@ public class GT_ModHandler { * Shapeless Crafting Recipes. Deletes conflicting Recipes too. */ public static boolean addShapelessEnchantingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, - int[] aEnchantmentLevelsAdded, Object[] aRecipe) { + int[] aEnchantmentLevelsAdded, Object[] aRecipe) { return addShapelessCraftingRecipe( - aResult, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - true, - false, - false, - false, - aRecipe); + aResult, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + true, + false, + false, + false, + aRecipe); } /** @@ -1337,9 +1324,9 @@ public class GT_ModHandler { */ public static boolean addShapelessCraftingRecipe(ItemStack aResult, Object[] aRecipe) { return addShapelessCraftingRecipe( - aResult, - RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | RecipeBits.BUFFERED, - aRecipe); + aResult, + RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | RecipeBits.BUFFERED, + aRecipe); } /** @@ -1347,31 +1334,30 @@ public class GT_ModHandler { */ public static boolean addShapelessCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) { return addShapelessCraftingRecipe( - aResult, - new Enchantment[0], - new int[0], - (aBitMask & RecipeBits.BUFFERED) != 0, - (aBitMask & RecipeBits.KEEPNBT) != 0, - (aBitMask & RecipeBits.DISMANTLEABLE) != 0, - (aBitMask & RecipeBits.NOT_REMOVABLE) == 0, - aRecipe); + aResult, + new Enchantment[0], + new int[0], + (aBitMask & RecipeBits.BUFFERED) != 0, + (aBitMask & RecipeBits.KEEPNBT) != 0, + (aBitMask & RecipeBits.DISMANTLEABLE) != 0, + (aBitMask & RecipeBits.NOT_REMOVABLE) == 0, + aRecipe); } /** * Shapeless Crafting Recipes. Deletes conflicting Recipes too. */ private static boolean addShapelessCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, - int[] aEnchantmentLevelsAdded, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, - boolean aRemovable, Object[] aRecipe) { + int[] aEnchantmentLevelsAdded, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, boolean aRemovable, + Object[] aRecipe) { aResult = GT_OreDictUnificator.get(true, aResult); if (aRecipe == null || aRecipe.length <= 0) return false; for (byte i = 0; i < aRecipe.length; i++) { if (aRecipe[i] instanceof IItemContainer) aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); else if (aRecipe[i] instanceof Enum) aRecipe[i] = ((Enum<?>) aRecipe[i]).name(); else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack - || aRecipe[i] instanceof String - || aRecipe[i] instanceof Character)) - aRecipe[i] = aRecipe[i].toString(); + || aRecipe[i] instanceof String + || aRecipe[i] instanceof Character)) aRecipe[i] = aRecipe[i].toString(); } try { ItemStack[] tRecipe = new ItemStack[9]; @@ -1379,8 +1365,8 @@ public class GT_ModHandler { for (Object tObject : aRecipe) { if (tObject == null) { if (D1) GT_Log.err.println( - "WARNING: Missing Item for shapeless Recipe: " - + (aResult == null ? "null" : aResult.getDisplayName())); + "WARNING: Missing Item for shapeless Recipe: " + + (aResult == null ? "null" : aResult.getDisplayName())); for (Object tContent : aRecipe) GT_Log.err.println(tContent); return false; } @@ -1406,23 +1392,23 @@ public class GT_ModHandler { GT_Utility.updateItemStack(aResult); if (sBufferCraftingRecipes && aBuffered) sBufferRecipeList.add( - new GT_Shapeless_Recipe( - GT_Utility.copyOrNull(aResult), - aDismantleable, - aRemovable, - aKeepNBT, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - aRecipe)); + new GT_Shapeless_Recipe( + GT_Utility.copyOrNull(aResult), + aDismantleable, + aRemovable, + aKeepNBT, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + aRecipe)); else GameRegistry.addRecipe( - new GT_Shapeless_Recipe( - GT_Utility.copyOrNull(aResult), - aDismantleable, - aRemovable, - aKeepNBT, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - aRecipe)); + new GT_Shapeless_Recipe( + GT_Utility.copyOrNull(aResult), + aDismantleable, + aRemovable, + aKeepNBT, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + aRecipe)); return true; } @@ -1432,12 +1418,12 @@ public class GT_ModHandler { public static boolean removeFurnaceSmelting(ItemStack aInput) { if (aInput != null) { for (ItemStack tInput : FurnaceRecipes.smelting() - .getSmeltingList() - .keySet()) { + .getSmeltingList() + .keySet()) { if (GT_Utility.isStackValid(tInput) && GT_Utility.areStacksEqual(aInput, tInput, true)) { FurnaceRecipes.smelting() - .getSmeltingList() - .remove(tInput); + .getSmeltingList() + .remove(tInput); return true; } } @@ -1451,11 +1437,10 @@ public class GT_ModHandler { public static boolean removeFurnaceSmeltingByOutput(ItemStack aOutput) { if (aOutput != null) { return FurnaceRecipes.smelting() - .getSmeltingList() - .values() - .removeIf( - tOutput -> GT_Utility.isStackValid(tOutput) - && GT_Utility.areStacksEqual(aOutput, tOutput, true)); + .getSmeltingList() + .values() + .removeIf( + tOutput -> GT_Utility.isStackValid(tOutput) && GT_Utility.areStacksEqual(aOutput, tOutput, true)); } return false; } @@ -1469,8 +1454,7 @@ public class GT_ModHandler { public static ItemStack removeRecipe(ItemStack... aRecipe) { if (aRecipe == null) return null; if (Arrays.stream(aRecipe) - .noneMatch(Objects::nonNull)) - return null; + .noneMatch(Objects::nonNull)) return null; ItemStack rReturn = null; InventoryCrafting aCrafting = new InventoryCrafting(new Container() { @@ -1482,16 +1466,16 @@ public class GT_ModHandler { }, 3, 3); for (int i = 0; i < aRecipe.length && i < 9; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]); ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); int tList_sS = tList.size(); try { for (int i = 0; i < tList_sS; i++) { for (; i < tList_sS; i++) { if ((!(tList.get(i) instanceof IGT_CraftingRecipe) - || ((IGT_CraftingRecipe) tList.get(i)).isRemovable()) && tList.get(i) - .matches(aCrafting, DW)) { + || ((IGT_CraftingRecipe) tList.get(i)).isRemovable()) && tList.get(i) + .matches(aCrafting, DW)) { rReturn = tList.get(i) - .getCraftingResult(aCrafting); + .getCraftingResult(aCrafting); if (rReturn != null) tList.remove(i--); tList_sS = tList.size(); } @@ -1511,8 +1495,7 @@ public class GT_ModHandler { if (aRecipe == null) return; if (Arrays.stream(aRecipe) - .noneMatch(Objects::nonNull)) - return; + .noneMatch(Objects::nonNull)) return; InventoryCrafting aCrafting = new InventoryCrafting(new Container() { @@ -1528,18 +1511,17 @@ public class GT_ModHandler { @SuppressWarnings("unchecked") public static void bulkRemoveByRecipe(List<InventoryCrafting> toRemove) { ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); GT_FML_LOGGER.info("BulkRemoveByRecipe: tList: " + tList.size() + " toRemove: " + toRemove.size()); Set<IRecipe> tListToRemove = tList.parallelStream() - .filter(tRecipe -> { - if ((tRecipe instanceof IGT_CraftingRecipe) - && !((IGT_CraftingRecipe) tRecipe).isRemovable()) - return false; - return toRemove.stream() - .anyMatch(aCrafting -> tRecipe.matches(aCrafting, DW)); - }) - .collect(Collectors.toSet()); + .filter(tRecipe -> { + if ((tRecipe instanceof IGT_CraftingRecipe) && !((IGT_CraftingRecipe) tRecipe).isRemovable()) + return false; + return toRemove.stream() + .anyMatch(aCrafting -> tRecipe.matches(aCrafting, DW)); + }) + .collect(Collectors.toSet()); tList.removeIf(tListToRemove::contains); } @@ -1550,7 +1532,7 @@ public class GT_ModHandler { } public static boolean removeRecipeByOutputDelayed(ItemStack aOutput, boolean aIgnoreNBT, - boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers) { + boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers) { if (sBufferCraftingRecipes && (aIgnoreNBT && !aNotRemoveShapelessRecipes && !aOnlyRemoveNativeHandlers)) // Too lazy to handle deferred versions of the parameters that aren't used very often return delayedRemovalByOutput.add(aOutput); @@ -1568,32 +1550,31 @@ public class GT_ModHandler { * @return if it has removed at least one Recipe. */ public static boolean removeRecipeByOutput(ItemStack aOutput, boolean aIgnoreNBT, - boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers) { + boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers) { if (aOutput == null) return false; boolean rReturn = false; ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); aOutput = GT_OreDictUnificator.get(aOutput); int tList_sS = tList.size(); for (int i = 0; i < tList_sS; i++) { IRecipe tRecipe = tList.get(i); if (aNotRemoveShapelessRecipes - && (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) - continue; + && (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) continue; if (aOnlyRemoveNativeHandlers) { if (!sNativeRecipeClasses.contains( - tRecipe.getClass() - .getName())) + tRecipe.getClass() + .getName())) continue; } else { if (sSpecialRecipeClasses.contains( - tRecipe.getClass() - .getName())) + tRecipe.getClass() + .getName())) continue; } ItemStack tStack = tRecipe.getRecipeOutput(); if ((!(tRecipe instanceof IGT_CraftingRecipe) || ((IGT_CraftingRecipe) tRecipe).isRemovable()) - && GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tStack), aOutput, aIgnoreNBT)) { + && GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tStack), aOutput, aIgnoreNBT)) { tList.remove(i--); tList_sS = tList.size(); rReturn = true; @@ -1604,33 +1585,27 @@ public class GT_ModHandler { public static boolean bulkRemoveRecipeByOutput(List<ItemStack> toRemove) { ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); Set<ItemStack> setToRemove = toRemove.parallelStream() - .map(GT_OreDictUnificator::get_nocopy) - .collect(Collectors.toSet()); + .map(GT_OreDictUnificator::get_nocopy) + .collect(Collectors.toSet()); GT_FML_LOGGER.info("BulkRemoveRecipeByOutput: tList: " + tList.size() + " setToRemove: " + setToRemove.size()); Set<IRecipe> tListToRemove = tList.parallelStream() - .filter(tRecipe -> { - if ((tRecipe instanceof IGT_CraftingRecipe) - && !((IGT_CraftingRecipe) tRecipe).isRemovable()) - return false; - if (sSpecialRecipeClasses.contains( - tRecipe.getClass() - .getName())) - return false; - final ItemStack tStack = GT_OreDictUnificator.get_nocopy( - tRecipe.getRecipeOutput()); - return setToRemove.stream() - .anyMatch( - aOutput -> GT_Utility.areStacksEqual( - tStack, - aOutput, - true)); - }) - .collect(Collectors.toSet()); + .filter(tRecipe -> { + if ((tRecipe instanceof IGT_CraftingRecipe) && !((IGT_CraftingRecipe) tRecipe).isRemovable()) + return false; + if (sSpecialRecipeClasses.contains( + tRecipe.getClass() + .getName())) + return false; + final ItemStack tStack = GT_OreDictUnificator.get_nocopy(tRecipe.getRecipeOutput()); + return setToRemove.stream() + .anyMatch(aOutput -> GT_Utility.areStacksEqual(tStack, aOutput, true)); + }) + .collect(Collectors.toSet()); tList.removeIf(tListToRemove::contains); return true; @@ -1661,7 +1636,7 @@ public class GT_ModHandler { }, 3, 3); for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]); List<IRecipe> tList = CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); synchronized (sAllRecipeList) { if (sAllRecipeList.size() != tList.size()) { sAllRecipeList.clear(); @@ -1693,12 +1668,12 @@ public class GT_ModHandler { if (tIndex == 2) { assert tStack1 != null && tStack2 != null; if (tStack1.getItem() == tStack2.getItem() && tStack1.stackSize == 1 - && tStack2.stackSize == 1 - && tStack1.getItem() - .isRepairable()) { + && tStack2.stackSize == 1 + && tStack1.getItem() + .isRepairable()) { int tNewDamage = tStack1.getMaxDamage() + tStack1.getItemDamage() - - tStack2.getItemDamage() - + tStack1.getMaxDamage() / 20; + - tStack2.getItemDamage() + + tStack1.getMaxDamage() / 20; return new ItemStack(tStack1.getItem(), 1, Math.max(tNewDamage, 0)); } } @@ -1727,8 +1702,7 @@ public class GT_ModHandler { @SuppressWarnings("unchecked") public static ItemStack getRecipeOutput(boolean aUncopiedStack, boolean allowOreDict, ItemStack... aRecipe) { if (aRecipe == null || Arrays.stream(aRecipe) - .noneMatch(Objects::nonNull)) - return null; + .noneMatch(Objects::nonNull)) return null; InventoryCrafting aCrafting = new InventoryCrafting(new Container() { @@ -1739,7 +1713,7 @@ public class GT_ModHandler { }, 3, 3); for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]); ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); boolean found = false; for (IRecipe iRecipe : tList) { @@ -1756,7 +1730,7 @@ public class GT_ModHandler { if (tOutput == null || tOutput.stackSize <= 0) { // Seriously, who would ever do that shit? if (!GregTech_API.sPostloadFinished) throw new GT_ItsNotMyFaultException( - "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); + "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); } else { if (aUncopiedStack) return tOutput; return GT_Utility.copyOrNull(tOutput); @@ -1775,22 +1749,22 @@ public class GT_ModHandler { sSingleNonBlockDamagableRecipeList.clear(); if (sSingleNonBlockDamagableRecipeList.isEmpty()) { for (IRecipe tRecipe : CraftingManager.getInstance() - .getRecipeList()) { + .getRecipeList()) { ItemStack tStack = tRecipe.getRecipeOutput(); if (GT_Utility.isStackValid(tStack) && tStack.getMaxStackSize() == 1 - && tStack.getMaxDamage() > 0 - && !(tStack.getItem() instanceof ItemBlock) - && !(tStack.getItem() instanceof IReactorComponent) - && !isElectricItem(tStack) - && !GT_Utility.isStackInList(tStack, sNonReplaceableItems)) { + && tStack.getMaxDamage() > 0 + && !(tStack.getItem() instanceof ItemBlock) + && !(tStack.getItem() instanceof IReactorComponent) + && !isElectricItem(tStack) + && !GT_Utility.isStackInList(tStack, sNonReplaceableItems)) { if (!(tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) { if (tRecipe instanceof ShapedOreRecipe) { boolean temp = true; for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput()) if (tObject != null) { if (tObject instanceof ItemStack && (((ItemStack) tObject).getItem() == null - || ((ItemStack) tObject).getMaxStackSize() < 2 - || ((ItemStack) tObject).getMaxDamage() > 0 - || ((ItemStack) tObject).getItem() instanceof ItemBlock)) { + || ((ItemStack) tObject).getMaxStackSize() < 2 + || ((ItemStack) tObject).getMaxDamage() > 0 + || ((ItemStack) tObject).getItem() instanceof ItemBlock)) { temp = false; break; } @@ -1804,8 +1778,8 @@ public class GT_ModHandler { boolean temp = true; for (ItemStack tObject : ((ShapedRecipes) tRecipe).recipeItems) { if (tObject != null && (tObject.getItem() == null || tObject.getMaxStackSize() < 2 - || tObject.getMaxDamage() > 0 - || tObject.getItem() instanceof ItemBlock)) { + || tObject.getMaxDamage() > 0 + || tObject.getItem() instanceof ItemBlock)) { temp = false; break; } @@ -1818,11 +1792,11 @@ public class GT_ModHandler { } } GT_Log.out.println( - "GT_Mod: Created a List of Tool Recipes containing " + sSingleNonBlockDamagableRecipeList.size() - + " Recipes for recycling." - + (sSingleNonBlockDamagableRecipeList.size() > 1024 - ? " Scanning all these Recipes is the reason for the startup Lag you receive right now." - : E)); + "GT_Mod: Created a List of Tool Recipes containing " + sSingleNonBlockDamagableRecipeList.size() + + " Recipes for recycling." + + (sSingleNonBlockDamagableRecipeList.size() > 1024 + ? " Scanning all these Recipes is the reason for the startup Lag you receive right now." + : E)); } List<ItemStack> rList = getRecipeOutputs(sSingleNonBlockDamagableRecipeList, true, aRecipe); if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) @@ -1836,10 +1810,10 @@ public class GT_ModHandler { */ public static List<ItemStack> getRecipeOutputs(ItemStack... aRecipe) { return getRecipeOutputs( - CraftingManager.getInstance() - .getRecipeList(), - false, - aRecipe); + CraftingManager.getInstance() + .getRecipeList(), + false, + aRecipe); } private static List<IRecipe> bufferedRecipes = null; @@ -1851,25 +1825,21 @@ public class GT_ModHandler { public static List<ItemStack> getRecipeOutputsBuffered(ItemStack... aRecipe) { if (bufferedRecipes == null) bufferedRecipes = CraftingManager.getInstance() - .getRecipeList() - .stream() - .filter( - tRecipe -> !(tRecipe instanceof ShapelessRecipes) - && !(tRecipe instanceof ShapelessOreRecipe) - && !(tRecipe instanceof IGT_CraftingRecipe)) - .filter(tRecipe -> { - try { - ItemStack tOutput = tRecipe.getRecipeOutput(); - if (tOutput.stackSize == 1 - && tOutput.getMaxDamage() > 0 - && tOutput.getMaxStackSize() - == 1) { - return true; - } - } catch (Exception ignored) {} - return false; - }) - .collect(Collectors.toList()); + .getRecipeList() + .stream() + .filter( + tRecipe -> !(tRecipe instanceof ShapelessRecipes) && !(tRecipe instanceof ShapelessOreRecipe) + && !(tRecipe instanceof IGT_CraftingRecipe)) + .filter(tRecipe -> { + try { + ItemStack tOutput = tRecipe.getRecipeOutput(); + if (tOutput.stackSize == 1 && tOutput.getMaxDamage() > 0 && tOutput.getMaxStackSize() == 1) { + return true; + } + } catch (Exception ignored) {} + return false; + }) + .collect(Collectors.toList()); return getRecipeOutputs(bufferedRecipes, false, aRecipe); } @@ -1880,8 +1850,7 @@ public class GT_ModHandler { public static List<ItemStack> getRecipeOutputs(List<IRecipe> aList, boolean aDeleteFromList, ItemStack... aRecipe) { List<ItemStack> rList = new ArrayList<>(); if (aRecipe == null || Arrays.stream(aRecipe) - .noneMatch(Objects::nonNull)) - return rList; + .noneMatch(Objects::nonNull)) return rList; InventoryCrafting aCrafting = new InventoryCrafting(new Container() { @Override @@ -1893,23 +1862,21 @@ public class GT_ModHandler { if (!aDeleteFromList) { HashSet<ItemStack> stacks = new HashSet<>(); aList.stream() - .filter(tRecipe -> { - if (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe - || tRecipe instanceof IGT_CraftingRecipe) - return false; - try { - return tRecipe.matches(aCrafting, DW); - } catch (Throwable e) { - e.printStackTrace(GT_Log.err); - return false; - } - }) - .forEach(tRecipe -> stacks.add(tRecipe.getCraftingResult(aCrafting))); + .filter(tRecipe -> { + if (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe + || tRecipe instanceof IGT_CraftingRecipe) return false; + try { + return tRecipe.matches(aCrafting, DW); + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + return false; + } + }) + .forEach(tRecipe -> stacks.add(tRecipe.getCraftingResult(aCrafting))); rList = stacks.stream() - .filter( - tOutput -> tOutput.stackSize == 1 && tOutput.getMaxDamage() > 0 - && tOutput.getMaxStackSize() == 1) - .collect(Collectors.toList()); + .filter( + tOutput -> tOutput.stackSize == 1 && tOutput.getMaxDamage() > 0 && tOutput.getMaxStackSize() == 1) + .collect(Collectors.toList()); } else for (Iterator<IRecipe> iterator = aList.iterator(); iterator.hasNext();) { IRecipe tRecipe = iterator.next(); boolean matched = false; @@ -1925,7 +1892,7 @@ public class GT_ModHandler { if (tOutput == null || tOutput.stackSize <= 0) { // Seriously, who would ever do that shit? if (!GregTech_API.sPostloadFinished) throw new GT_ItsNotMyFaultException( - "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); + "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); continue; } if (tOutput.stackSize != 1) continue; @@ -1947,7 +1914,7 @@ public class GT_ModHandler { @Deprecated public static ItemStack getMaceratorOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) { return GT_Utility.copyOrNull( - getMachineOutput(aInput, getMaceratorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]); + getMachineOutput(aInput, getMaceratorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]); } /** @@ -1956,7 +1923,7 @@ public class GT_ModHandler { @Deprecated public static ItemStack getExtractorOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) { return GT_Utility.copyOrNull( - getMachineOutput(aInput, getExtractorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]); + getMachineOutput(aInput, getExtractorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]); } /** @@ -1965,12 +1932,7 @@ public class GT_ModHandler { @Deprecated public static ItemStack getCompressorOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) { return GT_Utility.copyOrNull( - getMachineOutput( - aInput, - getCompressorRecipeList(), - aRemoveInput, - new NBTTagCompound(), - aOutputSlot)[0]); + getMachineOutput(aInput, getCompressorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]); } /** @@ -1979,11 +1941,11 @@ public class GT_ModHandler { public static ItemStack getSmeltingOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) { if (aInput == null || aInput.stackSize < 1) return null; ItemStack rStack = GT_OreDictUnificator.get( - FurnaceRecipes.smelting() - .getSmeltingResult(aInput)); + FurnaceRecipes.smelting() + .getSmeltingResult(aInput)); if (rStack != null && (aOutputSlot == null || (GT_Utility.areStacksEqual(rStack, aOutputSlot) - && rStack.stackSize + aOutputSlot.stackSize <= aOutputSlot.getMaxStackSize()))) { + && rStack.stackSize + aOutputSlot.stackSize <= aOutputSlot.getMaxStackSize()))) { if (aRemoveInput) aInput.stackSize--; return rStack; } @@ -1996,16 +1958,15 @@ public class GT_ModHandler { * Checks also if there is enough Space in the Output Slots. */ public static ItemStack[] getMachineOutput(ItemStack aInput, Map<IRecipeInput, RecipeOutput> aRecipeList, - boolean aRemoveInput, NBTTagCompound rRecipeMetaData, ItemStack... aOutputSlots) { + boolean aRemoveInput, NBTTagCompound rRecipeMetaData, ItemStack... aOutputSlots) { if (aOutputSlots == null || aOutputSlots.length <= 0) return new ItemStack[0]; if (aInput == null) return new ItemStack[aOutputSlots.length]; try { for (Entry<IRecipeInput, RecipeOutput> tEntry : aRecipeList.entrySet()) { if (tEntry.getKey() - .matches(aInput)) { + .matches(aInput)) { if (tEntry.getKey() - .getAmount() - <= aInput.stackSize) { + .getAmount() <= aInput.stackSize) { ItemStack[] tList = tEntry.getValue().items.toArray(new ItemStack[0]); if (tList.length == 0) break; ItemStack[] rList = new ItemStack[aOutputSlots.length]; @@ -2013,8 +1974,8 @@ public class GT_ModHandler { for (byte i = 0; i < aOutputSlots.length && i < tList.length; i++) { if (tList[i] != null) { if (aOutputSlots[i] == null || (GT_Utility.areStacksEqual(tList[i], aOutputSlots[i]) - && tList[i].stackSize + aOutputSlots[i].stackSize - <= aOutputSlots[i].getMaxStackSize())) { + && tList[i].stackSize + aOutputSlots[i].stackSize + <= aOutputSlots[i].getMaxStackSize())) { rList[i] = GT_Utility.copyOrNull(tList[i]); } else { return new ItemStack[aOutputSlots.length]; @@ -2023,7 +1984,7 @@ public class GT_ModHandler { } if (aRemoveInput) aInput.stackSize -= tEntry.getKey() - .getAmount(); + .getAmount(); return rList; } break; @@ -2073,7 +2034,7 @@ public class GT_ModHandler { * @return the actually used Energy. */ public static int chargeElectricItem(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreLimit, - boolean aSimulate) { + boolean aSimulate) { try { if (isElectricItem(aStack)) { int tTier = ((ic2.api.item.IElectricItem) aStack.getItem()).getTier(aStack); @@ -2082,8 +2043,8 @@ public class GT_ModHandler { aCharge = (int) Math.min(aCharge, V[Math.max(0, Math.min(V.length - 1, tTier))]); if (aCharge > 0) { int rCharge = (int) Math.max( - 0.0, - ic2.api.item.ElectricItem.manager.charge(aStack, aCharge, tTier, true, aSimulate)); + 0.0, + ic2.api.item.ElectricItem.manager.charge(aStack, aCharge, tTier, true, aSimulate)); return rCharge + (rCharge * 4 > aTier ? aTier : 0); } } @@ -2102,7 +2063,7 @@ public class GT_ModHandler { * @return the Energy got from the Item. */ public static int dischargeElectricItem(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreLimit, - boolean aSimulate, boolean aIgnoreDischargability) { + boolean aSimulate, boolean aIgnoreDischargability) { try { // if (isElectricItem(aStack) && (aIgnoreDischargability || // ((ic2.api.item.IElectricItem)aStack.getItem()).canProvideEnergy(aStack))) { @@ -2110,21 +2071,20 @@ public class GT_ModHandler { int tTier = ((ic2.api.item.IElectricItem) aStack.getItem()).getTier(aStack); if (tTier < 0 || tTier == aTier || aTier == Integer.MAX_VALUE) { if (!aIgnoreLimit && tTier >= 0) aCharge = (int) Math.min( - aCharge, - V[Math.max(0, Math.min(V.length - 1, tTier))] - + B[Math.max(0, Math.min(V.length - 1, tTier))]); + aCharge, + V[Math.max(0, Math.min(V.length - 1, tTier))] + B[Math.max(0, Math.min(V.length - 1, tTier))]); if (aCharge > 0) { // int rCharge = Math.max(0, ic2.api.item.ElectricItem.manager.discharge(aStack, aCharge + // (aCharge * 4 > aTier ? aTier : 0), tTier, T, aSimulate)); int rCharge = (int) Math.max( - 0, - ic2.api.item.ElectricItem.manager.discharge( - aStack, - aCharge + (aCharge * 4 > aTier ? aTier : 0), - tTier, - true, - !aIgnoreDischargability, - aSimulate)); + 0, + ic2.api.item.ElectricItem.manager.discharge( + aStack, + aCharge + (aCharge * 4 > aTier ? aTier : 0), + tTier, + true, + !aIgnoreDischargability, + aSimulate)); return rCharge - (rCharge * 4 > aTier ? aTier : 0); } } @@ -2185,27 +2145,27 @@ public class GT_ModHandler { return GT_ModHandler.useElectricItem(aStack, aDecharge, (EntityPlayer) aPlayer); } return GT_ModHandler.dischargeElectricItem(aStack, aDecharge, Integer.MAX_VALUE, true, false, true) - >= aDecharge; + >= aDecharge; } } else if (aStack.getItem() - .isDamageable()) { - if (aPlayer == null) { - aStack.setItemDamage(aStack.getItemDamage() + aDamage); - } else { - aStack.damageItem(aDamage, aPlayer); - } - if (aStack.getItemDamage() >= aStack.getMaxDamage()) { - aStack.setItemDamage(aStack.getMaxDamage() + 1); - ItemStack tStack = GT_Utility.getContainerItem(aStack, true); - if (tStack != null) { - aStack.func_150996_a(tStack.getItem()); - aStack.setItemDamage(tStack.getItemDamage()); - aStack.stackSize = tStack.stackSize; - aStack.setTagCompound(tStack.getTagCompound()); - } - } - return true; - } + .isDamageable()) { + if (aPlayer == null) { + aStack.setItemDamage(aStack.getItemDamage() + aDamage); + } else { + aStack.damageItem(aDamage, aPlayer); + } + if (aStack.getItemDamage() >= aStack.getMaxDamage()) { + aStack.setItemDamage(aStack.getMaxDamage() + 1); + ItemStack tStack = GT_Utility.getContainerItem(aStack, true); + if (tStack != null) { + aStack.func_150996_a(tStack.getItem()); + aStack.setItemDamage(tStack.getItemDamage()); + aStack.stackSize = tStack.stackSize; + aStack.setTagCompound(tStack.getTagCompound()); + } + } + return true; + } return false; } @@ -2219,14 +2179,14 @@ public class GT_ModHandler { if (tPlayer.capabilities.isCreativeMode) return true; if (isElectricItem(aStack) && ic2.api.item.ElectricItem.manager.getCharge(aStack) > 1000.0d) { if (consumeSolderingMaterial(tPlayer) - || (aExternalInventory != null && consumeSolderingMaterial(aExternalInventory))) { + || (aExternalInventory != null && consumeSolderingMaterial(aExternalInventory))) { if (canUseElectricItem(aStack, 10000)) { return GT_ModHandler.useElectricItem(aStack, 10000, (EntityPlayer) aPlayer); } GT_ModHandler.useElectricItem( - aStack, - (int) ic2.api.item.ElectricItem.manager.getCharge(aStack), - (EntityPlayer) aPlayer); + aStack, + (int) ic2.api.item.ElectricItem.manager.getCharge(aStack), + (EntityPlayer) aPlayer); return false; } } @@ -2294,7 +2254,7 @@ public class GT_ModHandler { public static boolean isElectricItem(ItemStack aStack) { try { return aStack != null && aStack.getItem() instanceof ic2.api.item.IElectricItem - && ((IElectricItem) aStack.getItem()).getTier(aStack) < Integer.MAX_VALUE; + && ((IElectricItem) aStack.getItem()).getTier(aStack) < Integer.MAX_VALUE; } catch (Throwable e) { /* Do nothing */ } @@ -2304,7 +2264,7 @@ public class GT_ModHandler { public static boolean isElectricItem(ItemStack aStack, byte aTier) { try { return aStack != null && aStack.getItem() instanceof ic2.api.item.IElectricItem - && ((IElectricItem) aStack.getItem()).getTier(aStack) == aTier; + && ((IElectricItem) aStack.getItem()).getTier(aStack) == aTier; } catch (Throwable e) { /* Do nothing */ } @@ -2429,37 +2389,37 @@ public class GT_ModHandler { public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput) {} public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, - ItemStack secondaryOutput) {} + ItemStack secondaryOutput) {} public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, - ItemStack secondaryOutput, int secondaryChance) {} + ItemStack secondaryOutput, int secondaryChance) {} public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput) {} public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, - ItemStack secondaryOutput) {} + ItemStack secondaryOutput) {} public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, - ItemStack secondaryOutput, int secondaryChance) {} + ItemStack secondaryOutput, int secondaryChance) {} public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, - ItemStack primaryOutput) {} + ItemStack primaryOutput) {} public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, - ItemStack primaryOutput, ItemStack secondaryOutput) {} + ItemStack primaryOutput, ItemStack secondaryOutput) {} public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, - ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {} + ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {} public static void addSmelterBlastOre(Materials aMaterial) {} public static void addCrucibleRecipe(int energy, ItemStack input, FluidStack output) {} public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid, - boolean reversible) {} + boolean reversible) {} public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid, - int chance, boolean reversible) {} + int chance, boolean reversible) {} public static void addMagmaticFuel(String fluidName, int energy) {} diff --git a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java index db997c3640..750bf91c6c 100644 --- a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java +++ b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java @@ -75,10 +75,8 @@ public class GT_Multiblock_Tooltip_Builder { private static final String TT_mod = StatCollector.translateToLocal("GT5U.MBTT.Mod"); private static final String TT_air = StatCollector.translateToLocal("GT5U.MBTT.Air"); private static final String[] TT_dots = IntStream.range(0, 16) - .mapToObj( - i -> StatCollector.translateToLocal( - "structurelib.blockhint." + i + ".name")) - .toArray(String[]::new); + .mapToObj(i -> StatCollector.translateToLocal("structurelib.blockhint." + i + ".name")) + .toArray(String[]::new); public GT_Multiblock_Tooltip_Builder() { iLines = new LinkedList<>(); @@ -132,12 +130,7 @@ public class GT_Multiblock_Tooltip_Builder { */ public GT_Multiblock_Tooltip_Builder addPollutionAmount(int pollution) { iLines.add( - TT_causes + COLON - + EnumChatFormatting.DARK_PURPLE - + pollution - + " " - + EnumChatFormatting.GRAY - + TT_pps); + TT_causes + COLON + EnumChatFormatting.DARK_PURPLE + pollution + " " + EnumChatFormatting.GRAY + TT_pps); return this; } @@ -175,19 +168,19 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder beginVariableStructureBlock(int wmin, int wmax, int hmin, int hmax, int lmin, - int lmax, boolean hollow) { + int lmax, boolean hollow) { sLines.add( - TT_dimensions + COLON - + wmin - + (wmin != wmax ? "-" + wmax : "") - + "x" - + hmin - + (hmin != hmax ? "-" + hmax : "") - + "x" - + lmin - + (lmin != lmax ? "-" + lmax : "") - + " (WxHxL) " - + (hollow ? TT_hollow : "")); + TT_dimensions + COLON + + wmin + + (wmin != wmax ? "-" + wmax : "") + + "x" + + hmin + + (hmin != hmax ? "-" + hmax : "") + + "x" + + lmin + + (lmin != lmax ? "-" + lmax : "") + + " (WxHxL) " + + (hollow ? TT_hollow : "")); sLines.add(TT_structure + COLON); return this; } @@ -258,7 +251,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addCasingInfoRange(String casingName, int minCount, int maxCount, - boolean isTiered) { + boolean isTiered) { sLines.add(TAB + minCount + "x - " + maxCount + "x " + casingName + (isTiered ? " " + TT_tiered : "")); return this; } @@ -557,25 +550,25 @@ public class GT_Multiblock_Tooltip_Builder { */ public void toolTipFinisher(String mod) { iLines.add( - TT_hold + " " - + EnumChatFormatting.BOLD - + "[LSHIFT]" - + EnumChatFormatting.RESET - + EnumChatFormatting.GRAY - + " " - + TT_todisplay); + TT_hold + " " + + EnumChatFormatting.BOLD + + "[LSHIFT]" + + EnumChatFormatting.RESET + + EnumChatFormatting.GRAY + + " " + + TT_todisplay); iLines.add(TT_mod + COLON + EnumChatFormatting.GREEN + mod + EnumChatFormatting.GRAY); hLines.add(TT_structurehint); iArray = iLines.toArray(new String[0]); sArray = sLines.toArray(new String[0]); // e.getKey() - 1 because 1 dot is meta 0. hArray = Stream.concat( - hLines.stream(), - hBlocks.asMap() - .entrySet() - .stream() - .map(e -> TT_dots[e.getKey() - 1] + COLON + String.join(SEPARATOR, e.getValue()))) - .toArray(String[]::new); + hLines.stream(), + hBlocks.asMap() + .entrySet() + .stream() + .map(e -> TT_dots[e.getKey() - 1] + COLON + String.join(SEPARATOR, e.getValue()))) + .toArray(String[]::new); } public String[] getInformation() { diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java index b8072f7b3b..85e423b032 100644 --- a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java +++ b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java @@ -75,23 +75,22 @@ public class GT_OreDictUnificator { } public static void set(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, boolean aOverwrite, - boolean aAlreadyRegistered) { + boolean aAlreadyRegistered) { if (aMaterial == null || aPrefix == null - || GT_Utility.isStackInvalid(aStack) - || Items.feather.getDamage(aStack) == W) - return; + || GT_Utility.isStackInvalid(aStack) + || Items.feather.getDamage(aStack) == W) return; isAddingOre++; aStack = GT_Utility.copyAmount(1, aStack); if (!aAlreadyRegistered) registerOre(aPrefix.get(aMaterial), aStack); addAssociation(aPrefix, aMaterial, aStack, isBlacklisted(aStack)); if (aOverwrite || GT_Utility.isStackInvalid( - sName2StackMap.get( - aPrefix.get(aMaterial) - .toString()))) + sName2StackMap.get( + aPrefix.get(aMaterial) + .toString()))) sName2StackMap.put( - aPrefix.get(aMaterial) - .toString(), - aStack); + aPrefix.get(aMaterial) + .toString(), + aStack); isAddingOre--; } @@ -131,7 +130,7 @@ public class GT_OreDictUnificator { } public static ItemStack get(Object aName, ItemStack aReplacement, long aAmount, boolean aMentionPossibleTypos, - boolean aNoInvalidAmounts) { + boolean aNoInvalidAmounts) { if (aNoInvalidAmounts && aAmount < 1) return null; final ItemStack stackFromName = sName2StackMap.get(aName.toString()); if (stackFromName != null) return GT_Utility.copyAmount(aAmount, stackFromName); @@ -183,8 +182,7 @@ public class GT_OreDictUnificator { if (GT_Utility.isStackInvalid(aStack)) return null; ItemData tPrefixMaterial = getAssociation(aStack); if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData() - || (aUseBlackList && tPrefixMaterial.mBlackListed)) - return GT_Utility.copyOrNull(aStack); + || (aUseBlackList && tPrefixMaterial.mBlackListed)) return GT_Utility.copyOrNull(aStack); if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) { tPrefixMaterial.mBlackListed = true; return GT_Utility.copyOrNull(aStack); @@ -220,8 +218,7 @@ public class GT_OreDictUnificator { if (GT_Utility.isStackInvalid(aStack)) return null; ItemData tPrefixMaterial = getAssociation(aStack); if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData() - || (aUseBlackList && tPrefixMaterial.mBlackListed)) - return aStack; + || (aUseBlackList && tPrefixMaterial.mBlackListed)) return aStack; if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) { tPrefixMaterial.mBlackListed = true; return aStack; @@ -339,22 +336,21 @@ public class GT_OreDictUnificator { sItemStack2DataMap.put(new GT_ItemStack2(aStack), aData); if (aData.hasValidMaterialData()) { long tValidMaterialAmount = aData.mMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0 - : aData.mMaterial.mAmount >= 0 ? aData.mMaterial.mAmount : M; + : aData.mMaterial.mAmount >= 0 ? aData.mMaterial.mAmount : M; for (MaterialStack tMaterial : aData.mByProducts) tValidMaterialAmount += tMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0 - : tMaterial.mAmount >= 0 ? tMaterial.mAmount : M; + : tMaterial.mAmount >= 0 ? tMaterial.mAmount : M; if (tValidMaterialAmount < M) GT_ModHandler.addToRecyclerBlackList(aStack); } if (mRunThroughTheList) { if (GregTech_API.sLoadStarted) { mRunThroughTheList = false; for (Entry<GT_ItemStack2, ItemData> tEntry : sItemStack2DataMap.entrySet()) if (!tEntry.getValue() - .hasValidPrefixData() - || tEntry.getValue().mPrefix.mAllowNormalRecycling) + .hasValidPrefixData() || tEntry.getValue().mPrefix.mAllowNormalRecycling) GT_RecipeRegistrator.registerMaterialRecycling( - tEntry.getKey() - .toStack(), - tEntry.getValue()); + tEntry.getKey() + .toStack(), + tEntry.getValue()); } } else { if (!aData.hasValidPrefixData() || aData.mPrefix.mAllowNormalRecycling) @@ -367,7 +363,7 @@ public class GT_OreDictUnificator { } public static void addAssociation(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, - boolean aBlackListed) { + boolean aBlackListed) { if (aPrefix == null || aMaterial == null || GT_Utility.isStackInvalid(aStack)) return; if (Items.feather.getDamage(aStack) == W) for (byte i = 0; i < 16; i++) setItemData(GT_Utility.copyAmountAndMetaData(1, i, aStack), new ItemData(aPrefix, aMaterial, aBlackListed)); @@ -546,6 +542,6 @@ public class GT_OreDictUnificator { String aName = aOreName == null ? E : aOreName.toString(); return GT_Utility.isStringValid(aName) ? Collections.unmodifiableList(OreDictionary.getOres(aName)) - : Collections.emptyList(); + : Collections.emptyList(); } } diff --git a/src/main/java/gregtech/api/util/GT_OverclockCalculator.java b/src/main/java/gregtech/api/util/GT_OverclockCalculator.java index e19c8c904b..3555b8938d 100644 --- a/src/main/java/gregtech/api/util/GT_OverclockCalculator.java +++ b/src/main/java/gregtech/api/util/GT_OverclockCalculator.java @@ -29,7 +29,7 @@ public class GT_OverclockCalculator { * duration) */ private int mEUtIncreasePerOC = 2, mDurationDecreasePerOC = 1, mDuration = 0, mParallel = 1, mRecipeHeat = 0, - mMultiHeat = 0, mHeatPerfectOC = 2; + mMultiHeat = 0, mHeatPerfectOC = 2; /** * @mHeatOC - Whether to enable overclocking with heat like the EBF every 1800 heat difference * @mOneTickDiscount - Whether to give EUt Discount when the duration goes below one tick @@ -213,7 +213,7 @@ public class GT_OverclockCalculator { mDuration = (int) Math.ceil(mDuration * mSpeedBoost); if (mHeatOC) { while (mRecipeHeat + HEAT_PERFECT_OVERCLOCK_THRESHOLD <= mMultiHeat - && mRecipeEUt * mParallel * mRecipeAmps << 2 < mEUt * mAmps) { + && mRecipeEUt * mParallel * mRecipeAmps << 2 < mEUt * mAmps) { if (mDuration < 1) { break; } @@ -228,7 +228,7 @@ public class GT_OverclockCalculator { int tTier = GT_Utility.getTier(mEUt); int tTierDifference = tTier - 1; long tNextConsumption = ((long) Math.ceil(mRecipeEUt * mParallel * mRecipeAmps * mEUtDiscount)) - << mEUtIncreasePerOC; + << mEUtIncreasePerOC; while (tTierDifference > 0 && tNextConsumption < mEUt * mAmps) { mRecipeEUt <<= mEUtIncreasePerOC; mDuration >>= mDurationDecreasePerOC; @@ -237,7 +237,7 @@ public class GT_OverclockCalculator { } } else { long tNextConsumption = ((long) Math.ceil(mRecipeEUt * mParallel * mRecipeAmps * mEUtDiscount)) - << mEUtIncreasePerOC; + << mEUtIncreasePerOC; while (tNextConsumption < mEUt * mAmps) { if (mDuration <= 1) { break; diff --git a/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java b/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java index 52561a063d..17e46aebf2 100644 --- a/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java +++ b/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java @@ -19,6 +19,6 @@ public class GT_PCBFactoryManager { public static Materials getPlasticMaterialFromTier(int aTier) { return mPlasticTiers.inverse() - .get(aTier); + .get(aTier); } } diff --git a/src/main/java/gregtech/api/util/GT_ParallelHelper.java b/src/main/java/gregtech/api/util/GT_ParallelHelper.java index 0914d2be29..4ae33cd48d 100644 --- a/src/main/java/gregtech/api/util/GT_ParallelHelper.java +++ b/src/main/java/gregtech/api/util/GT_ParallelHelper.java @@ -209,7 +209,7 @@ public class GT_ParallelHelper { public ItemStack[] getItemOutputs() { if (!mBuilt || !mCalculateOutputs) { throw new IllegalStateException( - "Tried to get item outputs before building or without enabling calculation of outputs"); + "Tried to get item outputs before building or without enabling calculation of outputs"); } return mItemOutputs; } @@ -220,7 +220,7 @@ public class GT_ParallelHelper { public FluidStack[] getFluidOutputs() { if (!mBuilt || !mCalculateOutputs) { throw new IllegalStateException( - "Tried to get fluid outputs before building or without enabling calculation of outputs"); + "Tried to get fluid outputs before building or without enabling calculation of outputs"); } return mFluidOutputs; } @@ -290,7 +290,7 @@ public class GT_ParallelHelper { float tRecipeEUt = mRecipe.mEUt * mEUtModifier; // Consume inputs to determine normal parallel for (; mCurrentParallel < mMaxParallel / mBatchModifier - && tCurrentUsage < (mAvailableEUt - tRecipeEUt); mCurrentParallel++) { + && tCurrentUsage < (mAvailableEUt - tRecipeEUt); mCurrentParallel++) { if (mRecipe.isRecipeInputEqual(true, false, tFluidInputs, tItemInputs)) { tCurrentUsage += tRecipeEUt; } else { @@ -302,7 +302,7 @@ public class GT_ParallelHelper { if (mBatchMode) { int tExtraParallels = 0; while (tExtraParallels < mCurrentParallel * (mBatchModifier - 1) - && mRecipe.isRecipeInputEqual(false, false, tFluidInputs, tItemInputs)) { + && mRecipe.isRecipeInputEqual(false, false, tFluidInputs, tItemInputs)) { mRecipe.isRecipeInputEqual(true, false, tFluidInputs, tItemInputs); tExtraParallels++; } @@ -320,7 +320,7 @@ public class GT_ParallelHelper { mItemOutputs[i] = null; } else { ItemStack tItem = mRecipe.getOutput(i) - .copy(); + .copy(); tItem.stackSize *= mCurrentParallel; mItemOutputs[i] = tItem; } @@ -334,7 +334,7 @@ public class GT_ParallelHelper { mFluidOutputs[i] = null; } else { FluidStack tFluid = mRecipe.getFluidOutput(i) - .copy(); + .copy(); tFluid.amount *= mCurrentParallel; mFluidOutputs[i] = tFluid; } @@ -394,9 +394,9 @@ public class GT_ParallelHelper { continue; } if (tHatch.isFluidLocked() && tLockedFluidName != null - && !tLockedFluidName.equals( - tFluidOutput.getFluid() - .getName())) { + && !tLockedFluidName.equals( + tFluidOutput.getFluid() + .getName())) { continue; } } @@ -412,7 +412,7 @@ public class GT_ParallelHelper { // now that all partial/restricted hatches have been counted, create a priority queue for our outputs // the lowest priority fluid is the number of complete parallel crafts we can support PriorityQueue<MutableTriple<Integer, Integer, FluidStack>> aParallelQueue = new PriorityQueue<>( - Comparator.comparing(MutableTriple::getLeft)); + Comparator.comparing(MutableTriple::getLeft)); for (Entry<FluidStack, MutablePair<Integer, Integer>> entry : tParallels.entrySet()) { aParallelQueue.add(new MutableTriple<>(entry.getValue().left, entry.getValue().right, entry.getKey())); } @@ -491,7 +491,7 @@ public class GT_ParallelHelper { // now that all partial stacks have been counted, create a priority queue for our outputs // the lowest priority item is the number of complete parallel crafts we can support PriorityQueue<MutableTriple<Integer, Integer, ItemStack>> aParallelQueue = new PriorityQueue<>( - Comparator.comparing(MutableTriple::getLeft)); + Comparator.comparing(MutableTriple::getLeft)); for (Entry<ItemStack, MutablePair<Integer, Integer>> entry : tParallels.entrySet()) { aParallelQueue.add(new MutableTriple<>(entry.getValue().left, entry.getValue().right, entry.getKey())); } diff --git a/src/main/java/gregtech/api/util/GT_PlayedSound.java b/src/main/java/gregtech/api/util/GT_PlayedSound.java index cdafc010d7..05d61e9833 100644 --- a/src/main/java/gregtech/api/util/GT_PlayedSound.java +++ b/src/main/java/gregtech/api/util/GT_PlayedSound.java @@ -29,8 +29,8 @@ public class GT_PlayedSound { public boolean equals(Object aObject) { if (aObject instanceof GT_PlayedSound) { return ((GT_PlayedSound) aObject).mX == mX && ((GT_PlayedSound) aObject).mY == mY - && ((GT_PlayedSound) aObject).mZ == mZ - && ((GT_PlayedSound) aObject).mSoundName.equals(mSoundName); + && ((GT_PlayedSound) aObject).mZ == mZ + && ((GT_PlayedSound) aObject).mSoundName.equals(mSoundName); } return false; } diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index 6d4dda838a..aa8956c504 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -193,8 +193,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { // only used for GT_RecipeBuilder. Should not be called otherwise GT_Recipe(ItemStack[] mInputs, ItemStack[] mOutputs, FluidStack[] mFluidInputs, FluidStack[] mFluidOutputs, - int[] mChances, Object mSpecialItems, int mDuration, int mEUt, int mSpecialValue, boolean mEnabled, - boolean mHidden, boolean mFakeRecipe, boolean mCanBeBuffered, boolean mNeedsEmptyOutput, String[] neiDesc) { + int[] mChances, Object mSpecialItems, int mDuration, int mEUt, int mSpecialValue, boolean mEnabled, + boolean mHidden, boolean mFakeRecipe, boolean mCanBeBuffered, boolean mNeedsEmptyOutput, String[] neiDesc) { this.mInputs = mInputs; this.mOutputs = mOutputs; this.mFluidInputs = mFluidInputs; @@ -215,7 +215,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } public GT_Recipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { if (aInputs == null) aInputs = new ItemStack[0]; if (aOutputs == null) aOutputs = new ItemStack[0]; if (aFluidInputs == null) aFluidInputs = new FluidStack[0]; @@ -302,18 +302,18 @@ public class GT_Recipe implements Comparable<GT_Recipe> { // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000! public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, - int aSpecialValue, int aType) { + int aSpecialValue, int aType) { this( - true, - new ItemStack[] { aInput1 }, - new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 }, - null, - null, - null, - null, - 0, - 0, - Math.max(1, aSpecialValue)); + true, + new ItemStack[] { aInput1 }, + new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 }, + null, + null, + null, + null, + 0, + 0, + Math.max(1, aSpecialValue)); if (mInputs.length > 0 && aSpecialValue > 0) { switch (aType) { @@ -344,18 +344,18 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } public GT_Recipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt, - int aSpecialValue) { + int aSpecialValue) { this( - true, - null, - null, - null, - null, - new FluidStack[] { aInput1, aInput2 }, - new FluidStack[] { aOutput1 }, - Math.max(aDuration, 1), - aEUt, - Math.max(Math.min(aSpecialValue, 160000000), 0)); + true, + null, + null, + null, + null, + new FluidStack[] { aInput1, aInput2 }, + new FluidStack[] { aOutput1 }, + Math.max(aDuration, 1), + aEUt, + Math.max(Math.min(aSpecialValue, 160000000), 0)); if (mInputs.length > 1) { GT_Recipe_Map.sFusionRecipes.addRecipe(this); } @@ -363,35 +363,35 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { this( - true, - new ItemStack[] { aInput1 }, - new ItemStack[] { aOutput1, aOutput2 }, - null, - null, - null, - null, - aDuration, - aEUt, - 0); + true, + new ItemStack[] { aInput1 }, + new ItemStack[] { aOutput1, aOutput2 }, + null, + null, + null, + null, + aDuration, + aEUt, + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sLatheRecipes.addRecipe(this); } } public GT_Recipe(ItemStack aInput1, int aCellAmount, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, - ItemStack aOutput4, int aDuration, int aEUt) { + ItemStack aOutput4, int aDuration, int aEUt) { this( - true, - new ItemStack[] { aInput1, - aCellAmount > 0 ? ItemList.Cell_Empty.get(Math.min(64, Math.max(1, aCellAmount))) : null }, - new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 }, - null, - null, - null, - null, - Math.max(aDuration, 1), - Math.max(aEUt, 1), - 0); + true, + new ItemStack[] { aInput1, + aCellAmount > 0 ? ItemList.Cell_Empty.get(Math.min(64, Math.max(1, aCellAmount))) : null }, + new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 }, + null, + null, + null, + null, + Math.max(aDuration, 1), + Math.max(aEUt, 1), + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sDistillationRecipes.addRecipe(this); } @@ -399,20 +399,20 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public GT_Recipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2) { this( - true, - new ItemStack[] { aInput1, - GT_ModHandler.getIC2Item( - "industrialTnt", - aInput2 > 0 ? Math.min(aInput2, 64) : 1, - new ItemStack(Blocks.tnt, aInput2 > 0 ? Math.min(aInput2, 64) : 1)) }, - new ItemStack[] { aOutput1, aOutput2 }, - null, - null, - null, - null, - 20, - 30, - 0); + true, + new ItemStack[] { aInput1, + GT_ModHandler.getIC2Item( + "industrialTnt", + aInput2 > 0 ? Math.min(aInput2, 64) : 1, + new ItemStack(Blocks.tnt, aInput2 > 0 ? Math.min(aInput2, 64) : 1)) }, + new ItemStack[] { aOutput1, aOutput2 }, + null, + null, + null, + null, + 20, + 30, + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sImplosionRecipes.addRecipe(this); } @@ -420,16 +420,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public GT_Recipe(int aEUt, int aDuration, ItemStack aInput1, ItemStack aOutput1) { this( - true, - new ItemStack[] { aInput1, ItemList.Circuit_Integrated.getWithDamage(0, aInput1.stackSize) }, - new ItemStack[] { aOutput1 }, - null, - null, - null, - null, - Math.max(aDuration, 1), - Math.max(aEUt, 1), - 0); + true, + new ItemStack[] { aInput1, ItemList.Circuit_Integrated.getWithDamage(0, aInput1.stackSize) }, + new ItemStack[] { aOutput1 }, + null, + null, + null, + null, + Math.max(aDuration, 1), + Math.max(aEUt, 1), + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sBenderRecipes.addRecipe(this); } @@ -437,34 +437,34 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public GT_Recipe(ItemStack aInput1, ItemStack aInput2, int aEUt, int aDuration, ItemStack aOutput1) { this( - true, - aInput2 == null ? new ItemStack[] { aInput1 } : new ItemStack[] { aInput1, aInput2 }, - new ItemStack[] { aOutput1 }, - null, - null, - null, - null, - Math.max(aDuration, 1), - Math.max(aEUt, 1), - 0); + true, + aInput2 == null ? new ItemStack[] { aInput1 } : new ItemStack[] { aInput1, aInput2 }, + new ItemStack[] { aOutput1 }, + null, + null, + null, + null, + Math.max(aDuration, 1), + Math.max(aEUt, 1), + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sAlloySmelterRecipes.addRecipe(this); } } public GT_Recipe(ItemStack aInput1, int aEUt, ItemStack aInput2, int aDuration, ItemStack aOutput1, - ItemStack aOutput2) { + ItemStack aOutput2) { this( - true, - aInput2 == null ? new ItemStack[] { aInput1 } : new ItemStack[] { aInput1, aInput2 }, - new ItemStack[] { aOutput1, aOutput2 }, - null, - null, - null, - null, - Math.max(aDuration, 1), - Math.max(aEUt, 1), - 0); + true, + aInput2 == null ? new ItemStack[] { aInput1 } : new ItemStack[] { aInput1, aInput2 }, + new ItemStack[] { aOutput1, aOutput2 }, + null, + null, + null, + null, + Math.max(aDuration, 1), + Math.max(aEUt, 1), + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sCannerRecipes.addRecipe(this); } @@ -472,16 +472,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aDuration) { this( - true, - new ItemStack[] { aInput1 }, - new ItemStack[] { aOutput1 }, - null, - null, - null, - null, - Math.max(aDuration, 1), - 120, - 0); + true, + new ItemStack[] { aInput1 }, + new ItemStack[] { aOutput1 }, + null, + null, + null, + null, + Math.max(aDuration, 1), + 120, + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sVacuumRecipes.addRecipe(this); } @@ -489,16 +489,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt, int VACUUM) { this( - true, - new ItemStack[] { aInput1 }, - new ItemStack[] { aOutput1 }, - null, - null, - null, - null, - Math.max(aDuration, 1), - aEUt, - 0); + true, + new ItemStack[] { aInput1 }, + new ItemStack[] { aOutput1 }, + null, + null, + null, + null, + Math.max(aDuration, 1), + aEUt, + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sVacuumRecipes.addRecipe(this); } @@ -506,16 +506,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public GT_Recipe(FluidStack aInput1, FluidStack aOutput1, int aDuration, int aEUt) { this( - false, - null, - null, - null, - null, - new FluidStack[] { aInput1 }, - new FluidStack[] { aOutput1 }, - Math.max(aDuration, 1), - aEUt, - 0); + false, + null, + null, + null, + null, + new FluidStack[] { aInput1 }, + new FluidStack[] { aOutput1 }, + Math.max(aDuration, 1), + aEUt, + 0); if (mFluidInputs.length > 0 && mFluidOutputs[0] != null) { GT_Recipe_Map.sVacuumRecipes.addRecipe(this); } @@ -523,18 +523,18 @@ public class GT_Recipe implements Comparable<GT_Recipe> { // Dummy GT_Recipe maker... public GT_Recipe(ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { this( - true, - aInputs, - aOutputs, - aSpecialItems, - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue); + true, + aInputs, + aOutputs, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); } public static void reInit() { @@ -600,13 +600,13 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs, - ItemStack... aInputs) { + ItemStack... aInputs) { return isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, 1, aFluidInputs, aInputs); } // For non-multiplied recipe amount values public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, - FluidStack[] aFluidInputs, ItemStack... aInputs) { + FluidStack[] aFluidInputs, ItemStack... aInputs) { return isRecipeInputEqual(aDecreaseStacksizeBySuccess, aDontCheckStackSizes, 1, aFluidInputs, aInputs); } @@ -632,7 +632,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * set to {@code true}! You'll get weird behavior. */ public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, - int amountMultiplier, FluidStack[] aFluidInputs, ItemStack... aInputs) { + int amountMultiplier, FluidStack[] aFluidInputs, ItemStack... aInputs) { if (mInputs.length > 0 && aInputs == null) return false; if (mFluidInputs.length > 0 && aFluidInputs == null) return false; @@ -695,14 +695,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (GT_OreDictUnificator.isInputStackEqual(providedItem, unifiedItemCost)) { if (GTppRecipeHelper) { // Please see JavaDoc on GTppRecipeHelper for why this is here. if (GT_Utility.areStacksEqual(providedItem, Ic2Items.FluidCell.copy(), true) - || GT_Utility.areStacksEqual( - providedItem, - ItemList.Tool_DataStick.get(1L), - true) - || GT_Utility.areStacksEqual( - providedItem, - ItemList.Tool_DataOrb.get(1L), - true)) { + || GT_Utility.areStacksEqual(providedItem, ItemList.Tool_DataStick.get(1L), true) + || GT_Utility.areStacksEqual(providedItem, ItemList.Tool_DataOrb.get(1L), true)) { if (!GT_Utility.areStacksEqual(providedItem, recipeItemCost, false)) continue; } } @@ -808,23 +802,23 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public void reloadOwner() { setOwner( - Loader.instance() - .activeModContainer()); + Loader.instance() + .activeModContainer()); final List<String> excludedClasses = Arrays.asList( - "java.lang.Thread", - "gregtech.api.util.GT_Recipe", - "gregtech.api.util.GT_RecipeBuilder", - "gregtech.api.util.GT_Recipe$GT_Recipe_Map", - "gregtech.common.GT_RecipeAdder"); + "java.lang.Thread", + "gregtech.api.util.GT_Recipe", + "gregtech.api.util.GT_RecipeBuilder", + "gregtech.api.util.GT_Recipe$GT_Recipe_Map", + "gregtech.common.GT_RecipeAdder"); if (GT_Mod.gregtechproxy.mNEIRecipeOwnerStackTrace) { List<StackTraceElement> toAdd = new ArrayList<>(); for (StackTraceElement stackTrace : Thread.currentThread() - .getStackTrace()) { + .getStackTrace()) { if (excludedClasses.stream() - .noneMatch( - c -> stackTrace.getClassName() - .equals(c))) { + .noneMatch( + c -> stackTrace.getClassName() + .equals(c))) { toAdd.add(stackTrace); } } @@ -844,9 +838,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> { */ public void setOwner(String modId) { for (ModContainer mod : Loader.instance() - .getModList()) { + .getModList()) { if (mod.getModId() - .equals(modId)) { + .equals(modId)) { setOwner(mod); return; } @@ -904,7 +898,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } } if (invalidCount > 0) throw new RuntimeException( - "There are " + invalidCount + " invalid assembly line recipe(s)! Check GregTech.log for details!"); + "There are " + invalidCount + " invalid assembly line recipe(s)! Check GregTech.log for details!"); } public ItemStack mResearchItem; @@ -923,16 +917,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * if you set one yourself, it will give you one of the RunetimeExceptions! */ public GT_Recipe_AssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, - FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { + FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { this( - aResearchItem, - aResearchTime, - aInputs, - aFluidInputs, - aOutput, - aDuration, - aEUt, - new ItemStack[aInputs.length][]); + aResearchItem, + aResearchTime, + aInputs, + aFluidInputs, + aOutput, + aDuration, + aEUt, + new ItemStack[aInputs.length][]); int tPersistentHash = 1; for (ItemStack tInput : aInputs) tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(tInput, true, false); @@ -952,7 +946,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * if you don't set one yourself, it will break a lot of stuff! */ public GT_Recipe_AssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, - FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt, ItemStack[][] aAlt) { + FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt, ItemStack[][] aAlt) { mResearchItem = aResearchItem; mResearchTime = aResearchTime; mInputs = aInputs; @@ -978,7 +972,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { GT_ItemStack thisOutput = new GT_ItemStack(mOutput); GT_ItemStack thisResearch = new GT_ItemStack(mResearchItem); int miscRecipeDataHash = Arrays.deepHashCode( - new Object[] { totalInputStackSize, mDuration, mEUt, thisOutput, thisResearch, mResearchTime }); + new Object[] { totalInputStackSize, mDuration, mEUt, thisOutput, thisResearch, mResearchTime }); result = prime * result + inputFluidHash; result = prime * result + inputHash; result = prime * result + miscRecipeDataHash; @@ -1031,7 +1025,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } return this.mDuration == other.mDuration && this.mEUt == other.mEUt - && this.mResearchTime == other.mResearchTime; + && this.mResearchTime == other.mResearchTime; } public int getPersistentHash() { @@ -1043,22 +1037,22 @@ public class GT_Recipe implements Comparable<GT_Recipe> { @Override public String toString() { return "GT_Recipe_AssemblyLine{" + "mResearchItem=" - + mResearchItem - + ", mResearchTime=" - + mResearchTime - + ", mInputs=" - + Arrays.toString(mInputs) - + ", mFluidInputs=" - + Arrays.toString(mFluidInputs) - + ", mOutput=" - + mOutput - + ", mDuration=" - + mDuration - + ", mEUt=" - + mEUt - + ", mOreDictAlt=" - + Arrays.toString(mOreDictAlt) - + '}'; + + mResearchItem + + ", mResearchTime=" + + mResearchTime + + ", mInputs=" + + Arrays.toString(mInputs) + + ", mFluidInputs=" + + Arrays.toString(mFluidInputs) + + ", mOutput=" + + mOutput + + ", mDuration=" + + mDuration + + ", mEUt=" + + mEUt + + ", mOreDictAlt=" + + Arrays.toString(mOreDictAlt) + + '}'; } /** @@ -1088,893 +1082,891 @@ public class GT_Recipe implements Comparable<GT_Recipe> { static final String TEXTURES_GUI_BASICMACHINES = "textures/gui/basicmachines"; public static final GT_Recipe_Map sOreWasherRecipes = new GT_Recipe_Map( - new HashSet<>(500), - "gt.recipe.orewasher", - "Ore Washing Plant", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "OreWasher"), - 1, - 3, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeConfigFile("orewasher", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW); + new HashSet<>(500), + "gt.recipe.orewasher", + "Ore Washing Plant", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "OreWasher"), + 1, + 3, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeConfigFile("orewasher", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW); public static final GT_Recipe_Map sThermalCentrifugeRecipes = new GT_Recipe_Map( - new HashSet<>(1000), - "gt.recipe.thermalcentrifuge", - "Thermal Centrifuge", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ThermalCentrifuge"), - 1, - 3, - 1, - 0, - 2, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeConfigFile("thermalcentrifuge", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(1000), + "gt.recipe.thermalcentrifuge", + "Thermal Centrifuge", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ThermalCentrifuge"), + 1, + 3, + 1, + 0, + 2, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeConfigFile("thermalcentrifuge", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sCompressorRecipes = new GT_Recipe_Map( - new HashSet<>(750), - "gt.recipe.compressor", - "Compressor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Compressor"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR) - .setRecipeConfigFile("compressor", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT) - .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR_STEAM) - .setProgressBarSteam(GT_UITextures.PROGRESSBAR_COMPRESS_STEAM); + new HashSet<>(750), + "gt.recipe.compressor", + "Compressor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Compressor"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR) + .setRecipeConfigFile("compressor", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT) + .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR_STEAM) + .setProgressBarSteam(GT_UITextures.PROGRESSBAR_COMPRESS_STEAM); public static final GT_Recipe_Map sExtractorRecipes = new GT_Recipe_Map( - new HashSet<>(250), - "gt.recipe.extractor", - "Extractor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Extractor"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) - .setRecipeConfigFile("extractor", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT) - .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_STEAM) - .setProgressBarSteam(GT_UITextures.PROGRESSBAR_EXTRACT_STEAM); + new HashSet<>(250), + "gt.recipe.extractor", + "Extractor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Extractor"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) + .setRecipeConfigFile("extractor", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT) + .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_STEAM) + .setProgressBarSteam(GT_UITextures.PROGRESSBAR_EXTRACT_STEAM); public static final GT_Recipe_Map sRecyclerRecipes = new GT_Recipe_Map_Recycler( - new HashSet<>(0), - "ic.recipe.recycler", - "Recycler", - "ic2.recycler", - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Recycler"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_RECYCLE) - .setProgressBar(GT_UITextures.PROGRESSBAR_RECYCLE, ProgressBar.Direction.CIRCULAR_CW); + new HashSet<>(0), + "ic.recipe.recycler", + "Recycler", + "ic2.recycler", + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Recycler"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_RECYCLE) + .setProgressBar(GT_UITextures.PROGRESSBAR_RECYCLE, ProgressBar.Direction.CIRCULAR_CW); public static final GT_Recipe_Map sFurnaceRecipes = new GT_Recipe_Map_Furnace( - new HashSet<>(0), - "mc.recipe.furnace", - "Furnace", - "smelting", - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "E_Furnace"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM) - .setProgressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM); + new HashSet<>(0), + "mc.recipe.furnace", + "Furnace", + "smelting", + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "E_Furnace"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM) + .setProgressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM); public static final GT_Recipe_Map sMicrowaveRecipes = new GT_Recipe_Map_Microwave( - new HashSet<>(0), - "gt.recipe.microwave", - "Microwave", - "smelting", - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "E_Furnace"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(0), + "gt.recipe.microwave", + "Microwave", + "smelting", + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "E_Furnace"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sScannerFakeRecipes = new GT_Recipe_Map( - new HashSet<>(300), - "gt.recipe.scanner", - "Scanner", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Scanner"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MICROSCOPE) - .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(300), + "gt.recipe.scanner", + "Scanner", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Scanner"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MICROSCOPE) + .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sRockBreakerFakeRecipes = new GT_Recipe_Map( - new HashSet<>(200), - "gt.recipe.rockbreaker", - "Rock Breaker", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "RockBreaker"), - 2, - 1, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) - .setProgressBar(GT_UITextures.PROGRESSBAR_MACERATE, ProgressBar.Direction.RIGHT); + new HashSet<>(200), + "gt.recipe.rockbreaker", + "Rock Breaker", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "RockBreaker"), + 2, + 1, + 0, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) + .setProgressBar(GT_UITextures.PROGRESSBAR_MACERATE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sByProductList = new GT_Recipe_Map( - new HashSet<>(1000), - "gt.recipe.byproductlist", - "Ore Byproduct List", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 6, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(1000), + "gt.recipe.byproductlist", + "Ore Byproduct List", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 6, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sReplicatorFakeRecipes = new ReplicatorFakeMap( - new HashSet<>(100), - "gt.recipe.replicator", - "Replicator", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Replicator"), - 0, - 1, - 0, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) - .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_UUM) - .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(100), + "gt.recipe.replicator", + "Replicator", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Replicator"), + 0, + 1, + 0, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) + .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_UUM) + .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); // public static final GT_Recipe_Map sAssemblylineFakeRecipes = new GT_Recipe_Map(new HashSet<>(30), // "gt.recipe.scanner", "Scanner", null, Mods.GregTech.getResourcePath(BASIC_MACHINES, "Default"), 1, 1, 1, 0, // 1, E, 1, E, true, // true); public static final GT_Recipe_Map sAssemblylineVisualRecipes = new GT_Recipe_Map_AssemblyLineFake( - new HashSet<>(110), - "gt.recipe.fakeAssemblylineProcess", - "Assemblyline Process", - null, - GregTech.getResourcePath("textures", "gui", "FakeAssemblyline"), - 16, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB) - .setUsualFluidInputCount(4) - .setDisableOptimize(true); + new HashSet<>(110), + "gt.recipe.fakeAssemblylineProcess", + "Assemblyline Process", + null, + GregTech.getResourcePath("textures", "gui", "FakeAssemblyline"), + 16, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB) + .setUsualFluidInputCount(4) + .setDisableOptimize(true); /** * Usually, but not always, you should use {@link GT_RecipeConstants#UniversalArcFurnace} instead. */ public static final GT_Recipe_Map sPlasmaArcFurnaceRecipes = new GT_Recipe_Map( - new HashSet<>(20000), - "gt.recipe.plasmaarcfurnace", - "Plasma Arc Furnace", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PlasmaArcFurnace"), - 1, - 9, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("arcfurnace", FIRST_ITEM_INPUT); + new HashSet<>(20000), + "gt.recipe.plasmaarcfurnace", + "Plasma Arc Furnace", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PlasmaArcFurnace"), + 1, + 9, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("arcfurnace", FIRST_ITEM_INPUT); /** * Usually, but not always, you should use {@link GT_RecipeConstants#UniversalArcFurnace} instead. */ public static final GT_Recipe_Map sArcFurnaceRecipes = new GT_Recipe_Map( - new HashSet<>(20000), - "gt.recipe.arcfurnace", - "Arc Furnace", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ArcFurnace"), - 1, - 9, - 1, - 1, - 3, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("arcfurnace", FIRST_ITEM_INPUT); + new HashSet<>(20000), + "gt.recipe.arcfurnace", + "Arc Furnace", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ArcFurnace"), + 1, + 9, + 1, + 1, + 3, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("arcfurnace", FIRST_ITEM_INPUT); public static final GT_Recipe_Map sPrinterRecipes = new GT_Recipe_Map_Printer( - new HashSet<>(5), - "gt.recipe.printer", - "Printer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Printer"), - 1, - 1, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_PAGE_BLANK) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_PAGE_PRINTED) - .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_STICK) - .setRecipeConfigFile("printer", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(5), + "gt.recipe.printer", + "Printer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Printer"), + 1, + 1, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_PAGE_BLANK) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_PAGE_PRINTED) + .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_STICK) + .setRecipeConfigFile("printer", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sSifterRecipes = new GT_Recipe_Map( - new HashSet<>(105), - "gt.recipe.sifter", - "Sifter", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Sifter"), - 1, - 9, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN) - .setRecipeConfigFile("sifter", FIRST_ITEM_INPUT); + new HashSet<>(105), + "gt.recipe.sifter", + "Sifter", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Sifter"), + 1, + 9, + 0, + 0, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN) + .setRecipeConfigFile("sifter", FIRST_ITEM_INPUT); public static final GT_Recipe_Map sPressRecipes = new GT_Recipe_Map_FormingPress( - new HashSet<>(300), - "gt.recipe.press", - "Forming Press", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Press3"), - 6, - 1, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_PRESS_1) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_PRESS_2) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_PRESS_3) - .setRecipeConfigFile("press", FIRST_ITEM_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); + new HashSet<>(300), + "gt.recipe.press", + "Forming Press", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Press3"), + 6, + 1, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_PRESS_1) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_PRESS_2) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_PRESS_3) + .setRecipeConfigFile("press", FIRST_ITEM_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sLaserEngraverRecipes = new GT_Recipe_Map( - new HashSet<>(810), - "gt.recipe.laserengraver", - "Precision Laser Engraver", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LaserEngraver2"), - 4, - 4, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_LENS) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("laserengraving", FIRST_ITEM_OUTPUT) - .setUsualFluidInputCount(2) - .setUsualFluidOutputCount(2); + new HashSet<>(810), + "gt.recipe.laserengraver", + "Precision Laser Engraver", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LaserEngraver2"), + 4, + 4, + 0, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_LENS) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("laserengraving", FIRST_ITEM_OUTPUT) + .setUsualFluidInputCount(2) + .setUsualFluidOutputCount(2); public static final GT_Recipe_Map sMixerRecipes = new GT_Recipe_Map( - new HashSet<>(900), - "gt.recipe.mixer", - "Mixer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Mixer6"), - 9, - 4, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeConfigFile("mixer", FIRST_ITEM_OR_FLUID_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_MIXER, ProgressBar.Direction.CIRCULAR_CW); + new HashSet<>(900), + "gt.recipe.mixer", + "Mixer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Mixer6"), + 9, + 4, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeConfigFile("mixer", FIRST_ITEM_OR_FLUID_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_MIXER, ProgressBar.Direction.CIRCULAR_CW); public static final GT_Recipe_Map sAutoclaveRecipes = new GT_Recipe_Map( - new HashSet<>(300), - "gt.recipe.autoclave", - "Autoclave", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Autoclave4"), - 2, - 4, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST) - .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_GEM) - .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeConfigFile("autoclave", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(300), + "gt.recipe.autoclave", + "Autoclave", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Autoclave4"), + 2, + 4, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST) + .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_GEM) + .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeConfigFile("autoclave", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sElectroMagneticSeparatorRecipes = new GT_Recipe_Map( - new HashSet<>(50), - "gt.recipe.electromagneticseparator", - "Electromagnetic Separator", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ElectromagneticSeparator"), - 1, - 3, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeConfigFile("electromagneticseparator", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_MAGNET, ProgressBar.Direction.RIGHT); + new HashSet<>(50), + "gt.recipe.electromagneticseparator", + "Electromagnetic Separator", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ElectromagneticSeparator"), + 1, + 3, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeConfigFile("electromagneticseparator", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_MAGNET, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sPolarizerRecipes = new GT_Recipe_Map( - new HashSet<>(300), - "gt.recipe.polarizer", - "Electromagnetic Polarizer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Polarizer"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_MAGNET, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("polarizer", FIRST_ITEM_INPUT); + new HashSet<>(300), + "gt.recipe.polarizer", + "Electromagnetic Polarizer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Polarizer"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_MAGNET, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("polarizer", FIRST_ITEM_INPUT); public static final GT_Recipe_Map sMaceratorRecipes = new GT_Recipe_Map_Macerator( - new HashSet<>(16600), - "gt.recipe.macerator", - "Pulverization", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Macerator4"), - 1, - 4, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) - .setProgressBar(GT_UITextures.PROGRESSBAR_MACERATE, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("pulveriser", FIRST_ITEM_INPUT) - .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE_STEAM) - .setSlotOverlaySteam(true, GT_UITextures.OVERLAY_SLOT_DUST_STEAM) - .setProgressBarSteam(GT_UITextures.PROGRESSBAR_MACERATE_STEAM); + new HashSet<>(16600), + "gt.recipe.macerator", + "Pulverization", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Macerator4"), + 1, + 4, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) + .setProgressBar(GT_UITextures.PROGRESSBAR_MACERATE, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("pulveriser", FIRST_ITEM_INPUT) + .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE_STEAM) + .setSlotOverlaySteam(true, GT_UITextures.OVERLAY_SLOT_DUST_STEAM) + .setProgressBarSteam(GT_UITextures.PROGRESSBAR_MACERATE_STEAM); public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map( - new HashSet<>(2550), - "gt.recipe.chemicalbath", - "Chemical Bath", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ChemicalBath"), - 1, - 3, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW) - .setRecipeConfigFile("chemicalbath", FIRST_ITEM_INPUT); + new HashSet<>(2550), + "gt.recipe.chemicalbath", + "Chemical Bath", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ChemicalBath"), + 1, + 3, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW) + .setRecipeConfigFile("chemicalbath", FIRST_ITEM_INPUT); public static final GT_Recipe_Map sFluidCannerRecipes = new GT_Recipe_Map_FluidCanner( - new HashSet<>(2100), - "gt.recipe.fluidcanner", - "Fluid Canning Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidCanner"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_CANISTER) - .setRecipeConfigFile("canning", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_CANNER, ProgressBar.Direction.RIGHT); + new HashSet<>(2100), + "gt.recipe.fluidcanner", + "Fluid Canning Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidCanner"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_CANISTER) + .setRecipeConfigFile("canning", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_CANNER, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sBrewingRecipes = new GT_Recipe_Map( - new HashSet<>(450), - "gt.recipe.brewer", - "Brewing Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PotionBrewer"), - 1, - 0, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CAULDRON) - .setRecipeConfigFile("brewing", FIRST_FLUIDSTACK_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); + new HashSet<>(450), + "gt.recipe.brewer", + "Brewing Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PotionBrewer"), + 1, + 0, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CAULDRON) + .setRecipeConfigFile("brewing", FIRST_FLUIDSTACK_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sFluidHeaterRecipes = new GT_Recipe_Map( - new HashSet<>(10), - "gt.recipe.fluidheater", - "Fluid Heater", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidHeater"), - 1, - 0, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_HEATER_1) - .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_HEATER_2) - .setRecipeConfigFile("fluidheater", FIRST_FLUIDSTACK_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); + new HashSet<>(10), + "gt.recipe.fluidheater", + "Fluid Heater", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidHeater"), + 1, + 0, + 0, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_HEATER_1) + .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_HEATER_2) + .setRecipeConfigFile("fluidheater", FIRST_FLUIDSTACK_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sDistilleryRecipes = new GT_Recipe_Map( - new HashSet<>(400), - "gt.recipe.distillery", - "Distillery", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Distillery"), - 1, - 1, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_BEAKER_1) - .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_BEAKER_2) - .setRecipeConfigFile("distillery", FIRST_FLUIDSTACK_OUTPUT) - .setRecipeSpecialHandler(r -> { - int aInput = r.mFluidInputs[0].amount, aOutput = r.mFluidOutputs[0].amount, - aDuration = r.mDuration; - - // reduce the batch size if fluid amount is exceeding - int tScale = (Math.max(aInput, aOutput) + 999) / 1000; - if (tScale <= 0) tScale = 1; - if (tScale > 1) { - // trying to find whether there is a better factor - for (int i = tScale; i <= 5; i++) { - if (aInput % i == 0 && aDuration % i == 0) { - tScale = i; - break; - } - } - for (int i = tScale; i <= 5; i++) { - if (aInput % i == 0 && aDuration % i == 0 && aOutput % i == 0) { - tScale = i; - break; - } - } - aInput = (aInput + tScale - 1) / tScale; - aOutput = aOutput / tScale; - if (!isArrayEmptyOrNull(r.mOutputs)) { - ItemData tData = GT_OreDictUnificator.getItemData(r.mOutputs[0]); - if (tData != null && (tData.mPrefix == OrePrefixes.dust - || OrePrefixes.dust.mFamiliarPrefixes.contains(tData.mPrefix))) { - r.mOutputs[0] = GT_OreDictUnificator.getDust( - tData.mMaterial.mMaterial, - tData.mMaterial.mAmount * r.mOutputs[0].stackSize / tScale); - } else { - if (r.mOutputs[0].stackSize / tScale == 0) r.mOutputs[0] = GT_Values.NI; - else r.mOutputs[0] = GT_Utility.copyAmount( - r.mOutputs[0].stackSize / tScale, - r.mOutputs[0]); - } - } - aDuration = (aDuration + tScale - 1) / tScale; - r.mFluidInputs[0] = GT_Utility.copyAmount(aInput, r.mFluidInputs[0]); - r.mFluidOutputs[0] = GT_Utility.copyAmount(aOutput, r.mFluidOutputs[0]); - r.mDuration = aDuration; - } - }) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); + new HashSet<>(400), + "gt.recipe.distillery", + "Distillery", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Distillery"), + 1, + 1, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_BEAKER_1) + .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_BEAKER_2) + .setRecipeConfigFile("distillery", FIRST_FLUIDSTACK_OUTPUT) + .setRecipeSpecialHandler(r -> { + int aInput = r.mFluidInputs[0].amount, aOutput = r.mFluidOutputs[0].amount, aDuration = r.mDuration; + + // reduce the batch size if fluid amount is exceeding + int tScale = (Math.max(aInput, aOutput) + 999) / 1000; + if (tScale <= 0) tScale = 1; + if (tScale > 1) { + // trying to find whether there is a better factor + for (int i = tScale; i <= 5; i++) { + if (aInput % i == 0 && aDuration % i == 0) { + tScale = i; + break; + } + } + for (int i = tScale; i <= 5; i++) { + if (aInput % i == 0 && aDuration % i == 0 && aOutput % i == 0) { + tScale = i; + break; + } + } + aInput = (aInput + tScale - 1) / tScale; + aOutput = aOutput / tScale; + if (!isArrayEmptyOrNull(r.mOutputs)) { + ItemData tData = GT_OreDictUnificator.getItemData(r.mOutputs[0]); + if (tData != null && (tData.mPrefix == OrePrefixes.dust + || OrePrefixes.dust.mFamiliarPrefixes.contains(tData.mPrefix))) { + r.mOutputs[0] = GT_OreDictUnificator.getDust( + tData.mMaterial.mMaterial, + tData.mMaterial.mAmount * r.mOutputs[0].stackSize / tScale); + } else { + if (r.mOutputs[0].stackSize / tScale == 0) r.mOutputs[0] = GT_Values.NI; + else r.mOutputs[0] = GT_Utility + .copyAmount(r.mOutputs[0].stackSize / tScale, r.mOutputs[0]); + } + } + aDuration = (aDuration + tScale - 1) / tScale; + r.mFluidInputs[0] = GT_Utility.copyAmount(aInput, r.mFluidInputs[0]); + r.mFluidOutputs[0] = GT_Utility.copyAmount(aOutput, r.mFluidOutputs[0]); + r.mDuration = aDuration; + } + }) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sFermentingRecipes = new GT_Recipe_Map( - new HashSet<>(50), - "gt.recipe.fermenter", - "Fermenter", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Fermenter"), - 0, - 0, - 0, - 1, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("fermenting", FIRST_FLUIDSTACK_OUTPUT); + new HashSet<>(50), + "gt.recipe.fermenter", + "Fermenter", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Fermenter"), + 0, + 0, + 0, + 1, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("fermenting", FIRST_FLUIDSTACK_OUTPUT); public static final GT_Recipe_Map sFluidSolidficationRecipes = new GT_Recipe_Map( - new HashSet<>(35000), - "gt.recipe.fluidsolidifier", - "Fluid Solidifier", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidSolidifier"), - 1, - 1, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MOLD) - .setRecipeConfigFile("fluidsolidifier", FIRST_ITEM_OUTPUT) - .setRecipeSpecialHandler(r -> { - if (ArrayUtils.isNotEmpty(r.mFluidInputs)) { - if (Materials.PhasedGold.getMolten(1) - .isFluidEqual(r.mFluidInputs[0])) - r.mFluidInputs = new FluidStack[] { - Materials.VibrantAlloy.getMolten(r.mFluidInputs[0].amount) }; - else if (Materials.PhasedIron.getMolten(1) - .isFluidEqual(r.mFluidInputs[0])) - r.mFluidInputs = new FluidStack[] { - Materials.PulsatingIron.getMolten(r.mFluidInputs[0].amount) }; - } - }) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(35000), + "gt.recipe.fluidsolidifier", + "Fluid Solidifier", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidSolidifier"), + 1, + 1, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MOLD) + .setRecipeConfigFile("fluidsolidifier", FIRST_ITEM_OUTPUT) + .setRecipeSpecialHandler(r -> { + if (ArrayUtils.isNotEmpty(r.mFluidInputs)) { + if (Materials.PhasedGold.getMolten(1) + .isFluidEqual(r.mFluidInputs[0])) + r.mFluidInputs = new FluidStack[] { + Materials.VibrantAlloy.getMolten(r.mFluidInputs[0].amount) }; + else if (Materials.PhasedIron.getMolten(1) + .isFluidEqual(r.mFluidInputs[0])) + r.mFluidInputs = new FluidStack[] { + Materials.PulsatingIron.getMolten(r.mFluidInputs[0].amount) }; + } + }) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sFluidExtractionRecipes = new GT_Recipe_Map( - new HashSet<>(15000), - "gt.recipe.fluidextractor", - "Fluid Extractor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidExtractor"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) - .setRecipeConfigFile("fluidextractor", FIRST_ITEM_INPUT) - .setRecipeSpecialHandler(r -> { - if (ArrayUtils.isNotEmpty(r.mFluidInputs)) { - if (Materials.PhasedGold.getMolten(1) - .isFluidEqual(r.mFluidInputs[0])) - r.mFluidInputs = new FluidStack[] { - Materials.VibrantAlloy.getMolten(r.mFluidInputs[0].amount) }; - else if (Materials.PhasedIron.getMolten(1) - .isFluidEqual(r.mFluidInputs[0])) - r.mFluidInputs = new FluidStack[] { - Materials.PulsatingIron.getMolten(r.mFluidInputs[0].amount) }; - } - }) - .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); + new HashSet<>(15000), + "gt.recipe.fluidextractor", + "Fluid Extractor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidExtractor"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) + .setRecipeConfigFile("fluidextractor", FIRST_ITEM_INPUT) + .setRecipeSpecialHandler(r -> { + if (ArrayUtils.isNotEmpty(r.mFluidInputs)) { + if (Materials.PhasedGold.getMolten(1) + .isFluidEqual(r.mFluidInputs[0])) + r.mFluidInputs = new FluidStack[] { + Materials.VibrantAlloy.getMolten(r.mFluidInputs[0].amount) }; + else if (Materials.PhasedIron.getMolten(1) + .isFluidEqual(r.mFluidInputs[0])) + r.mFluidInputs = new FluidStack[] { + Materials.PulsatingIron.getMolten(r.mFluidInputs[0].amount) }; + } + }) + .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sBoxinatorRecipes = new GT_Recipe_Map( - new HashSet<>(2500), - "gt.recipe.packager", - "Packager", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Packager"), - 2, - 1, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_BOX) - .setRecipeConfigFile("boxing", FIRST_ITEM_OUTPUT) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_BOXED) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(2500), + "gt.recipe.packager", + "Packager", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Packager"), + 2, + 1, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_BOX) + .setRecipeConfigFile("boxing", FIRST_ITEM_OUTPUT) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_BOXED) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sUnboxinatorRecipes = new GT_Recipe_Map_Unboxinator( - new HashSet<>(2500), - "gt.recipe.unpackager", - "Unpackager", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Unpackager"), - 1, - 2, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BOXED) - .setRecipeConfigFile("unboxing", FIRST_ITEM_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(2500), + "gt.recipe.unpackager", + "Unpackager", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Unpackager"), + 1, + 2, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BOXED) + .setRecipeConfigFile("unboxing", FIRST_ITEM_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); /** * Usually, but not always, you should use {@link GT_RecipeConstants#Fusion} instead. */ public static final GT_Recipe_Map sFusionRecipes = new GT_Recipe_Map_FluidOnly( - new HashSet<>(50), - "gt.recipe.fusionreactor", - "Fusion Reactor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FusionReactor"), - 0, - 0, - 0, - 2, - 1, - "Start: ", - 1, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .useComparatorForNEI(true) - .setUsualFluidInputCount(2) - .setRecipeConfigFile("fusion", FIRST_FLUID_OUTPUT) - .setDisableOptimize(true) - .setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE); + new HashSet<>(50), + "gt.recipe.fusionreactor", + "Fusion Reactor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FusionReactor"), + 0, + 0, + 0, + 2, + 1, + "Start: ", + 1, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .useComparatorForNEI(true) + .setUsualFluidInputCount(2) + .setRecipeConfigFile("fusion", FIRST_FLUID_OUTPUT) + .setDisableOptimize(true) + .setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE); /** * Usually, but not always, you should use {@link GT_RecipeConstants#Fusion} instead. */ public static final GT_Recipe_Map sComplexFusionRecipes = new GT_Recipe_Map_ComplexFusion( - new HashSet<>(50), - "gt.recipe.complexfusionreactor", - "Complex Fusion Reactor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ComplexFusionReactor"), - 3, - 0, - 0, - 2, - 1, - "Start: ", - 1, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setUsualFluidInputCount(16) - .setUsualFluidOutputCount(16) - .setNEITransferRect(new Rectangle(79, 34, 18, 18)) - .setLogoPos(80, 61) - .setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE) - .setDisableOptimize(true); + new HashSet<>(50), + "gt.recipe.complexfusionreactor", + "Complex Fusion Reactor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ComplexFusionReactor"), + 3, + 0, + 0, + 2, + 1, + "Start: ", + 1, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setUsualFluidInputCount(16) + .setUsualFluidOutputCount(16) + .setNEITransferRect(new Rectangle(79, 34, 18, 18)) + .setLogoPos(80, 61) + .setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE) + .setDisableOptimize(true); public static final GT_Recipe_Map sCentrifugeRecipes = new GT_Recipe_Map( - new HashSet<>(1200), - "gt.recipe.centrifuge", - "Centrifuge", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Centrifuge"), - 2, - 6, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) - .setRecipeConfigFile("centrifuge", FIRST_ITEM_OR_FLUID_INPUT) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) - .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_FLUID) - .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); + new HashSet<>(1200), + "gt.recipe.centrifuge", + "Centrifuge", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Centrifuge"), + 2, + 6, + 0, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) + .setRecipeConfigFile("centrifuge", FIRST_ITEM_OR_FLUID_INPUT) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) + .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_FLUID) + .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sElectrolyzerRecipes = new GT_Recipe_Map( - new HashSet<>(300), - "gt.recipe.electrolyzer", - "Electrolyzer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Electrolyzer"), - 2, - 6, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CHARGER) - .setRecipeConfigFile("electrolyzer", FIRST_ITEM_OR_FLUID_INPUT) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) - .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_CHARGER_FLUID) - .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); + new HashSet<>(300), + "gt.recipe.electrolyzer", + "Electrolyzer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Electrolyzer"), + 2, + 6, + 0, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CHARGER) + .setRecipeConfigFile("electrolyzer", FIRST_ITEM_OR_FLUID_INPUT) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) + .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_CHARGER_FLUID) + .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); /** * Use {@link GT_RecipeConstants#COIL_HEAT} as heat level. */ public static final GT_Recipe_Map sBlastRecipes = new GT_Recipe_Map( - new HashSet<>(800), - "gt.recipe.blastfurnace", - "Blast Furnace", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 6, - 6, - 1, - 0, - 1, - "Heat Capacity: ", - 1, - " K", - false, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("blastfurnace", FIRST_ITEM_INPUT) - .setNEISpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE); + new HashSet<>(800), + "gt.recipe.blastfurnace", + "Blast Furnace", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 6, + 6, + 1, + 0, + 1, + "Heat Capacity: ", + 1, + " K", + false, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("blastfurnace", FIRST_ITEM_INPUT) + .setNEISpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE); /** * Use {@link GT_RecipeConstants#COIL_HEAT} as heat level. */ public static final GT_Recipe_Map sPlasmaForgeRecipes = new GT_Recipe_Map_LargeNEI( - new HashSet<>(20), - "gt.recipe.plasmaforge", - "DTPF", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PlasmaForge"), - 9, - 9, - 0, - 0, - 1, - "Heat Capacity: ", - 1, - " K", - false, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setUsualFluidInputCount(9) - .setUsualFluidOutputCount(9) - .setDisableOptimize(true) - .setNEISpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE); + new HashSet<>(20), + "gt.recipe.plasmaforge", + "DTPF", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PlasmaForge"), + 9, + 9, + 0, + 0, + 1, + "Heat Capacity: ", + 1, + " K", + false, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setUsualFluidInputCount(9) + .setUsualFluidOutputCount(9) + .setDisableOptimize(true) + .setNEISpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE); public static final GT_Recipe_Map sTranscendentPlasmaMixerRecipes = new TranscendentPlasmaMixerRecipeMap( - new HashSet<>(20), - "gt.recipe.transcendentplasmamixerrecipes", - "Transcendent Plasma Mixer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PlasmaForge"), - 1, - 0, - 0, - 0, - 1, - "", - 0, - "", - false, - true).setDisableOptimize(true); + new HashSet<>(20), + "gt.recipe.transcendentplasmamixerrecipes", + "Transcendent Plasma Mixer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PlasmaForge"), + 1, + 0, + 0, + 0, + 1, + "", + 0, + "", + false, + true).setDisableOptimize(true); public static class GT_FakeSpaceProjectRecipe extends GT_Recipe { public final String projectName; public GT_FakeSpaceProjectRecipe(boolean aOptimize, ItemStack[] aInputs, FluidStack[] aFluidInputs, - int aDuration, int aEUt, int aSpecialValue, String projectName) { + int aDuration, int aEUt, int aSpecialValue, String projectName) { super(aOptimize, aInputs, null, null, null, aFluidInputs, null, aDuration, aEUt, aSpecialValue); this.projectName = projectName; } } public static final GT_Recipe_Map sFakeSpaceProjectRecipes = new GT_Recipe_Map( - new HashSet<>(20), - "gt.recipe.fakespaceprojects", - "Space Projects", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 12, - 0, - 0, - 0, - 1, - translateToLocal("gt.specialvalue.stages") + " ", - 1, - "", - false, - true) { + new HashSet<>(20), + "gt.recipe.fakespaceprojects", + "Space Projects", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 12, + 0, + 0, + 0, + 1, + translateToLocal("gt.specialvalue.stages") + " ", + 1, + "", + false, + true) { IDrawable projectTexture; @Override public ModularWindow.Builder createNEITemplate(IItemHandlerModifiable itemInputsInventory, - IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory, - IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory, - Supplier<Float> progressSupplier, Pos2d windowOffset) { + IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory, + IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory, + Supplier<Float> progressSupplier, Pos2d windowOffset) { ModularWindow.Builder builder = super.createNEITemplate( - itemInputsInventory, - itemOutputsInventory, - specialSlotInventory, - fluidInputsInventory, - fluidOutputsInventory, - progressSupplier, - windowOffset); + itemInputsInventory, + itemOutputsInventory, + specialSlotInventory, + fluidInputsInventory, + fluidOutputsInventory, + progressSupplier, + windowOffset); addRecipeSpecificDrawable( - builder, - windowOffset, - () -> projectTexture, - new Pos2d(124, 28), - new Size(18, 18)); + builder, + windowOffset, + () -> projectTexture, + new Pos2d(124, 28), + new Size(18, 18)); return builder; } @@ -1990,7 +1982,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { @Override protected List<String> handleNEIItemInputTooltip(List<String> currentTip, - GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + GT_NEI_DefaultHandler.FixedPositionedStack pStack) { super.handleNEIItemOutputTooltip(currentTip, pStack); if (pStack.item != null && pStack.item.getItem() instanceof GT_FluidDisplayItem) return currentTip; currentTip.add(GRAY + translateToLocal("Item Count: ") + formatNumbers(pStack.realStackSize)); @@ -2001,7 +1993,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public void drawNEIOverlays(GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { for (PositionedStack stack : neiCachedRecipe.mInputs) { if (stack instanceof GT_NEI_DefaultHandler.FixedPositionedStack && stack.item != null - && !(stack.item.getItem() instanceof GT_FluidDisplayItem)) { + && !(stack.item.getItem() instanceof GT_FluidDisplayItem)) { int stackSize = ((GT_NEI_DefaultHandler.FixedPositionedStack) stack).realStackSize; String displayString; if (stack.item.stackSize > 9999) { @@ -2013,75 +2005,68 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } } if (neiCachedRecipe.mRecipe instanceof GT_FakeSpaceProjectRecipe) { - ISpaceProject project = SpaceProjectManager.getProject( - ((GT_FakeSpaceProjectRecipe) neiCachedRecipe.mRecipe).projectName); + ISpaceProject project = SpaceProjectManager + .getProject(((GT_FakeSpaceProjectRecipe) neiCachedRecipe.mRecipe).projectName); if (project != null) { projectTexture = project.getTexture(); - GuiDraw.drawStringC( - EnumChatFormatting.BOLD + project.getLocalizedName(), - 85, - 0, - 0x404040, - false); + GuiDraw + .drawStringC(EnumChatFormatting.BOLD + project.getLocalizedName(), 85, 0, 0x404040, false); } } } @Override public void addProgressBarUI(ModularWindow.Builder builder, Supplier<Float> progressSupplier, - Pos2d windowOffset) { + Pos2d windowOffset) { int bar1Width = 17; int bar2Width = 18; builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1, 17) - .setDirection(ProgressBar.Direction.RIGHT) - .setProgress( - () -> progressSupplier.get() - * ((float) (bar1Width + bar2Width) / bar1Width)) - .setSynced(false, false) - .setPos(new Pos2d(70, 28).add(windowOffset)) - .setSize(bar1Width, 72)); + new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1, 17) + .setDirection(ProgressBar.Direction.RIGHT) + .setProgress(() -> progressSupplier.get() * ((float) (bar1Width + bar2Width) / bar1Width)) + .setSynced(false, false) + .setPos(new Pos2d(70, 28).add(windowOffset)) + .setSize(bar1Width, 72)); builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_2, 18) - .setDirection(ProgressBar.Direction.RIGHT) - .setProgress( - () -> (progressSupplier.get() - - ((float) bar1Width / (bar1Width + bar2Width))) - * ((float) (bar1Width + bar2Width) / bar2Width)) - .setSynced(false, false) - .setPos(new Pos2d(106, 28).add(windowOffset)) - .setSize(bar2Width, 72)); + new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_2, 18) + .setDirection(ProgressBar.Direction.RIGHT) + .setProgress( + () -> (progressSupplier.get() - ((float) bar1Width / (bar1Width + bar2Width))) + * ((float) (bar1Width + bar2Width) / bar2Width)) + .setSynced(false, false) + .setPos(new Pos2d(106, 28).add(windowOffset)) + .setSize(bar2Width, 72)); } }.useModularUI(true) - .setRenderRealStackSizes(false) - .setUsualFluidInputCount(4) - .setNEIBackgroundOffset(2, 23) - .setLogoPos(152, 83) - .setDisableOptimize(true); + .setRenderRealStackSizes(false) + .setUsualFluidInputCount(4) + .setNEIBackgroundOffset(2, 23) + .setLogoPos(152, 83) + .setDisableOptimize(true); public static class TranscendentPlasmaMixerRecipeMap extends GT_Recipe_Map { public TranscendentPlasmaMixerRecipeMap(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, - String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, + int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); useModularUI(true); setUsualFluidInputCount(16); setUsualFluidOutputCount(1); @@ -2110,8 +2095,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { // These look odd because recipeInfo.recipe.mEUt is actually the EU per litre of fluid processed, not // the EU/t. drawNEIText( - recipeInfo, - GT_Utility.trans("152", "Total: ") + formatNumbers(1000L * recipeInfo.recipe.mEUt) + " EU"); + recipeInfo, + GT_Utility.trans("152", "Total: ") + formatNumbers(1000L * recipeInfo.recipe.mEUt) + " EU"); // 1000 / (20 ticks * 5 seconds) = 10L/t. 10L/t * x EU/L = 10 * x EU/t. drawNEIText(recipeInfo, "Average: " + formatNumbers(10L * recipeInfo.recipe.mEUt) + " EU/t"); } @@ -2121,247 +2106,236 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * Uses {@link GT_RecipeConstants#ADDITIVE_AMOUNT} for coal/charcoal amount. */ public static final GT_Recipe_Map sPrimitiveBlastRecipes = new GT_Recipe_Map( - new HashSet<>(200), - "gt.recipe.primitiveblastfurnace", - "Primitive Blast Furnace", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 3, - 3, - 1, - 0, - 1, - E, - 1, - E, - false, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setRecipeEmitter(builder -> { - Optional<GT_Recipe> rr = builder.validateInputCount(1, 2) - .validateOutputCount(1, 2) - .validateNoInputFluid() - .validateNoOutputFluid() - .noOptimize() - .build(); - if (!rr.isPresent()) return Collections.emptyList(); - ItemStack aInput1 = builder.getItemInputBasic(0); - ItemStack aInput2 = builder.getItemInputBasic(1); - ItemStack aOutput1 = builder.getItemOutput(0); - ItemStack aOutput2 = builder.getItemOutput(1); - if ((aInput1 == null && aInput2 == null) || (aOutput1 == null && aOutput2 == null)) - return Collections.emptyList(); - int aCoalAmount = builder.getMetadata(ADDITIVE_AMOUNT); - if (aCoalAmount <= 0) return Collections.emptyList(); - GT_RecipeTemplate coll = asTemplate(rr.get()); - for (Materials coal : new Materials[] { Materials.Coal, Materials.Charcoal }) { - coll.derive() - .setInputs(aInput1, aInput2, coal.getGems(aCoalAmount)) - .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)); - coll.derive() - .setInputs(aInput1, aInput2, coal.getDust(aCoalAmount)) - .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)); - } - int aDuration = builder.duration; - if (Railcraft.isModLoaded()) { - coll.derive() - .setInputs(aInput1, aInput2, RailcraftToolItems.getCoalCoke(aCoalAmount / 2)) - .setOutputs(aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount / 2)) - .setDuration(aDuration * 2 / 3); - } - if (GTPlusPlus.isModLoaded()) { - ItemStack cactusCoke = GT_ModHandler.getModItem( - GTPlusPlus.ID, - "itemCactusCoke", - aCoalAmount * 2L); - ItemStack sugarCoke = GT_ModHandler.getModItem( - GTPlusPlus.ID, - "itemSugarCoke", - aCoalAmount * 2L); - coll.derive() - .setInputs(aInput1, aInput2, cactusCoke) - .setOutputs(aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2)) - .setDuration(aDuration * 2 / 3); - coll.derive() - .setInputs(aInput1, aInput2, sugarCoke) - .setOutputs(aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2)) - .setDuration(aDuration * 2 / 3); - } - if ((aInput1 == null || aInput1.stackSize <= 6) && (aInput2 == null || aInput2.stackSize <= 6) - && (aOutput1 == null || aOutput1.stackSize <= 6) - && (aOutput2 == null || aOutput2.stackSize <= 6)) { - // we don't use GT_Utility.mul() here. It does not have the truncating we need here. - aInput1 = GT_Utility.multiplyStack(10L, aInput1); - aInput2 = GT_Utility.multiplyStack(10L, aInput2); - aOutput1 = GT_Utility.multiplyStack(10L, aOutput1); - aOutput2 = GT_Utility.multiplyStack(10L, aOutput2); - for (Materials coal : new Materials[] { Materials.Coal, Materials.Charcoal }) { - coll.derive() - .setInputs(aInput1, aInput2, coal.getBlocks(aCoalAmount)) - .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)) - .setDuration(aDuration * 10); - coll.derive() - .setInputs(aInput1, aInput2, coal.getBlocks(aCoalAmount)) - .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)) - .setDuration(aDuration * 10); - } - if (Railcraft.isModLoaded()) { - coll.derive() - .setInputs(aInput1, aInput2, EnumCube.COKE_BLOCK.getItem(aCoalAmount / 2)) - .setOutputs(aOutput1, aOutput2, Materials.Ash.getDust(aCoalAmount / 2)) - .setDuration(aDuration * 20 / 3); - } - } - return coll.getAll(); - }) - .setRecipeConfigFile("primitiveblastfurnace", FIRST_ITEM_INPUT); + new HashSet<>(200), + "gt.recipe.primitiveblastfurnace", + "Primitive Blast Furnace", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 3, + 3, + 1, + 0, + 1, + E, + 1, + E, + false, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setRecipeEmitter(builder -> { + Optional<GT_Recipe> rr = builder.validateInputCount(1, 2) + .validateOutputCount(1, 2) + .validateNoInputFluid() + .validateNoOutputFluid() + .noOptimize() + .build(); + if (!rr.isPresent()) return Collections.emptyList(); + ItemStack aInput1 = builder.getItemInputBasic(0); + ItemStack aInput2 = builder.getItemInputBasic(1); + ItemStack aOutput1 = builder.getItemOutput(0); + ItemStack aOutput2 = builder.getItemOutput(1); + if ((aInput1 == null && aInput2 == null) || (aOutput1 == null && aOutput2 == null)) + return Collections.emptyList(); + int aCoalAmount = builder.getMetadata(ADDITIVE_AMOUNT); + if (aCoalAmount <= 0) return Collections.emptyList(); + GT_RecipeTemplate coll = asTemplate(rr.get()); + for (Materials coal : new Materials[] { Materials.Coal, Materials.Charcoal }) { + coll.derive() + .setInputs(aInput1, aInput2, coal.getGems(aCoalAmount)) + .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)); + coll.derive() + .setInputs(aInput1, aInput2, coal.getDust(aCoalAmount)) + .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)); + } + int aDuration = builder.duration; + if (Railcraft.isModLoaded()) { + coll.derive() + .setInputs(aInput1, aInput2, RailcraftToolItems.getCoalCoke(aCoalAmount / 2)) + .setOutputs(aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount / 2)) + .setDuration(aDuration * 2 / 3); + } + if (GTPlusPlus.isModLoaded()) { + ItemStack cactusCoke = GT_ModHandler + .getModItem(GTPlusPlus.ID, "itemCactusCoke", aCoalAmount * 2L); + ItemStack sugarCoke = GT_ModHandler + .getModItem(GTPlusPlus.ID, "itemSugarCoke", aCoalAmount * 2L); + coll.derive() + .setInputs(aInput1, aInput2, cactusCoke) + .setOutputs(aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2)) + .setDuration(aDuration * 2 / 3); + coll.derive() + .setInputs(aInput1, aInput2, sugarCoke) + .setOutputs(aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2)) + .setDuration(aDuration * 2 / 3); + } + if ((aInput1 == null || aInput1.stackSize <= 6) && (aInput2 == null || aInput2.stackSize <= 6) + && (aOutput1 == null || aOutput1.stackSize <= 6) + && (aOutput2 == null || aOutput2.stackSize <= 6)) { + // we don't use GT_Utility.mul() here. It does not have the truncating we need here. + aInput1 = GT_Utility.multiplyStack(10L, aInput1); + aInput2 = GT_Utility.multiplyStack(10L, aInput2); + aOutput1 = GT_Utility.multiplyStack(10L, aOutput1); + aOutput2 = GT_Utility.multiplyStack(10L, aOutput2); + for (Materials coal : new Materials[] { Materials.Coal, Materials.Charcoal }) { + coll.derive() + .setInputs(aInput1, aInput2, coal.getBlocks(aCoalAmount)) + .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)) + .setDuration(aDuration * 10); + coll.derive() + .setInputs(aInput1, aInput2, coal.getBlocks(aCoalAmount)) + .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)) + .setDuration(aDuration * 10); + } + if (Railcraft.isModLoaded()) { + coll.derive() + .setInputs(aInput1, aInput2, EnumCube.COKE_BLOCK.getItem(aCoalAmount / 2)) + .setOutputs(aOutput1, aOutput2, Materials.Ash.getDust(aCoalAmount / 2)) + .setDuration(aDuration * 20 / 3); + } + } + return coll.getAll(); + }) + .setRecipeConfigFile("primitiveblastfurnace", FIRST_ITEM_INPUT); /** * Uses {@link GT_RecipeConstants#ADDITIVE_AMOUNT} for TNT/ITNT/... amount. Value is truncated to [0, 64] */ public static final GT_Recipe_Map sImplosionRecipes = new GT_Recipe_Map( - new HashSet<>(900), - "gt.recipe.implosioncompressor", - "Implosion Compressor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 2, - 2, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_IMPLOSION) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_EXPLOSIVE) - .setRecipeConfigFile("implosion", FIRST_ITEM_INPUT) - .setRecipeEmitter(b -> { - switch (b.getItemInputsBasic().length) { - case 0: - return Collections.emptyList(); - case 1: - break; - default: - return b.build() - .map(Collections::singletonList) - .orElse(Collections.emptyList()); - } - Optional<GT_Recipe> t = b.noOptimize() - .duration(20) - .eut(30) - .validateInputCount(1, 1) - .validateOutputCount(1, 1) - .build(); - if (!t.isPresent()) return Collections.emptyList(); - ItemStack input = b.getItemInputBasic(0); - GT_RecipeTemplate coll = asTemplate(t.get()); - int tExplosives = Math.min(b.getMetadata(ADDITIVE_AMOUNT), 64); - int tGunpowder = tExplosives << 1; // Worst - int tDynamite = Math.max(1, tExplosives >> 1); // good - int tTNT = tExplosives; // Slightly better - int tITNT = Math.max(1, tExplosives >> 2); // the best - if (tGunpowder < 65) coll.derive() - .setInputs(input, ItemList.Block_Powderbarrel.get(tGunpowder)); - if (tDynamite < 17) coll.derive() - .setInputs( - input, - GT_ModHandler.getIC2Item("dynamite", tDynamite, null)); - coll.derive() - .setInputs(input, new ItemStack(Blocks.tnt, tTNT)); - coll.derive() - .setInputs(input, GT_ModHandler.getIC2Item("industrialTnt", tITNT, null)); - return coll.getAll(); - }) - .setDisableOptimize(true) - .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); + new HashSet<>(900), + "gt.recipe.implosioncompressor", + "Implosion Compressor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 2, + 2, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_IMPLOSION) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_EXPLOSIVE) + .setRecipeConfigFile("implosion", FIRST_ITEM_INPUT) + .setRecipeEmitter(b -> { + switch (b.getItemInputsBasic().length) { + case 0: + return Collections.emptyList(); + case 1: + break; + default: + return b.build() + .map(Collections::singletonList) + .orElse(Collections.emptyList()); + } + Optional<GT_Recipe> t = b.noOptimize() + .duration(20) + .eut(30) + .validateInputCount(1, 1) + .validateOutputCount(1, 1) + .build(); + if (!t.isPresent()) return Collections.emptyList(); + ItemStack input = b.getItemInputBasic(0); + GT_RecipeTemplate coll = asTemplate(t.get()); + int tExplosives = Math.min(b.getMetadata(ADDITIVE_AMOUNT), 64); + int tGunpowder = tExplosives << 1; // Worst + int tDynamite = Math.max(1, tExplosives >> 1); // good + int tTNT = tExplosives; // Slightly better + int tITNT = Math.max(1, tExplosives >> 2); // the best + if (tGunpowder < 65) coll.derive() + .setInputs(input, ItemList.Block_Powderbarrel.get(tGunpowder)); + if (tDynamite < 17) coll.derive() + .setInputs(input, GT_ModHandler.getIC2Item("dynamite", tDynamite, null)); + coll.derive() + .setInputs(input, new ItemStack(Blocks.tnt, tTNT)); + coll.derive() + .setInputs(input, GT_ModHandler.getIC2Item("industrialTnt", tITNT, null)); + return coll.getAll(); + }) + .setDisableOptimize(true) + .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sVacuumRecipes = new GT_Recipe_Map( - new HashSet<>(305), - "gt.recipe.vacuumfreezer", - "Vacuum Freezer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - E, - 1, - E, - false, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("vacuumfreezer", FIRST_ITEM_INPUT) - .setRecipeEmitter(b -> { - b.noOptimize(); - FluidStack in, out; - if (isArrayOfLength(b.getItemInputsBasic(), 1) && isArrayOfLength(b.getItemOutputs(), 1) - && isArrayEmptyOrNull(b.getFluidInputs()) - && isArrayEmptyOrNull(b.getFluidOutputs()) - && (in = GT_Utility.getFluidForFilledItem(b.getItemInputBasic(0), true)) != null - && (out = GT_Utility.getFluidForFilledItem(b.getItemOutput(0), true)) != null) { - return Arrays.asList( - b.build() - .get(), - b.fluidInputs(in) - .fluidOutputs(out) - .noItemInputs() - .noItemOutputs() - .build() - .get()); - } - return buildOrEmpty(b); - }) - .setUsualFluidInputCount(2); + new HashSet<>(305), + "gt.recipe.vacuumfreezer", + "Vacuum Freezer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + E, + 1, + E, + false, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("vacuumfreezer", FIRST_ITEM_INPUT) + .setRecipeEmitter(b -> { + b.noOptimize(); + FluidStack in, out; + if (isArrayOfLength(b.getItemInputsBasic(), 1) && isArrayOfLength(b.getItemOutputs(), 1) + && isArrayEmptyOrNull(b.getFluidInputs()) + && isArrayEmptyOrNull(b.getFluidOutputs()) + && (in = GT_Utility.getFluidForFilledItem(b.getItemInputBasic(0), true)) != null + && (out = GT_Utility.getFluidForFilledItem(b.getItemOutput(0), true)) != null) { + return Arrays.asList( + b.build() + .get(), + b.fluidInputs(in) + .fluidOutputs(out) + .noItemInputs() + .noItemOutputs() + .build() + .get()); + } + return buildOrEmpty(b); + }) + .setUsualFluidInputCount(2); /** * using {@code .addTo(sChemicalRecipes)} will cause the recipe to be added to single block recipe map ONLY! * use {@link GT_RecipeConstants#UniversalChemical} to add to both. */ public static final GT_Recipe_Map sChemicalRecipes = new GT_Recipe_Map( - new HashSet<>(1170), - "gt.recipe.chemicalreactor", - "Chemical Reactor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ChemicalReactor"), - 2, - 2, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_MOLECULAR_1) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_2) - .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_3) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_VIAL_1) - .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_VIAL_2) - .setRecipeConfigFile("chemicalreactor", FIRST_ITEM_OR_FLUID_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); + new HashSet<>(1170), + "gt.recipe.chemicalreactor", + "Chemical Reactor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ChemicalReactor"), + 2, + 2, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_MOLECULAR_1) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_2) + .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_3) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_VIAL_1) + .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_VIAL_2) + .setRecipeConfigFile("chemicalreactor", FIRST_ITEM_OR_FLUID_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); /** * using {@code .addTo(sChemicalRecipes)} will cause the recipe to be added to multiblock recipe map ONLY! * use {@link GT_RecipeConstants#UniversalChemical} to add to both. */ public static final GT_Recipe_Map sMultiblockChemicalRecipes = // - new GT_Recipe_Map_LargeChemicalReactor().setProgressBar( - GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, - ProgressBar.Direction.RIGHT) - .setUsualFluidInputCount(6) - .setUsualFluidOutputCount(6) - .setDisableOptimize(true); + new GT_Recipe_Map_LargeChemicalReactor() + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT) + .setUsualFluidInputCount(6) + .setUsualFluidOutputCount(6) + .setDisableOptimize(true); public static final GT_Recipe_Map sDistillationRecipes = // - new GT_Recipe_Map_DistillationTower().setRecipeConfigFile("distillation", FIRST_FLUIDSTACK_INPUT) - .setProgressBar( - GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, - ProgressBar.Direction.RIGHT) - .setUsualFluidOutputCount(11) - .setDisableOptimize(true); + new GT_Recipe_Map_DistillationTower().setRecipeConfigFile("distillation", FIRST_FLUIDSTACK_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT) + .setUsualFluidOutputCount(11) + .setDisableOptimize(true); public static final GT_Recipe_Map_OilCracker sCrackingRecipes = (GT_Recipe_Map_OilCracker) // new GT_Recipe_Map_OilCracker().setRecipeConfigFile("cracking", FIRST_FLUIDSTACK_INPUT) - .setProgressBar( - GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, - ProgressBar.Direction.RIGHT) - .setUsualFluidInputCount(2); + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT) + .setUsualFluidInputCount(2); /** * @deprecated Use sCrackingRecipes instead */ @@ -2369,676 +2343,672 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static final GT_Recipe_Map sCrakingRecipes = sCrackingRecipes; public static final GT_Recipe_Map sPyrolyseRecipes = new GT_Recipe_Map( - new HashSet<>(150), - "gt.recipe.pyro", - "Pyrolyse Oven", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 2, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setDisableOptimize(true) - .setRecipeConfigFile("pyrolyse", FIRST_ITEM_INPUT); + new HashSet<>(150), + "gt.recipe.pyro", + "Pyrolyse Oven", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 2, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setDisableOptimize(true) + .setRecipeConfigFile("pyrolyse", FIRST_ITEM_INPUT); public static final GT_Recipe_Map sWiremillRecipes = new GT_Recipe_Map( - new HashSet<>(450), - "gt.recipe.wiremill", - "Wiremill", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Wiremill"), - 2, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_WIREMILL) - .setRecipeConfigFile("wiremill", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_WIREMILL, ProgressBar.Direction.RIGHT); + new HashSet<>(450), + "gt.recipe.wiremill", + "Wiremill", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Wiremill"), + 2, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_WIREMILL) + .setRecipeConfigFile("wiremill", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_WIREMILL, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sBenderRecipes = new GT_Recipe_Map( - new HashSet<>(5000), - "gt.recipe.metalbender", - "Bending Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Bender"), - 2, - 1, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BENDER) - .setRecipeConfigFile("bender", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_BENDING, ProgressBar.Direction.RIGHT); + new HashSet<>(5000), + "gt.recipe.metalbender", + "Bending Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Bender"), + 2, + 1, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BENDER) + .setRecipeConfigFile("bender", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_BENDING, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sAlloySmelterRecipes = new GT_Recipe_Map( - new HashSet<>(12000), - "gt.recipe.alloysmelter", - "Alloy Smelter", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "AlloySmelter"), - 2, - 1, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE) - .setRecipeEmitter(b -> { - if (Materials.Graphite.contains(b.getItemInputBasic(0))) return Collections.emptyList(); - if (GT_Utility.isArrayOfLength(b.getItemInputsBasic(), 1)) { - ItemStack aInput1 = b.getItemInputBasic(0); - if (((OrePrefixes.ingot.contains(aInput1)) || (OrePrefixes.dust.contains(aInput1)) - || (OrePrefixes.gem.contains(aInput1)))) - return Collections.emptyList(); - } - return buildOrEmpty( - b.validateNoInputFluid() - .validateNoOutputFluid() - .validateInputCount(1, 2) - .validateOutputCount(1, 1)); - }) - .setRecipeConfigFile( - "alloysmelting", - r -> GT_Config.getStackConfigName( - GT_Utility.isArrayOfLength(r.mInputs, 1) ? r.mInputs[0] : r.mOutputs[0])) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM) - .setProgressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM); + new HashSet<>(12000), + "gt.recipe.alloysmelter", + "Alloy Smelter", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "AlloySmelter"), + 2, + 1, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE) + .setRecipeEmitter(b -> { + if (Materials.Graphite.contains(b.getItemInputBasic(0))) return Collections.emptyList(); + if (GT_Utility.isArrayOfLength(b.getItemInputsBasic(), 1)) { + ItemStack aInput1 = b.getItemInputBasic(0); + if (((OrePrefixes.ingot.contains(aInput1)) || (OrePrefixes.dust.contains(aInput1)) + || (OrePrefixes.gem.contains(aInput1)))) return Collections.emptyList(); + } + return buildOrEmpty( + b.validateNoInputFluid() + .validateNoOutputFluid() + .validateInputCount(1, 2) + .validateOutputCount(1, 1)); + }) + .setRecipeConfigFile( + "alloysmelting", + r -> GT_Config + .getStackConfigName(GT_Utility.isArrayOfLength(r.mInputs, 1) ? r.mInputs[0] : r.mOutputs[0])) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM) + .setProgressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM); public static final GT_Recipe_Map sAssemblerRecipes = new GT_Recipe_Map_Assembler( - new HashSet<>(8200), - "gt.recipe.assembler", - "Assembler", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Assembler2"), - 9, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CIRCUIT) - .setRecipeConfigFile("assembling", FIRST_ITEM_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT); + new HashSet<>(8200), + "gt.recipe.assembler", + "Assembler", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Assembler2"), + 9, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CIRCUIT) + .setRecipeConfigFile("assembling", FIRST_ITEM_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sCircuitAssemblerRecipes = new GT_Recipe_Map_Assembler( - new HashSet<>(605), - "gt.recipe.circuitassembler", - "Circuit Assembler", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "CircuitAssembler"), - 6, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setNEIUnificateOutput(!NEICustomDiagrams.isModLoaded()) - .setRecipeConfigFile("circuitassembler", FIRST_ITEM_OUTPUT) - .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CIRCUIT) - .setProgressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER, ProgressBar.Direction.RIGHT); + new HashSet<>(605), + "gt.recipe.circuitassembler", + "Circuit Assembler", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "CircuitAssembler"), + 6, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setNEIUnificateOutput(!NEICustomDiagrams.isModLoaded()) + .setRecipeConfigFile("circuitassembler", FIRST_ITEM_OUTPUT) + .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CIRCUIT) + .setProgressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sCannerRecipes = new GT_Recipe_Map( - new HashSet<>(900), - "gt.recipe.canner", - "Canning Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Canner"), - 2, - 2, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CANNER) - .setRecipeConfigFile("canning", FIRST_ITEM_INPUT) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) - .setProgressBar(GT_UITextures.PROGRESSBAR_CANNER, ProgressBar.Direction.RIGHT); + new HashSet<>(900), + "gt.recipe.canner", + "Canning Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Canner"), + 2, + 2, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CANNER) + .setRecipeConfigFile("canning", FIRST_ITEM_INPUT) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) + .setProgressBar(GT_UITextures.PROGRESSBAR_CANNER, ProgressBar.Direction.RIGHT); @Deprecated public static final GT_Recipe_Map sCNCRecipes = new GT_Recipe_Map( - new HashSet<>(100), - "gt.recipe.cncmachine", - "CNC Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 2, - 1, - 2, - 1, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(100), + "gt.recipe.cncmachine", + "CNC Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 2, + 1, + 2, + 1, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sLatheRecipes = new GT_Recipe_Map( - new HashSet<>(1150), - "gt.recipe.lathe", - "Lathe", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Lathe"), - 1, - 2, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_ROD_1) - .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_ROD_2) - .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeConfigFile("lathe", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_LATHE, ProgressBar.Direction.RIGHT) - .addSpecialTexture(5, 18, 98, 24, GT_UITextures.PROGRESSBAR_LATHE_BASE); + new HashSet<>(1150), + "gt.recipe.lathe", + "Lathe", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Lathe"), + 1, + 2, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_ROD_1) + .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_ROD_2) + .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeConfigFile("lathe", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_LATHE, ProgressBar.Direction.RIGHT) + .addSpecialTexture(5, 18, 98, 24, GT_UITextures.PROGRESSBAR_LATHE_BASE); public static final GT_Recipe_Map sCutterRecipes = new GT_Recipe_Map( - new HashSet<>(5125), - "gt.recipe.cuttingsaw", - "Cutting Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Cutter4"), - 2, - 4, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BOX) - .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_CUTTER_SLICED) - .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeEmitter(b -> { - b.validateInputCount(1, 2) - .validateOutputCount(1, 4) - .validateNoOutputFluid(); - if (b.getFluidInputs() != null || !b.isValid()) - return buildOrEmpty(b.validateInputFluidCount(1, 1)); - int aDuration = b.getDuration(), aEUt = b.getEUt(); - Collection<GT_Recipe> ret = new ArrayList<>(); - b.copy() - .fluidInputs(Materials.Water.getFluid(GT_Utility.clamp(aDuration * aEUt / 320, 4, 1000))) - .duration(aDuration * 2) - .build() - .ifPresent(ret::add); - b.copy() - .fluidInputs( - GT_ModHandler.getDistilledWater(GT_Utility.clamp(aDuration * aEUt / 426, 3, 750))) - .duration(aDuration * 2) - .build() - .ifPresent(ret::add); - b.fluidInputs(Materials.Lubricant.getFluid(GT_Utility.clamp(aDuration * aEUt / 1280, 1, 250))) - .duration(aDuration) - .build() - .ifPresent(ret::add); - return ret; - }) - .setRecipeConfigFile("cutting", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_CUT, ProgressBar.Direction.RIGHT); + new HashSet<>(5125), + "gt.recipe.cuttingsaw", + "Cutting Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Cutter4"), + 2, + 4, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BOX) + .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_CUTTER_SLICED) + .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeEmitter(b -> { + b.validateInputCount(1, 2) + .validateOutputCount(1, 4) + .validateNoOutputFluid(); + if (b.getFluidInputs() != null || !b.isValid()) + return buildOrEmpty(b.validateInputFluidCount(1, 1)); + int aDuration = b.getDuration(), aEUt = b.getEUt(); + Collection<GT_Recipe> ret = new ArrayList<>(); + b.copy() + .fluidInputs(Materials.Water.getFluid(GT_Utility.clamp(aDuration * aEUt / 320, 4, 1000))) + .duration(aDuration * 2) + .build() + .ifPresent(ret::add); + b.copy() + .fluidInputs(GT_ModHandler.getDistilledWater(GT_Utility.clamp(aDuration * aEUt / 426, 3, 750))) + .duration(aDuration * 2) + .build() + .ifPresent(ret::add); + b.fluidInputs(Materials.Lubricant.getFluid(GT_Utility.clamp(aDuration * aEUt / 1280, 1, 250))) + .duration(aDuration) + .build() + .ifPresent(ret::add); + return ret; + }) + .setRecipeConfigFile("cutting", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_CUT, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sSlicerRecipes = new GT_Recipe_Map( - new HashSet<>(20), - "gt.recipe.slicer", - "Slicing Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Slicer"), - 2, - 1, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_SQUARE) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_SLICE_SHAPE) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_SLICER_SLICED) - .setRecipeConfigFile("slicer", FIRST_ITEM_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_SLICE, ProgressBar.Direction.RIGHT); + new HashSet<>(20), + "gt.recipe.slicer", + "Slicing Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Slicer"), + 2, + 1, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_SQUARE) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_SLICE_SHAPE) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_SLICER_SLICED) + .setRecipeConfigFile("slicer", FIRST_ITEM_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_SLICE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sExtruderRecipes = new GT_Recipe_Map( - new HashSet<>(13000), - "gt.recipe.extruder", - "Extruder", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Extruder"), - 2, - 1, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_EXTRUDER_SHAPE) - .setRecipeConfigFile("extruder", FIRST_ITEM_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRUDE, ProgressBar.Direction.RIGHT); + new HashSet<>(13000), + "gt.recipe.extruder", + "Extruder", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Extruder"), + 2, + 1, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_EXTRUDER_SHAPE) + .setRecipeConfigFile("extruder", FIRST_ITEM_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRUDE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sHammerRecipes = new GT_Recipe_Map( - new HashSet<>(3800), - "gt.recipe.hammer", - "Forge Hammer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Hammer"), - 2, - 2, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setUsualFluidInputCount(2) - .setUsualFluidOutputCount(2) - .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_HAMMER) - .setRecipeConfigFile("forgehammer", FIRST_ITEM_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_HAMMER, ProgressBar.Direction.DOWN) - .addSpecialTexture(20, 6, 78, 42, GT_UITextures.PROGRESSBAR_HAMMER_BASE) - .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_HAMMER_STEAM) - .setProgressBarSteam(GT_UITextures.PROGRESSBAR_HAMMER_STEAM) - .addSpecialTextureSteam(20, 6, 78, 42, GT_UITextures.PROGRESSBAR_HAMMER_BASE_STEAM); + new HashSet<>(3800), + "gt.recipe.hammer", + "Forge Hammer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Hammer"), + 2, + 2, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setUsualFluidInputCount(2) + .setUsualFluidOutputCount(2) + .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_HAMMER) + .setRecipeConfigFile("forgehammer", FIRST_ITEM_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_HAMMER, ProgressBar.Direction.DOWN) + .addSpecialTexture(20, 6, 78, 42, GT_UITextures.PROGRESSBAR_HAMMER_BASE) + .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_HAMMER_STEAM) + .setProgressBarSteam(GT_UITextures.PROGRESSBAR_HAMMER_STEAM) + .addSpecialTextureSteam(20, 6, 78, 42, GT_UITextures.PROGRESSBAR_HAMMER_BASE_STEAM); public static final GT_Recipe_Map sAmplifiers = new GT_Recipe_Map( - new HashSet<>(2), - "gt.recipe.uuamplifier", - "Amplifabricator", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Amplifabricator"), - 1, - 0, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) - .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_UUA) - .setRecipeConfigFile("amplifier", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); + new HashSet<>(2), + "gt.recipe.uuamplifier", + "Amplifabricator", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Amplifabricator"), + 1, + 0, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) + .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_UUA) + .setRecipeConfigFile("amplifier", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sMassFabFakeRecipes = new GT_Recipe_Map( - new HashSet<>(2), - "gt.recipe.massfab", - "Mass Fabrication", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Massfabricator"), - 1, - 0, - 1, - 0, - 8, - E, - 1, - E, - true, - true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_UUA) - .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_UUM) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(2), + "gt.recipe.massfab", + "Mass Fabrication", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Massfabricator"), + 1, + 0, + 1, + 0, + 8, + E, + 1, + E, + true, + true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_UUA) + .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_UUM) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sDieselFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(20), - "gt.recipe.dieselgeneratorfuel", - "Combustion Generator Fuels", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(20), + "gt.recipe.dieselgeneratorfuel", + "Combustion Generator Fuels", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sExtremeDieselFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(20), - "gt.recipe.extremedieselgeneratorfuel", - "Extreme Diesel Engine Fuel", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(20), + "gt.recipe.extremedieselgeneratorfuel", + "Extreme Diesel Engine Fuel", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sTurbineFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(25), - "gt.recipe.gasturbinefuel", - "Gas Turbine Fuel", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(25), + "gt.recipe.gasturbinefuel", + "Gas Turbine Fuel", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sHotFuels = new GT_Recipe_Map_Fuel( - new HashSet<>(10), - "gt.recipe.thermalgeneratorfuel", - "Thermal Generator Fuels", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - false); + new HashSet<>(10), + "gt.recipe.thermalgeneratorfuel", + "Thermal Generator Fuels", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + false); public static final GT_Recipe_Map_Fuel sDenseLiquidFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(15), - "gt.recipe.semifluidboilerfuels", - "Semifluid Boiler Fuels", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(15), + "gt.recipe.semifluidboilerfuels", + "Semifluid Boiler Fuels", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sPlasmaFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(100), - "gt.recipe.plasmageneratorfuels", - "Plasma Generator Fuels", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(100), + "gt.recipe.plasmageneratorfuels", + "Plasma Generator Fuels", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sMagicFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(100), - "gt.recipe.magicfuels", - "Magic Energy Absorber Fuels", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(100), + "gt.recipe.magicfuels", + "Magic Energy Absorber Fuels", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sSmallNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(1), - "gt.recipe.smallnaquadahreactor", - "Naquadah Reactor MkI", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(1), + "gt.recipe.smallnaquadahreactor", + "Naquadah Reactor MkI", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sLargeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(1), - "gt.recipe.largenaquadahreactor", - "Naquadah Reactor MkII", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(1), + "gt.recipe.largenaquadahreactor", + "Naquadah Reactor MkII", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sHugeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(1), - "gt.recipe.fluidnaquadahreactor", - "Naquadah Reactor MkIII", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(1), + "gt.recipe.fluidnaquadahreactor", + "Naquadah Reactor MkIII", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sExtremeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(1), - "gt.recipe.hugenaquadahreactor", - "Naquadah Reactor MkIV", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(1), + "gt.recipe.hugenaquadahreactor", + "Naquadah Reactor MkIV", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sUltraHugeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(1), - "gt.recipe.extrahugenaquadahreactor", - "Naquadah Reactor MkV", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(1), + "gt.recipe.extrahugenaquadahreactor", + "Naquadah Reactor MkV", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sFluidNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(1), - "gt.recipe.fluidfuelnaquadahreactor", - "Fluid Naquadah Reactor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(1), + "gt.recipe.fluidfuelnaquadahreactor", + "Fluid Naquadah Reactor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sMultiblockElectrolyzerRecipes = new GT_Recipe_Map( - new HashSet<>(300), - "gt.recipe.largeelectrolyzer", - "Large(PA) Electrolyzer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), - 1, - 9, - 0, - 0, - 1, - "", - 0, - "", - true, - false).setRecipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblockNoCircuit); + new HashSet<>(300), + "gt.recipe.largeelectrolyzer", + "Large(PA) Electrolyzer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), + 1, + 9, + 0, + 0, + 1, + "", + 0, + "", + true, + false).setRecipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblockNoCircuit); public static final GT_Recipe_Map sMultiblockCentrifugeRecipes = new GT_Recipe_Map( - new HashSet<>(1200), - "gt.recipe.largecentrifuge", - "Large(PA) Centrifuge", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), - 1, - 9, - 0, - 0, - 1, - "", - 0, - "", - true, - false).setRecipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblock) - .setDisableOptimize(true); + new HashSet<>(1200), + "gt.recipe.largecentrifuge", + "Large(PA) Centrifuge", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), + 1, + 9, + 0, + 0, + 1, + "", + 0, + "", + true, + false).setRecipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblock) + .setDisableOptimize(true); public static final GT_Recipe_Map sMultiblockMixerRecipes = new GT_Recipe_Map( - new HashSet<>(900), - "gt.recipe.largemixer", - "Large(PA) Mixer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), - 9, - 3, - 0, - 0, - 1, - "", - 0, - "", - true, - false).setRecipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblock) - .setDisableOptimize(true); - public static final GT_Recipe_Map_LargeBoilerFakeFuels sLargeBoilerFakeFuels = (GT_Recipe_Map_LargeBoilerFakeFuels) new GT_Recipe_Map_LargeBoilerFakeFuels().setProgressBar( - GT_UITextures.PROGRESSBAR_ARROW, - ProgressBar.Direction.RIGHT) - .setDisableOptimize( - true); + new HashSet<>(900), + "gt.recipe.largemixer", + "Large(PA) Mixer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), + 9, + 3, + 0, + 0, + 1, + "", + 0, + "", + true, + false).setRecipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblock) + .setDisableOptimize(true); + public static final GT_Recipe_Map_LargeBoilerFakeFuels sLargeBoilerFakeFuels = (GT_Recipe_Map_LargeBoilerFakeFuels) new GT_Recipe_Map_LargeBoilerFakeFuels() + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setDisableOptimize(true); public static final GT_Recipe_Map sNanoForge = new GT_Recipe_Map( - new HashSet<>(10), - "gt.recipe.nanoforge", - "Nano Forge", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), - 6, - 2, - 2, - 1, - 1, - "Tier: ", - 1, - "", - false, - true).useModularUI(true) - .setUsualFluidInputCount(3) - .setDisableOptimize(true) - .setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_LENS) - .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT); + new HashSet<>(10), + "gt.recipe.nanoforge", + "Nano Forge", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), + 6, + 2, + 2, + 1, + 1, + "Tier: ", + 1, + "", + false, + true).useModularUI(true) + .setUsualFluidInputCount(3) + .setDisableOptimize(true) + .setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_LENS) + .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sPCBFactory = new GT_Recipe_Map( - new HashSet<>(10), - "gt.recipe.pcbfactory", - "PCB Factory", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), - 6, - 9, - 3, - 1, - 1, - E, - 0, - E, - true, - true).useModularUI(true) - .setUsualFluidInputCount(3) - .setUsualFluidOutputCount(0) - .setDisableOptimize(true) - .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT) - .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { - List<String> result = new ArrayList<>(); - int bitmap = recipeInfo.recipe.mSpecialValue; - if ((bitmap & 0b1) > 0) { - result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 1); - } else if ((bitmap & 0b10) > 0) { - result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 2); - } else if ((bitmap & 0b100) > 0) { - result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 3); - } - if ((bitmap & 0b1000) > 0) { - result.add(GT_Utility.trans("337", "Upgrade Required: ") + GT_Utility.trans("338", "Bio")); - } - return result; - }); - - public static final GT_Recipe_Map_IC2NuclearFake sIC2NuclearFakeRecipe = (GT_Recipe_Map_IC2NuclearFake) new GT_Recipe_Map_IC2NuclearFake().setDisableOptimize( - true); + new HashSet<>(10), + "gt.recipe.pcbfactory", + "PCB Factory", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), + 6, + 9, + 3, + 1, + 1, + E, + 0, + E, + true, + true).useModularUI(true) + .setUsualFluidInputCount(3) + .setUsualFluidOutputCount(0) + .setDisableOptimize(true) + .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT) + .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { + List<String> result = new ArrayList<>(); + int bitmap = recipeInfo.recipe.mSpecialValue; + if ((bitmap & 0b1) > 0) { + result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 1); + } else if ((bitmap & 0b10) > 0) { + result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 2); + } else if ((bitmap & 0b100) > 0) { + result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 3); + } + if ((bitmap & 0b1000) > 0) { + result.add(GT_Utility.trans("337", "Upgrade Required: ") + GT_Utility.trans("338", "Bio")); + } + return result; + }); + + public static final GT_Recipe_Map_IC2NuclearFake sIC2NuclearFakeRecipe = (GT_Recipe_Map_IC2NuclearFake) new GT_Recipe_Map_IC2NuclearFake() + .setDisableOptimize(true); static { sCentrifugeRecipes.addDownstream(sMultiblockCentrifugeRecipes.deepCopyInput()); sMixerRecipes.addDownstream(sMultiblockMixerRecipes.deepCopyInput()); sElectrolyzerRecipes.addDownstream(sMultiblockElectrolyzerRecipes.deepCopyInput()); sDieselFuels.addDownstream( - IGT_RecipeMap.newRecipeMap( - b -> b.build() - .map(sLargeBoilerFakeFuels::addDieselRecipe) - .map(Collections::singletonList) - .orElse(Collections.emptyList()))); + IGT_RecipeMap.newRecipeMap( + b -> b.build() + .map(sLargeBoilerFakeFuels::addDieselRecipe) + .map(Collections::singletonList) + .orElse(Collections.emptyList()))); sDenseLiquidFuels.addDownstream( - IGT_RecipeMap.newRecipeMap( - b -> b.build() - .map(sLargeBoilerFakeFuels::addDenseLiquidRecipe) - .map(Collections::singletonList) - .orElse(Collections.emptyList()))); + IGT_RecipeMap.newRecipeMap( + b -> b.build() + .map(sLargeBoilerFakeFuels::addDenseLiquidRecipe) + .map(Collections::singletonList) + .orElse(Collections.emptyList()))); } /** @@ -3070,7 +3040,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public final String mNEISpecialValuePre, mNEISpecialValuePost; public final int mUsualInputCount, mUsualOutputCount, mNEISpecialValueMultiplier, mMinimalInputItems, - mMinimalInputFluids, mAmperage; + mMinimalInputFluids, mAmperage; public final boolean mNEIAllowed, mShowVoltageAmperageInNEI; /** @@ -3144,10 +3114,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public Pos2d progressBarPos = new Pos2d(78, 24); public Rectangle neiTransferRect = new Rectangle( - progressBarPos.x - (16 / 2), - progressBarPos.y, - progressBarSize.width + 16, - progressBarSize.height); + progressBarPos.x - (16 / 2), + progressBarPos.y, + progressBarSize.width + 16, + progressBarSize.height); /** * Image size in direction of progress. Used for non-smooth rendering. @@ -3214,10 +3184,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * @param aNEIAllowed if NEI is allowed to display this Recipe Handler in general. */ public GT_Recipe_Map(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { sMappings.add(this); mNEIAllowed = aNEIAllowed; mShowVoltageAmperageInNEI = aShowVoltageAmperageInNEI; @@ -3236,16 +3205,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> { GregTech_API.sItemStackMappings.add(mRecipeItemMap); GT_LanguageManager.addStringLocalization(mUnlocalizedName = aUnlocalizedName, aLocalName); mUniqueIdentifier = String.format( - "%s_%d_%d_%d_%d_%d", - aUnlocalizedName, - aAmperage, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputFluids, - aMinimalInputItems); + "%s_%d_%d_%d_%d_%d", + aUnlocalizedName, + aAmperage, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputFluids, + aMinimalInputItems); progressBarTexture = new FallbackableUITexture( - UITexture.fullImage(GregTech.ID, "gui/progressbar/" + mUnlocalizedName), - GT_UITextures.PROGRESSBAR_ARROW); + UITexture.fullImage(GregTech.ID, "gui/progressbar/" + mUnlocalizedName), + GT_UITextures.PROGRESSBAR_ARROW); colorOverride = GT_GUIColorOverride.get(ModularUITextures.VANILLA_BACKGROUND.location); if (sIndexedMappings.put(mUniqueIdentifier, this) != null) throw new IllegalArgumentException("Duplicate recipe map registered: " + mUniqueIdentifier); @@ -3253,26 +3222,26 @@ public class GT_Recipe implements Comparable<GT_Recipe> { @Deprecated public GT_Recipe_Map(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed, boolean aNEIUnificateOutput) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed, + boolean aNEIUnificateOutput) { this( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); setNEIUnificateOutput(aNEIUnificateOutput); } @@ -3302,11 +3271,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } public GT_Recipe_Map setSlotOverlay(boolean isFluid, boolean isOutput, boolean isFirst, boolean isSpecial, - IDrawable slotOverlay) { + IDrawable slotOverlay) { useModularUI(true); this.slotOverlays.put( - (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) + (isFirst ? 4 : 0) + (isSpecial ? 8 : 0)), - slotOverlay); + (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) + (isFirst ? 4 : 0) + (isSpecial ? 8 : 0)), + slotOverlay); return this; } @@ -3315,19 +3284,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } public GT_Recipe_Map setSlotOverlay(boolean isFluid, boolean isOutput, IDrawable slotOverlay) { - return setSlotOverlay(isFluid, isOutput, true, slotOverlay).setSlotOverlay( - isFluid, - isOutput, - false, - slotOverlay); + return setSlotOverlay(isFluid, isOutput, true, slotOverlay) + .setSlotOverlay(isFluid, isOutput, false, slotOverlay); } public GT_Recipe_Map setSlotOverlaySteam(boolean isFluid, boolean isOutput, boolean isFirst, boolean isSpecial, - SteamTexture slotOverlay) { + SteamTexture slotOverlay) { useModularUI(true); this.slotOverlaysSteam.put( - (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) + (isFirst ? 4 : 0) + (isSpecial ? 8 : 0)), - slotOverlay); + (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) + (isFirst ? 4 : 0) + (isSpecial ? 8 : 0)), + slotOverlay); return this; } @@ -3336,20 +3302,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } public GT_Recipe_Map setSlotOverlaySteam(boolean isOutput, SteamTexture slotOverlay) { - return setSlotOverlaySteam(false, isOutput, true, false, slotOverlay).setSlotOverlaySteam( - false, - isOutput, - false, - false, - slotOverlay); + return setSlotOverlaySteam(false, isOutput, true, false, slotOverlay) + .setSlotOverlaySteam(false, isOutput, false, false, slotOverlay); } public GT_Recipe_Map setProgressBar(UITexture progressBarTexture, ProgressBar.Direction progressBarDirection) { return setProgressBarWithFallback( - new FallbackableUITexture( - UITexture.fullImage(GregTech.ID, "gui/progressbar/" + mUnlocalizedName), - progressBarTexture), - progressBarDirection); + new FallbackableUITexture( + UITexture.fullImage(GregTech.ID, "gui/progressbar/" + mUnlocalizedName), + progressBarTexture), + progressBarDirection); } public GT_Recipe_Map setProgressBar(UITexture progressBarTexture) { @@ -3361,7 +3323,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * add unique textures, yet other packs don't need to make textures for every recipemap. */ public GT_Recipe_Map setProgressBarWithFallback(FallbackableUITexture progressBarTexture, - ProgressBar.Direction progressBarDirection) { + ProgressBar.Direction progressBarDirection) { useModularUI(true); this.progressBarTexture = progressBarTexture; this.progressBarDirection = progressBarDirection; @@ -3370,9 +3332,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public GT_Recipe_Map setProgressBarSteam(SteamTexture progressBarTexture) { return setProgressBarSteamWithFallback( - new FallbackableSteamTexture( - SteamTexture.fullImage(GregTech.ID, "gui/progressbar/" + mUnlocalizedName + "_%s"), - progressBarTexture)); + new FallbackableSteamTexture( + SteamTexture.fullImage(GregTech.ID, "gui/progressbar/" + mUnlocalizedName + "_%s"), + progressBarTexture)); } public GT_Recipe_Map setProgressBarSteamWithFallback(FallbackableSteamTexture progressBarTexture) { @@ -3406,15 +3368,15 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public GT_Recipe_Map addSpecialTexture(int width, int height, int x, int y, IDrawable texture) { useModularUI(true); - specialTextures.add( - new ImmutablePair<>(texture, new ImmutablePair<>(new Size(width, height), new Pos2d(x, y)))); + specialTextures + .add(new ImmutablePair<>(texture, new ImmutablePair<>(new Size(width, height), new Pos2d(x, y)))); return this; } public GT_Recipe_Map addSpecialTextureSteam(int width, int height, int x, int y, SteamTexture texture) { useModularUI(true); - specialTexturesSteam.add( - new ImmutablePair<>(texture, new ImmutablePair<>(new Size(width, height), new Pos2d(x, y)))); + specialTexturesSteam + .add(new ImmutablePair<>(texture, new ImmutablePair<>(new Size(width, height), new Pos2d(x, y)))); return this; } @@ -3469,7 +3431,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * Change how recipes are emitted by a particular recipe builder. Can emit multiple recipe per builder. */ public GT_Recipe_Map setRecipeEmitter( - Function<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> func) { + Function<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> func) { this.recipeEmitter = func; return this; } @@ -3480,7 +3442,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * Unlike {@link #setRecipeEmitter(Function)}, this one does not clear the existing recipe being emitted, if any */ public GT_Recipe_Map combineRecipeEmitter( - Function<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> func) { + Function<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> func) { // move recipeEmitter to local variable, so lambda capture the function itself instead of this Function<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> cur = recipeEmitter; this.recipeEmitter = b -> Iterables.concat(cur.apply(b), func.apply(b)); @@ -3572,55 +3534,55 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, - int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { + int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue) { return addRecipe( - new GT_Recipe( - aOptimize, - aInputs, - aOutputs, - aSpecial, - aOutputChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)); + new GT_Recipe( + aOptimize, + aInputs, + aOutputs, + aSpecial, + aOutputChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)); } public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, - int aDuration, int aEUt, int aSpecialValue) { + int aDuration, int aEUt, int aSpecialValue) { return addRecipe( - new GT_Recipe( - false, - null, - null, - null, - aOutputChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue), + new GT_Recipe( false, - false, - false); + null, + null, + null, + aOutputChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue), + false, + false, + false); } public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { return addRecipe( - new GT_Recipe( - aOptimize, - aInputs, - aOutputs, - aSpecial, - null, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)); + new GT_Recipe( + aOptimize, + aInputs, + aOutputs, + aSpecial, + null, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)); } public GT_Recipe addRecipe(GT_Recipe aRecipe) { @@ -3628,13 +3590,13 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, - boolean aHidden) { + boolean aHidden) { aRecipe.mHidden = aHidden; aRecipe.mFakeRecipe = aFakeRecipe; if (aRecipe.mFluidInputs.length < mMinimalInputFluids && aRecipe.mInputs.length < mMinimalInputItems) return null; if (aCheckForCollisions - && findRecipe(null, false, true, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null) + && findRecipe(null, false, true, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null) return null; return add(aRecipe); } @@ -3644,21 +3606,21 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * findRecipe wont find fake Recipes, containsInput WILL find fake Recipes */ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, - int aDuration, int aEUt, int aSpecialValue) { + Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, + int aEUt, int aSpecialValue) { return addFakeRecipe( - aCheckForCollisions, - new GT_Recipe( - false, - aInputs, - aOutputs, - aSpecial, - aOutputChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)); + aCheckForCollisions, + new GT_Recipe( + false, + aInputs, + aOutputs, + aSpecial, + aOutputChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)); } /** @@ -3666,60 +3628,60 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * findRecipe wont find fake Recipes, containsInput WILL find fake Recipes */ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { + Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue) { return addFakeRecipe( - aCheckForCollisions, - new GT_Recipe( - false, - aInputs, - aOutputs, - aSpecial, - null, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)); + aCheckForCollisions, + new GT_Recipe( + false, + aInputs, + aOutputs, + aSpecial, + null, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)); } public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue, boolean hidden) { + Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue, boolean hidden) { return addFakeRecipe( - aCheckForCollisions, - new GT_Recipe( - false, - aInputs, - aOutputs, - aSpecial, - null, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue), - hidden); + aCheckForCollisions, + new GT_Recipe( + false, + aInputs, + aOutputs, + aSpecial, + null, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue), + hidden); } public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue, ItemStack[][] aAlt, boolean hidden) { + Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue, ItemStack[][] aAlt, boolean hidden) { return addFakeRecipe( - aCheckForCollisions, - new GT_Recipe_WithAlt( - false, - aInputs, - aOutputs, - aSpecial, - null, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue, - aAlt), - hidden); + aCheckForCollisions, + new GT_Recipe_WithAlt( + false, + aInputs, + aOutputs, + aSpecial, + null, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue, + aAlt), + hidden); } /** @@ -3741,10 +3703,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> { for (GT_Recipe r : recipes) { if (recipeConfigCategory != null) { String configKey = recipeConfigKeyConvertor.apply(r); - if (configKey != null && (r.mDuration = GregTech_API.sRecipeFile.get( - recipeConfigCategory, - configKey, - r.mDuration)) <= 0) { + if (configKey != null + && (r.mDuration = GregTech_API.sRecipeFile.get(recipeConfigCategory, configKey, r.mDuration)) + <= 0) { continue; } } @@ -3766,8 +3727,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (specialHandler != null) r = specialHandler.apply(r); if (r == null) continue; if (checkForCollision - && findRecipe(null, false, true, Long.MAX_VALUE, r.mFluidInputs, r.mInputs) != null) - continue; + && findRecipe(null, false, true, Long.MAX_VALUE, r.mFluidInputs, r.mInputs) != null) continue; ret.add(add(r)); } if (!ret.isEmpty()) { @@ -3796,13 +3756,12 @@ public class GT_Recipe implements Comparable<GT_Recipe> { mRecipeList.add(aRecipe); for (FluidStack aFluid : aRecipe.mFluidInputs) { if (aFluid != null) { - Collection<GT_Recipe> tList = mRecipeFluidMap.computeIfAbsent( - aFluid.getFluid(), - k -> new HashSet<>(1)); + Collection<GT_Recipe> tList = mRecipeFluidMap + .computeIfAbsent(aFluid.getFluid(), k -> new HashSet<>(1)); tList.add(aRecipe); mRecipeFluidNameMap.add( - aFluid.getFluid() - .getName()); + aFluid.getFluid() + .getName()); } } if (aRecipe.mFluidOutputs.length != 0) { @@ -3828,7 +3787,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { */ public boolean containsInput(ItemStack aStack) { return aStack != null && (mRecipeItemMap.containsKey(new GT_ItemStack(aStack)) - || mRecipeItemMap.containsKey(new GT_ItemStack(aStack, true))); + || mRecipeItemMap.containsKey(new GT_ItemStack(aStack, true))); } /** @@ -3846,43 +3805,43 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, - FluidStack[] aFluids, ItemStack... aInputs) { + FluidStack[] aFluids, ItemStack... aInputs) { return findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs); } public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, - boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { + boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { return findRecipe( - aTileEntity, - null, - aNotUnificated, - aDontCheckStackSizes, - aVoltage, - aFluids, - null, - aInputs); + aTileEntity, + null, + aNotUnificated, + aDontCheckStackSizes, + aVoltage, + aFluids, + null, + aInputs); } public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { return findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs); } public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { + boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { return findRecipe( - aTileEntity, - aRecipe, - aNotUnificated, - aDontCheckStackSizes, - aVoltage, - aFluids, - null, - aInputs); + aTileEntity, + aRecipe, + aNotUnificated, + aDontCheckStackSizes, + aVoltage, + aFluids, + null, + aInputs); } public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { return findRecipe(aTileEntity, aRecipe, aNotUnificated, false, aVoltage, aFluids, aSpecialSlot, aInputs); } @@ -3904,8 +3863,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * @return the Recipe it has found or null for no matching Recipe */ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, - ItemStack... aInputs) { + boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, + ItemStack... aInputs) { // No Recipes? Well, nothing to be found then. if (mRecipeList.isEmpty()) return null; @@ -3933,18 +3892,18 @@ public class GT_Recipe implements Comparable<GT_Recipe> { // Check the Recipe which has been used last time in order to not have to search for it again, if possible. if (aRecipe != null) if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered - && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) + && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs) if (tStack != null) { Collection<GT_Recipe> tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack, true)); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; } @@ -3953,7 +3912,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids) if (aFluid != null) { Collection<GT_Recipe> tRecipes = mRecipeFluidMap.get(aFluid.getFluid()); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; } @@ -4002,8 +3961,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { @Nullable public IDrawable getOverlayForSlot(boolean isFluid, boolean isOutput, int index, boolean isSpecial) { byte overlayKey = (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) - + (index == 0 ? 4 : 0) - + (isSpecial ? 8 : 0)); + + (index == 0 ? 4 : 0) + + (isSpecial ? 8 : 0)); if (slotOverlays.containsKey(overlayKey)) { return slotOverlays.get(overlayKey); } @@ -4013,8 +3972,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { @Nullable public SteamTexture getOverlayForSlotSteam(boolean isFluid, boolean isOutput, int index, boolean isSpecial) { byte overlayKey = (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) - + (index == 0 ? 4 : 0) - + (isSpecial ? 8 : 0)); + + (index == 0 ? 4 : 0) + + (isSpecial ? 8 : 0)); if (slotOverlaysSteam.containsKey(overlayKey)) { return slotOverlaysSteam.get(overlayKey); } @@ -4057,92 +4016,92 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * Adds slot backgrounds, progressBar, etc. */ public ModularWindow.Builder createNEITemplate(IItemHandlerModifiable itemInputsInventory, - IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory, - IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory, - Supplier<Float> progressSupplier, Pos2d windowOffset) { + IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory, + IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory, + Supplier<Float> progressSupplier, Pos2d windowOffset) { ModularWindow.Builder builder = ModularWindow.builder(neiBackgroundSize) - .setBackground(ModularUITextures.VANILLA_BACKGROUND); + .setBackground(ModularUITextures.VANILLA_BACKGROUND); UIHelper.forEachSlots( - (i, backgrounds, pos) -> builder.widget( - SlotWidget.phantom(itemInputsInventory, i) - .setBackground(backgrounds) - .setPos(pos) - .setSize(18, 18)), - (i, backgrounds, pos) -> builder.widget( - SlotWidget.phantom(itemOutputsInventory, i) - .setBackground(backgrounds) - .setPos(pos) - .setSize(18, 18)), - (i, backgrounds, pos) -> { - if (usesSpecialSlot()) builder.widget( - SlotWidget.phantom(specialSlotInventory, 0) - .setBackground(backgrounds) - .setPos(pos) - .setSize(18, 18)); - }, - (i, backgrounds, pos) -> builder.widget( - SlotWidget.phantom(fluidInputsInventory, i) - .setBackground(backgrounds) - .setPos(pos) - .setSize(18, 18)), - (i, backgrounds, pos) -> builder.widget( - SlotWidget.phantom(fluidOutputsInventory, i) - .setBackground(backgrounds) - .setPos(pos) - .setSize(18, 18)), - ModularUITextures.ITEM_SLOT, - ModularUITextures.FLUID_SLOT, - this, - mUsualInputCount, - mUsualOutputCount, - getUsualFluidInputCount(), - getUsualFluidOutputCount(), - SteamVariant.NONE, - windowOffset); + (i, backgrounds, pos) -> builder.widget( + SlotWidget.phantom(itemInputsInventory, i) + .setBackground(backgrounds) + .setPos(pos) + .setSize(18, 18)), + (i, backgrounds, pos) -> builder.widget( + SlotWidget.phantom(itemOutputsInventory, i) + .setBackground(backgrounds) + .setPos(pos) + .setSize(18, 18)), + (i, backgrounds, pos) -> { + if (usesSpecialSlot()) builder.widget( + SlotWidget.phantom(specialSlotInventory, 0) + .setBackground(backgrounds) + .setPos(pos) + .setSize(18, 18)); + }, + (i, backgrounds, pos) -> builder.widget( + SlotWidget.phantom(fluidInputsInventory, i) + .setBackground(backgrounds) + .setPos(pos) + .setSize(18, 18)), + (i, backgrounds, pos) -> builder.widget( + SlotWidget.phantom(fluidOutputsInventory, i) + .setBackground(backgrounds) + .setPos(pos) + .setSize(18, 18)), + ModularUITextures.ITEM_SLOT, + ModularUITextures.FLUID_SLOT, + this, + mUsualInputCount, + mUsualOutputCount, + getUsualFluidInputCount(), + getUsualFluidOutputCount(), + SteamVariant.NONE, + windowOffset); addProgressBarUI(builder, progressSupplier, windowOffset); addGregTechLogoUI(builder, windowOffset); for (Pair<IDrawable, Pair<Size, Pos2d>> specialTexture : specialTextures) { builder.widget( - new DrawableWidget().setDrawable(specialTexture.getLeft()) - .setSize( - specialTexture.getRight() - .getLeft()) - .setPos( - specialTexture.getRight() - .getRight() - .add(windowOffset))); + new DrawableWidget().setDrawable(specialTexture.getLeft()) + .setSize( + specialTexture.getRight() + .getLeft()) + .setPos( + specialTexture.getRight() + .getRight() + .add(windowOffset))); } return builder; } public void addProgressBarUI(ModularWindow.Builder builder, Supplier<Float> progressSupplier, - Pos2d windowOffset) { + Pos2d windowOffset) { builder.widget( - new ProgressBar().setTexture(getProgressBarTexture(), 20) - .setDirection(progressBarDirection) - .setProgress(progressSupplier) - .setSynced(false, false) - .setPos(progressBarPos.add(windowOffset)) - .setSize(progressBarSize)); + new ProgressBar().setTexture(getProgressBarTexture(), 20) + .setDirection(progressBarDirection) + .setProgress(progressSupplier) + .setSynced(false, false) + .setPos(progressBarPos.add(windowOffset)) + .setSize(progressBarSize)); } public void addGregTechLogoUI(ModularWindow.Builder builder, Pos2d windowOffset) { builder.widget( - new DrawableWidget().setDrawable(logo) - .setSize(logoSize) - .setPos(logoPos.add(windowOffset))); + new DrawableWidget().setDrawable(logo) + .setSize(logoSize) + .setPos(logoPos.add(windowOffset))); } public void addRecipeSpecificDrawable(ModularWindow.Builder builder, Pos2d windowOffset, - Supplier<IDrawable> supplier, Pos2d pos, Size size) { + Supplier<IDrawable> supplier, Pos2d pos, Size size) { builder.widget( - new DrawableWidget().setDrawable(supplier) - .setSize(size) - .setPos(pos.add(windowOffset))); + new DrawableWidget().setDrawable(supplier) + .setSize(size) + .setPos(pos.add(windowOffset))); } /** @@ -4202,8 +4161,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (!(originalPower instanceof UnspecifiedEUPower)) { originalPower.computePowerUsageAndDuration(recipe.mEUt, recipe.mDuration); drawNEIText( - recipeInfo, - GT_Utility.trans("275", "Original voltage: ") + originalPower.getVoltageString()); + recipeInfo, + GT_Utility.trans("275", "Original voltage: ") + originalPower.getVoltageString()); } } if (amperage != null && !amperage.equals("unspecified") && !amperage.equals("1")) { @@ -4243,8 +4202,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } } else if (neiSpecialInfoFormatter != null) { drawNEITextMultipleLines( - recipeInfo, - neiSpecialInfoFormatter.format(recipeInfo, this::formatSpecialValue)); + recipeInfo, + neiSpecialInfoFormatter.format(recipeInfo, this::formatSpecialValue)); } else { drawOptionalNEIText(recipeInfo, getNEISpecialInfo(recipeInfo.recipe.mSpecialValue)); } @@ -4273,7 +4232,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { protected String formatSpecialValue(int specialValue) { return mNEISpecialValuePre + formatNumbers((long) specialValue * mNEISpecialValueMultiplier) - + mNEISpecialValuePost; + + mNEISpecialValuePost; } protected void drawNEIRecipeOwnerInfo(NEIRecipeInfo recipeInfo) { @@ -4281,27 +4240,27 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (GT_Mod.gregtechproxy.mNEIRecipeOwner) { if (recipe.owners.size() > 1) { drawNEIText( - recipeInfo, - EnumChatFormatting.ITALIC + GT_Utility.trans("273", "Original Recipe by: ") - + recipe.owners.get(0) - .getName()); + recipeInfo, + EnumChatFormatting.ITALIC + GT_Utility.trans("273", "Original Recipe by: ") + + recipe.owners.get(0) + .getName()); for (int i = 1; i < recipe.owners.size(); i++) { drawNEIText( - recipeInfo, - EnumChatFormatting.ITALIC + GT_Utility.trans("274", "Modified by: ") - + recipe.owners.get(i) - .getName()); + recipeInfo, + EnumChatFormatting.ITALIC + GT_Utility.trans("274", "Modified by: ") + + recipe.owners.get(i) + .getName()); } } else if (recipe.owners.size() > 0) { drawNEIText( - recipeInfo, - EnumChatFormatting.ITALIC + GT_Utility.trans("272", "Recipe by: ") - + recipe.owners.get(0) - .getName()); + recipeInfo, + EnumChatFormatting.ITALIC + GT_Utility.trans("272", "Recipe by: ") + + recipe.owners.get(0) + .getName()); } } if (GT_Mod.gregtechproxy.mNEIRecipeOwnerStackTrace && recipe.stackTraces != null - && !recipe.stackTraces.isEmpty()) { + && !recipe.stackTraces.isEmpty()) { drawNEIText(recipeInfo, "stackTrace:"); // todo: good way to show all stacktraces for (StackTraceElement stackTrace : recipe.stackTraces.get(0)) { @@ -4333,10 +4292,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> { @SuppressWarnings("SameParameterValue") protected void drawNEIText(NEIRecipeInfo recipeInfo, String text, int xStart, int yShift) { Minecraft.getMinecraft().fontRenderer.drawString( - text, - xStart, - recipeInfo.yPos, - neiTextColorOverride != -1 ? neiTextColorOverride : 0x000000); + text, + xStart, + recipeInfo.yPos, + neiTextColorOverride != -1 ? neiTextColorOverride : 0x000000); recipeInfo.yPos += yShift; } @@ -4353,13 +4312,13 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } public List<String> handleNEIItemTooltip(ItemStack stack, List<String> currentTip, - GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { for (PositionedStack pStack : neiCachedRecipe.mInputs) { if (stack == pStack.item) { if (pStack instanceof GT_NEI_DefaultHandler.FixedPositionedStack) { currentTip = handleNEIItemInputTooltip( - currentTip, - (GT_NEI_DefaultHandler.FixedPositionedStack) pStack); + currentTip, + (GT_NEI_DefaultHandler.FixedPositionedStack) pStack); } break; } @@ -4368,8 +4327,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (stack == pStack.item) { if (pStack instanceof GT_NEI_DefaultHandler.FixedPositionedStack) { currentTip = handleNEIItemOutputTooltip( - currentTip, - (GT_NEI_DefaultHandler.FixedPositionedStack) pStack); + currentTip, + (GT_NEI_DefaultHandler.FixedPositionedStack) pStack); } break; } @@ -4378,7 +4337,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } protected List<String> handleNEIItemInputTooltip(List<String> currentTip, - GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + GT_NEI_DefaultHandler.FixedPositionedStack pStack) { if (pStack.isNotConsumed()) { currentTip.add(GRAY + GT_Utility.trans("151", "Does not get consumed in the process")); } @@ -4386,7 +4345,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } protected List<String> handleNEIItemOutputTooltip(List<String> currentTip, - GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + GT_NEI_DefaultHandler.FixedPositionedStack pStack) { if (pStack.isChanceBased()) { currentTip.add(GRAY + GT_Utility.trans("150", "Chance: ") + pStack.getChanceText()); } @@ -4420,13 +4379,13 @@ public class GT_Recipe implements Comparable<GT_Recipe> { @SuppressWarnings("SameParameterValue") protected void drawNEIOverlayText(String text, PositionedStack stack, int color, float scale, boolean shadow, - Alignment alignment) { + Alignment alignment) { FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; int width = fontRenderer.getStringWidth(text); int x = (int) ((stack.relx + 8 + 8 * alignment.x) / scale) - (width / 2 * (alignment.x + 1)); int y = (int) ((stack.rely + 8 + 8 * alignment.y) / scale) - - (fontRenderer.FONT_HEIGHT / 2 * (alignment.y + 1)) - - (alignment.y - 1) / 2; + - (fontRenderer.FONT_HEIGHT / 2 * (alignment.y + 1)) + - (alignment.y - 1) / 2; GlStateManager.pushMatrix(); GlStateManager.scale(scale, scale, 1); @@ -4436,12 +4395,12 @@ public class GT_Recipe implements Comparable<GT_Recipe> { protected void drawNEIOverlayText(String text, PositionedStack stack) { drawNEIOverlayText( - text, - stack, - colorOverride.getTextColorOrDefault("nei_overlay_yellow", 0xFDD835), - 0.5f, - false, - Alignment.TopLeft); + text, + stack, + colorOverride.getTextColorOrDefault("nei_overlay_yellow", 0xFDD835), + 0.5f, + false, + Alignment.TopLeft); } public void updateNEITextColorOverride() { @@ -4494,26 +4453,25 @@ public class GT_Recipe implements Comparable<GT_Recipe> { private static final int yOrigin = 8; public GT_Recipe_Map_LargeNEI(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); useModularUI(true); setLogoPos(80, 62); } @@ -4540,19 +4498,19 @@ public class GT_Recipe implements Comparable<GT_Recipe> { @Override public ModularWindow.Builder createNEITemplate(IItemHandlerModifiable itemInputsInventory, - IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory, - IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory, - Supplier<Float> progressSupplier, Pos2d windowOffset) { + IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory, + IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory, + Supplier<Float> progressSupplier, Pos2d windowOffset) { // Delay setter so that calls to #setUsualFluidInputCount and #setUsualFluidOutputCount are considered setNEIBackgroundSize(172, 82 + (Math.max(getItemRowCount() + getFluidRowCount() - 4, 0)) * 18); return super.createNEITemplate( - itemInputsInventory, - itemOutputsInventory, - specialSlotInventory, - fluidInputsInventory, - fluidOutputsInventory, - progressSupplier, - windowOffset); + itemInputsInventory, + itemOutputsInventory, + specialSlotInventory, + fluidInputsInventory, + fluidOutputsInventory, + progressSupplier, + windowOffset); } private int getItemRowCount() { @@ -4570,26 +4528,25 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_FluidOnly extends GT_Recipe_Map { public GT_Recipe_Map_FluidOnly(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); useModularUI(true); } @@ -4610,26 +4567,25 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public abstract static class GT_Recipe_Map_NonGTRecipes extends GT_Recipe_Map { public GT_Recipe_Map_NonGTRecipes(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override @@ -4649,14 +4605,14 @@ public class GT_Recipe implements Comparable<GT_Recipe> { @Override public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, - int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { + int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue) { return null; } @Override public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { return null; } @@ -4667,22 +4623,22 @@ public class GT_Recipe implements Comparable<GT_Recipe> { @Override public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, - int aDuration, int aEUt, int aSpecialValue) { + Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, + int aEUt, int aSpecialValue) { return null; } @Override public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { + Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue) { return null; } @Override public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue, boolean hidden) { + Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue, boolean hidden) { return null; } @@ -4715,26 +4671,25 @@ public class GT_Recipe implements Comparable<GT_Recipe> { private final Map<String, GT_Recipe> mRecipesByFluidInput = new HashMap<>(); public GT_Recipe_Map_Fuel(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); setDisableOptimize(true); } @@ -4751,41 +4706,41 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, - int aFuelValueInEU) { + int aFuelValueInEU) { return addFuel(aInput, aOutput, aFluidInput, aFluidOutput, 10000, aFuelValueInEU); } public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, - int aChance, int aFuelValueInEU) { + int aChance, int aFuelValueInEU) { return addRecipe( - true, - new ItemStack[] { aInput }, - new ItemStack[] { aOutput }, - null, - new int[] { aChance }, - new FluidStack[] { aFluidInput }, - new FluidStack[] { aFluidOutput }, - 0, - 0, - aFuelValueInEU); + true, + new ItemStack[] { aInput }, + new ItemStack[] { aOutput }, + null, + new int[] { aChance }, + new FluidStack[] { aFluidInput }, + new FluidStack[] { aFluidOutput }, + 0, + 0, + aFuelValueInEU); } @Override public GT_Recipe add(GT_Recipe aRecipe) { aRecipe = super.add(aRecipe); if (aRecipe.mInputs != null && GT_Utility.getNonnullElementCount(aRecipe.mInputs) == 1 - && (aRecipe.mFluidInputs == null || GT_Utility.getNonnullElementCount(aRecipe.mFluidInputs) == 0)) { + && (aRecipe.mFluidInputs == null || GT_Utility.getNonnullElementCount(aRecipe.mFluidInputs) == 0)) { FluidStack tFluid = GT_Utility.getFluidForFilledItem(aRecipe.mInputs[0], true); if (tFluid != null) { tFluid.amount = 0; mRecipesByFluidInput.put(tFluid.getUnlocalizedName(), aRecipe); } } else if ((aRecipe.mInputs == null || GT_Utility.getNonnullElementCount(aRecipe.mInputs) == 0) - && aRecipe.mFluidInputs != null - && GT_Utility.getNonnullElementCount(aRecipe.mFluidInputs) == 1 - && aRecipe.mFluidInputs[0] != null) { - mRecipesByFluidInput.put(aRecipe.mFluidInputs[0].getUnlocalizedName(), aRecipe); - } + && aRecipe.mFluidInputs != null + && GT_Utility.getNonnullElementCount(aRecipe.mFluidInputs) == 1 + && aRecipe.mFluidInputs[0] != null) { + mRecipesByFluidInput.put(aRecipe.mFluidInputs[0].getUnlocalizedName(), aRecipe); + } return aRecipe; } @@ -4800,46 +4755,45 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_Furnace extends GT_Recipe_Map_NonGTRecipes { public GT_Recipe_Map_Furnace(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; ItemStack tOutput = GT_ModHandler.getSmeltingOutput(aInputs[0], false, null); return tOutput == null ? null - : new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - new ItemStack[] { tOutput }, - null, - null, - null, - null, - 128, - 4, - 0); + : new GT_Recipe( + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + new ItemStack[] { tOutput }, + null, + null, + null, + null, + 128, + 4, + 0); } @Override @@ -4854,64 +4808,61 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_Microwave extends GT_Recipe_Map_NonGTRecipes { public GT_Recipe_Map_Microwave(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; ItemStack tOutput = GT_ModHandler.getSmeltingOutput(aInputs[0], false, null); if (GT_Utility.areStacksEqual(aInputs[0], new ItemStack(Items.book, 1, W))) { return new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - new ItemStack[] { - GT_Utility.getWrittenBook("Manual_Microwave", ItemList.Book_Written_03.get(1)) }, - null, - null, - null, - null, - 32, - 4, - 0); + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + new ItemStack[] { GT_Utility.getWrittenBook("Manual_Microwave", ItemList.Book_Written_03.get(1)) }, + null, + null, + null, + null, + 32, + 4, + 0); } // Check Container Item of Input since it is around the Input, then the Input itself, then Container Item of // Output and last check the Output itself for (ItemStack tStack : new ItemStack[] { GT_Utility.getContainerItem(aInputs[0], true), aInputs[0], - GT_Utility.getContainerItem(tOutput, true), tOutput }) - if (tStack != null) { + GT_Utility.getContainerItem(tOutput, true), tOutput }) if (tStack != null) { if (GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.netherrack, 1, W), true) - || GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.tnt, 1, W), true) - || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.egg, 1, W), true) - || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.firework_charge, 1, W), true) - || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fireworks, 1, W), true) - || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fire_charge, 1, W), true)) { + || GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.tnt, 1, W), true) + || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.egg, 1, W), true) + || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.firework_charge, 1, W), true) + || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fireworks, 1, W), true) + || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fire_charge, 1, W), true)) { if (aTileEntity instanceof IGregTechTileEntity) { GT_Log.exp.println( - "Microwave Explosion due to TNT || EGG || FIREWORKCHARGE || FIREWORK || FIRE CHARGE"); + "Microwave Explosion due to TNT || EGG || FIREWORKCHARGE || FIREWORK || FIRE CHARGE"); ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4); } return null; @@ -4921,7 +4872,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (tData != null) { if (tData.mMaterial != null && tData.mMaterial.mMaterial != null) { if (tData.mMaterial.mMaterial.contains(SubTag.METAL) - || tData.mMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) { + || tData.mMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) { if (aTileEntity instanceof IGregTechTileEntity) { GT_Log.exp.println("Microwave Explosion due to METAL insertion"); ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4); @@ -4938,7 +4889,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } for (MaterialStack tMaterial : tData.mByProducts) if (tMaterial != null) { if (tMaterial.mMaterial.contains(SubTag.METAL) - || tMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) { + || tMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) { if (aTileEntity instanceof IGregTechTileEntity) { GT_Log.exp.println("Microwave Explosion due to METAL insertion"); ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4); @@ -4964,17 +4915,17 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } return tOutput == null ? null - : new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - new ItemStack[] { tOutput }, - null, - null, - null, - null, - 32, - 4, - 0); + : new GT_Recipe( + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + new ItemStack[] { tOutput }, + null, + null, + null, + null, + 32, + 4, + 0); } @Override @@ -4989,47 +4940,46 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_Unboxinator extends GT_Recipe_Map { public GT_Recipe_Map_Unboxinator(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || !ItemList.IC2_Scrapbox.isStackEqual(aInputs[0], false, true)) return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); ItemStack tOutput = GT_ModHandler.getRandomScrapboxDrop(); if (tOutput == null) return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); GT_Recipe rRecipe = new GT_Recipe( - false, - new ItemStack[] { ItemList.IC2_Scrapbox.get(1) }, - new ItemStack[] { tOutput }, - null, - null, - null, - null, - 16, - 1, - 0); + false, + new ItemStack[] { ItemList.IC2_Scrapbox.get(1) }, + new ItemStack[] { tOutput }, + null, + null, + null, + null, + 16, + 1, + 0); // It is not allowed to be buffered due to the random Output rRecipe.mCanBeBuffered = false; // Due to its randomness it is not good if there are Items in the Output Slot, because those Items could @@ -5050,72 +5000,70 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_FluidCanner extends GT_Recipe_Map { public GT_Recipe_Map_FluidCanner(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { GT_Recipe rRecipe = super.findRecipe( - aTileEntity, - aRecipe, - aNotUnificated, - aVoltage, - aFluids, - aSpecialSlot, - aInputs); + aTileEntity, + aRecipe, + aNotUnificated, + aVoltage, + aFluids, + aSpecialSlot, + aInputs); if (aInputs == null || aInputs.length <= 0 - || aInputs[0] == null - || rRecipe != null - || !GregTech_API.sPostloadFinished) - return rRecipe; + || aInputs[0] == null + || rRecipe != null + || !GregTech_API.sPostloadFinished) return rRecipe; if (aFluids != null && aFluids.length > 0 && aFluids[0] != null) { ItemStack tOutput = GT_Utility.fillFluidContainer(aFluids[0], aInputs[0], false, true); FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true); if (tFluid != null) rRecipe = new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - new ItemStack[] { tOutput }, - null, - null, - new FluidStack[] { tFluid }, - null, - Math.max(tFluid.amount / 64, 16), - 1, - 0); + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + new ItemStack[] { tOutput }, + null, + null, + new FluidStack[] { tFluid }, + null, + Math.max(tFluid.amount / 64, 16), + 1, + 0); } if (rRecipe == null) { FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInputs[0], true); if (tFluid != null) rRecipe = new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - new ItemStack[] { GT_Utility.getContainerItem(aInputs[0], true) }, - null, - null, - null, - new FluidStack[] { tFluid }, - Math.max(tFluid.amount / 64, 16), - 1, - 0); + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + new ItemStack[] { GT_Utility.getContainerItem(aInputs[0], true) }, + null, + null, + null, + new FluidStack[] { tFluid }, + Math.max(tFluid.amount / 64, 16), + 1, + 0); } if (rRecipe != null) rRecipe.mCanBeBuffered = false; return rRecipe; @@ -5124,7 +5072,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { @Override public boolean containsInput(ItemStack aStack) { return aStack != null && (super.containsInput(aStack) || (aStack.getItem() instanceof IFluidContainerItem - && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0)); + && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0)); } @Override @@ -5144,45 +5092,44 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_Recycler extends GT_Recipe_Map_NonGTRecipes { public GT_Recipe_Map_Recycler(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; return new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aInputs[0]), 0) == null ? null - : new ItemStack[] { ItemList.IC2_Scrap.get(1) }, - null, - new int[] { 1250 }, - null, - null, - 45, - 1, - 0); + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aInputs[0]), 0) == null ? null + : new ItemStack[] { ItemList.IC2_Scrap.get(1) }, + null, + new int[] { 1250 }, + null, + null, + 45, + 1, + 0); } @Override @@ -5197,46 +5144,46 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_Compressor extends GT_Recipe_Map_NonGTRecipes { public GT_Recipe_Map_Compressor(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]); ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput( - tComparedInput, - ic2.api.recipe.Recipes.compressor.getRecipes(), - true, - new NBTTagCompound(), - null, - null, - null); - return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe( + tComparedInput, + ic2.api.recipe.Recipes.compressor.getRecipes(), + true, + new NBTTagCompound(), + null, + null, + null); + return GT_Utility.arrayContainsNonNull(tOutputItems) + ? new GT_Recipe( false, new ItemStack[] { - GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, + GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, tOutputItems, null, null, @@ -5244,20 +5191,21 @@ public class GT_Recipe implements Comparable<GT_Recipe> { null, 400, 2, - 0) : null; + 0) + : null; } @Override public boolean containsInput(ItemStack aStack) { return GT_Utility.arrayContainsNonNull( - GT_ModHandler.getMachineOutput( - GT_Utility.copyAmount(64, aStack), - ic2.api.recipe.Recipes.compressor.getRecipes(), - false, - new NBTTagCompound(), - null, - null, - null)); + GT_ModHandler.getMachineOutput( + GT_Utility.copyAmount(64, aStack), + ic2.api.recipe.Recipes.compressor.getRecipes(), + false, + new NBTTagCompound(), + null, + null, + null)); } } @@ -5267,46 +5215,46 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_Extractor extends GT_Recipe_Map_NonGTRecipes { public GT_Recipe_Map_Extractor(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]); ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput( - tComparedInput, - ic2.api.recipe.Recipes.extractor.getRecipes(), - true, - new NBTTagCompound(), - null, - null, - null); - return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe( + tComparedInput, + ic2.api.recipe.Recipes.extractor.getRecipes(), + true, + new NBTTagCompound(), + null, + null, + null); + return GT_Utility.arrayContainsNonNull(tOutputItems) + ? new GT_Recipe( false, new ItemStack[] { - GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, + GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, tOutputItems, null, null, @@ -5314,20 +5262,21 @@ public class GT_Recipe implements Comparable<GT_Recipe> { null, 400, 2, - 0) : null; + 0) + : null; } @Override public boolean containsInput(ItemStack aStack) { return GT_Utility.arrayContainsNonNull( - GT_ModHandler.getMachineOutput( - GT_Utility.copyAmount(64, aStack), - ic2.api.recipe.Recipes.extractor.getRecipes(), - false, - new NBTTagCompound(), - null, - null, - null)); + GT_ModHandler.getMachineOutput( + GT_Utility.copyAmount(64, aStack), + ic2.api.recipe.Recipes.extractor.getRecipes(), + false, + new NBTTagCompound(), + null, + null, + null)); } } @@ -5337,46 +5286,47 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_ThermalCentrifuge extends GT_Recipe_Map_NonGTRecipes { public GT_Recipe_Map_ThermalCentrifuge(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, - String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, + int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]); ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput( - tComparedInput, - ic2.api.recipe.Recipes.centrifuge.getRecipes(), - true, - new NBTTagCompound(), - null, - null, - null); - return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe( + tComparedInput, + ic2.api.recipe.Recipes.centrifuge.getRecipes(), + true, + new NBTTagCompound(), + null, + null, + null); + return GT_Utility.arrayContainsNonNull(tOutputItems) + ? new GT_Recipe( false, new ItemStack[] { - GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, + GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, tOutputItems, null, null, @@ -5384,20 +5334,21 @@ public class GT_Recipe implements Comparable<GT_Recipe> { null, 400, 48, - 0) : null; + 0) + : null; } @Override public boolean containsInput(ItemStack aStack) { return GT_Utility.arrayContainsNonNull( - GT_ModHandler.getMachineOutput( - GT_Utility.copyAmount(64, aStack), - ic2.api.recipe.Recipes.centrifuge.getRecipes(), - false, - new NBTTagCompound(), - null, - null, - null)); + GT_ModHandler.getMachineOutput( + GT_Utility.copyAmount(64, aStack), + ic2.api.recipe.Recipes.centrifuge.getRecipes(), + false, + new NBTTagCompound(), + null, + null, + null)); } } @@ -5407,75 +5358,75 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_OreWasher extends GT_Recipe_Map_NonGTRecipes { public GT_Recipe_Map_OreWasher(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 - || aInputs[0] == null - || aFluids == null - || aFluids.length < 1 - || !GT_ModHandler.isWater(aFluids[0])) - return null; + || aInputs[0] == null + || aFluids == null + || aFluids.length < 1 + || !GT_ModHandler.isWater(aFluids[0])) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]); NBTTagCompound aRecipeMetaData = new NBTTagCompound(); ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput( - tComparedInput, - ic2.api.recipe.Recipes.oreWashing.getRecipes(), - true, - aRecipeMetaData, - null, - null, - null); - return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe( + tComparedInput, + ic2.api.recipe.Recipes.oreWashing.getRecipes(), + true, + aRecipeMetaData, + null, + null, + null); + return GT_Utility.arrayContainsNonNull(tOutputItems) + ? new GT_Recipe( false, new ItemStack[] { - GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, + GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, tOutputItems, null, null, new FluidStack[] { new FluidStack( - aFluids[0].getFluid(), - ((NBTTagCompound) aRecipeMetaData.getTag("return")).getInteger("amount")) }, + aFluids[0].getFluid(), + ((NBTTagCompound) aRecipeMetaData.getTag("return")).getInteger("amount")) }, null, 400, 16, - 0) : null; + 0) + : null; } @Override public boolean containsInput(ItemStack aStack) { return GT_Utility.arrayContainsNonNull( - GT_ModHandler.getMachineOutput( - GT_Utility.copyAmount(64, aStack), - ic2.api.recipe.Recipes.oreWashing.getRecipes(), - false, - new NBTTagCompound(), - null, - null, - null)); + GT_ModHandler.getMachineOutput( + GT_Utility.copyAmount(64, aStack), + ic2.api.recipe.Recipes.oreWashing.getRecipes(), + false, + new NBTTagCompound(), + null, + null, + null)); } @Override @@ -5495,52 +5446,51 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_Macerator extends GT_Recipe_Map { public GT_Recipe_Map_Macerator(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || !GregTech_API.sPostloadFinished) return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); aRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); if (aRecipe != null) return aRecipe; try { - List<ItemStack> tRecipeOutputs = mods.railcraft.api.crafting.RailcraftCraftingManager.rockCrusher.getRecipe( - GT_Utility.copyAmount(1, aInputs[0])) - .getRandomizedOuputs(); + List<ItemStack> tRecipeOutputs = mods.railcraft.api.crafting.RailcraftCraftingManager.rockCrusher + .getRecipe(GT_Utility.copyAmount(1, aInputs[0])) + .getRandomizedOuputs(); if (tRecipeOutputs != null) { aRecipe = new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - tRecipeOutputs.toArray(new ItemStack[0]), - null, - null, - null, - null, - 800, - 2, - 0); + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + tRecipeOutputs.toArray(new ItemStack[0]), + null, + null, + null, + null, + 800, + 2, + 0); aRecipe.mCanBeBuffered = false; aRecipe.mNeedsEmptyOutput = true; return aRecipe; @@ -5553,17 +5503,18 @@ public class GT_Recipe implements Comparable<GT_Recipe> { ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]); ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput( - tComparedInput, - ic2.api.recipe.Recipes.macerator.getRecipes(), - true, - new NBTTagCompound(), - null, - null, - null); - return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe( + tComparedInput, + ic2.api.recipe.Recipes.macerator.getRecipes(), + true, + new NBTTagCompound(), + null, + null, + null); + return GT_Utility.arrayContainsNonNull(tOutputItems) + ? new GT_Recipe( false, new ItemStack[] { - GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, + GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, tOutputItems, null, null, @@ -5571,20 +5522,21 @@ public class GT_Recipe implements Comparable<GT_Recipe> { null, 400, 2, - 0) : null; + 0) + : null; } @Override public boolean containsInput(ItemStack aStack) { return super.containsInput(aStack) || GT_Utility.arrayContainsNonNull( - GT_ModHandler.getMachineOutput( - GT_Utility.copyAmount(64, aStack), - ic2.api.recipe.Recipes.macerator.getRecipes(), - false, - new NBTTagCompound(), - null, - null, - null)); + GT_ModHandler.getMachineOutput( + GT_Utility.copyAmount(64, aStack), + ic2.api.recipe.Recipes.macerator.getRecipes(), + false, + new NBTTagCompound(), + null, + null, + null)); } } @@ -5594,31 +5546,30 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_Assembler extends GT_Recipe_Map { public GT_Recipe_Map_Assembler(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, true, aVoltage, aFluids, aSpecialSlot, aInputs); /* @@ -5633,10 +5584,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * break; } } if(rRecipe!= null) break; }else aInputs2.add(aInput); if(rRecipe!= null) break; } } */ if (aInputs == null || aInputs.length <= 0 - || aInputs[0] == null - || rRecipe == null - || !GregTech_API.sPostloadFinished) - return rRecipe; + || aInputs[0] == null + || rRecipe == null + || !GregTech_API.sPostloadFinished) return rRecipe; for (ItemStack aInput : aInputs) { if (ItemList.Paper_Printed_Pages.isStackEqual(aInput, false, true)) { @@ -5655,41 +5605,40 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_FormingPress extends GT_Recipe_Map { public GT_Recipe_Map_FormingPress(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, - ItemStack... aInputs) { + boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, + ItemStack... aInputs) { GT_Recipe rRecipe = super.findRecipe( - aTileEntity, - aRecipe, - aNotUnificated, - aDontCheckStackSizes, - aVoltage, - aFluids, - aSpecialSlot, - aInputs); + aTileEntity, + aRecipe, + aNotUnificated, + aDontCheckStackSizes, + aVoltage, + aFluids, + aSpecialSlot, + aInputs); if (aInputs == null || aInputs.length < 2 || !GregTech_API.sPostloadFinished) return rRecipe; if (rRecipe == null) return findRenamingRecipe(aInputs); for (ItemStack aMold : aInputs) { @@ -5731,16 +5680,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> { ItemStack output = GT_Utility.copyAmount(1, input); output.setStackDisplayName(mold.getDisplayName()); GT_Recipe recipe = new GT_Recipe( - false, - new ItemStack[] { ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, input) }, - new ItemStack[] { output }, - null, - null, - null, - null, - 128, - 8, - 0); + false, + new ItemStack[] { ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, input) }, + new ItemStack[] { output }, + null, + null, + null, + null, + 128, + 8, + 0); recipe.mCanBeBuffered = false; return recipe; } @@ -5752,46 +5701,44 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_Printer extends GT_Recipe_Map { public GT_Recipe_Map_Printer(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { GT_Recipe rRecipe = super.findRecipe( - aTileEntity, - aRecipe, - aNotUnificated, - aVoltage, - aFluids, - aSpecialSlot, - aInputs); + aTileEntity, + aRecipe, + aNotUnificated, + aVoltage, + aFluids, + aSpecialSlot, + aInputs); if (aInputs == null || aInputs.length <= 0 - || aInputs[0] == null - || aFluids == null - || aFluids.length <= 0 - || aFluids[0] == null - || !GregTech_API.sPostloadFinished) - return rRecipe; + || aInputs[0] == null + || aFluids == null + || aFluids.length <= 0 + || aFluids[0] == null + || !GregTech_API.sPostloadFinished) return rRecipe; Dyes aDye = null; for (Dyes tDye : Dyes.VALUES) if (tDye.isFluidDye(aFluids[0])) { @@ -5803,58 +5750,57 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (rRecipe == null) { ItemStack tOutput = GT_ModHandler.getAllRecipeOutput( - aTileEntity == null ? null : aTileEntity.getWorld(), - aInputs[0], - aInputs[0], - aInputs[0], - aInputs[0], - ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1), - aInputs[0], - aInputs[0], - aInputs[0], - aInputs[0]); + aTileEntity == null ? null : aTileEntity.getWorld(), + aInputs[0], + aInputs[0], + aInputs[0], + aInputs[0], + ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1), + aInputs[0], + aInputs[0], + aInputs[0], + aInputs[0]); if (tOutput != null) return addRecipe( - new GT_Recipe( - true, - new ItemStack[] { GT_Utility.copyAmount(8, aInputs[0]) }, - new ItemStack[] { tOutput }, - null, - null, - new FluidStack[] { new FluidStack(aFluids[0].getFluid(), (int) L) }, - null, - 256, - 2, - 0), - false, - false, - true); + new GT_Recipe( + true, + new ItemStack[] { GT_Utility.copyAmount(8, aInputs[0]) }, + new ItemStack[] { tOutput }, + null, + null, + new FluidStack[] { new FluidStack(aFluids[0].getFluid(), (int) L) }, + null, + 256, + 2, + 0), + false, + false, + true); tOutput = GT_ModHandler.getAllRecipeOutput( - aTileEntity == null ? null : aTileEntity.getWorld(), - aInputs[0], - ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1)); + aTileEntity == null ? null : aTileEntity.getWorld(), + aInputs[0], + ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1)); if (tOutput != null) return addRecipe( - new GT_Recipe( - true, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - new ItemStack[] { tOutput }, - null, - null, - new FluidStack[] { new FluidStack(aFluids[0].getFluid(), (int) L) }, - null, - 32, - 2, - 0), - false, - false, - true); + new GT_Recipe( + true, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + new ItemStack[] { tOutput }, + null, + null, + new FluidStack[] { new FluidStack(aFluids[0].getFluid(), (int) L) }, + null, + 32, + 2, + 0), + false, + false, + true); } else { if (aInputs[0].getItem() == Items.paper) { if (!ItemList.Tool_DataStick.isStackEqual(aSpecialSlot, false, true)) return null; NBTTagCompound tNBT = aSpecialSlot.getTagCompound(); if (tNBT == null || GT_Utility.isStringInvalid(tNBT.getString("title")) - || GT_Utility.isStringInvalid(tNBT.getString("author"))) - return null; + || GT_Utility.isStringInvalid(tNBT.getString("author"))) return null; rRecipe = rRecipe.copy(); rRecipe.mCanBeBuffered = false; @@ -5879,10 +5825,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> { rRecipe = rRecipe.copy(); rRecipe.mCanBeBuffered = false; rRecipe.mOutputs[0].setTagCompound( - GT_Utility.getNBTContainingString( - new NBTTagCompound(), - "GT.PunchCardData", - tNBT.getString("GT.PunchCardData"))); + GT_Utility.getNBTContainingString( + new NBTTagCompound(), + "GT.PunchCardData", + tNBT.getString("GT.PunchCardData"))); return rRecipe; } } @@ -5908,45 +5854,45 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_LargeBoilerFakeFuels extends GT_Recipe_Map { private static final List<String> ALLOWED_SOLID_FUELS = Arrays.asList( - GregTech_API.sMachineFile.mConfig.getStringList( - "LargeBoiler.allowedFuels", - ConfigCategories.machineconfig.toString(), - new String[] { "gregtech:gt.blockreinforced:6", "gregtech:gt.blockreinforced:7" }, - "Allowed fuels for the Large Titanium Boiler and Large Tungstensteel Boiler")); + GregTech_API.sMachineFile.mConfig.getStringList( + "LargeBoiler.allowedFuels", + ConfigCategories.machineconfig.toString(), + new String[] { "gregtech:gt.blockreinforced:6", "gregtech:gt.blockreinforced:7" }, + "Allowed fuels for the Large Titanium Boiler and Large Tungstensteel Boiler")); public GT_Recipe_Map_LargeBoilerFakeFuels() { super( - new HashSet<>(55), - "gt.recipe.largeboilerfakefuels", - "Large Boiler", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true); + new HashSet<>(55), + "gt.recipe.largeboilerfakefuels", + "Large Boiler", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true); GT_Recipe explanatoryRecipe = new GT_Recipe( - true, - new ItemStack[] {}, - new ItemStack[] {}, - null, - null, - null, - null, - 1, - 1, - 1); + true, + new ItemStack[] {}, + new ItemStack[] {}, + null, + null, + null, + null, + 1, + 1, + 1); explanatoryRecipe.setNeiDesc( - "Not all solid fuels are listed.", - "Any item that burns in a", - "vanilla furnace will burn in", - "a Large Bronze or Steel Boiler."); + "Not all solid fuels are listed.", + "Any item that burns in a", + "vanilla furnace will burn in", + "a Large Bronze or Steel Boiler."); addRecipe(explanatoryRecipe); } @@ -5987,19 +5933,19 @@ public class GT_Recipe implements Comparable<GT_Recipe> { allowedFuel = ALLOWED_SOLID_FUELS.contains(registryName + ":" + fuelItemStack.getItemDamage()); } return addRecipe( - new GT_Recipe( - true, - new ItemStack[] { fuelItemStack }, - new ItemStack[] {}, - null, - null, - null, - null, - 1, - 0, - GT_ModHandler.getFuelValue(fuelItemStack) / 1600), - ((double) GT_ModHandler.getFuelValue(fuelItemStack)) / 1600, - allowedFuel); + new GT_Recipe( + true, + new ItemStack[] { fuelItemStack }, + new ItemStack[] {}, + null, + null, + null, + null, + 1, + 0, + GT_ModHandler.getFuelValue(fuelItemStack) / 1600), + ((double) GT_ModHandler.getFuelValue(fuelItemStack)) / 1600, + allowedFuel); } private GT_Recipe addRecipe(GT_Recipe recipe, double baseBurnTime, boolean isAllowedFuel) { @@ -6018,18 +5964,18 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (isAllowedFuel) { recipe.setNeiDesc( - "Burn time in seconds:", - String.format("Bronze Boiler: %.4f", bronzeBurnTime), - String.format("Steel Boiler: %.4f", steelBurnTime), - String.format("Titanium Boiler: %.4f", titaniumBurnTime), - String.format("Tungstensteel Boiler: %.4f", tungstensteelBurnTime)); + "Burn time in seconds:", + String.format("Bronze Boiler: %.4f", bronzeBurnTime), + String.format("Steel Boiler: %.4f", steelBurnTime), + String.format("Titanium Boiler: %.4f", titaniumBurnTime), + String.format("Tungstensteel Boiler: %.4f", tungstensteelBurnTime)); } else { recipe.setNeiDesc( - "Burn time in seconds:", - String.format("Bronze Boiler: %.4f", bronzeBurnTime), - String.format("Steel Boiler: %.4f", steelBurnTime), - "Titanium Boiler: Not allowed", - "Tungstenst. Boiler: Not allowed"); + "Burn time in seconds:", + String.format("Bronze Boiler: %.4f", bronzeBurnTime), + String.format("Steel Boiler: %.4f", steelBurnTime), + "Titanium Boiler: Not allowed", + "Tungstenst. Boiler: Not allowed"); } return super.addRecipe(recipe); @@ -6046,11 +5992,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> { steelBurnTime -= steelBurnTime % 0.05; recipe.setNeiDesc( - "Burn time in seconds:", - String.format("Bronze Boiler: %.4f", bronzeBurnTime), - String.format("Steel Boiler: %.4f", steelBurnTime), - "Titanium Boiler: Not allowed", - "Tungstenst. Boiler: Not allowed"); + "Burn time in seconds:", + String.format("Bronze Boiler: %.4f", bronzeBurnTime), + String.format("Steel Boiler: %.4f", steelBurnTime), + "Titanium Boiler: Not allowed", + "Tungstenst. Boiler: Not allowed"); return super.addRecipe(recipe); } @@ -6060,21 +6006,21 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public GT_Recipe_Map_IC2NuclearFake() { super( - new HashSet<>(10), - "gt.recipe.ic2nuke", - "Fission", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true); + new HashSet<>(10), + "gt.recipe.ic2nuke", + "Fission", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true); setLogo(GT_UITextures.PICTURE_RADIATION_WARNING); setLogoPos(152, 24); setNEIBackgroundSize(172, 60); @@ -6093,27 +6039,27 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * @return added fake recipe */ public GT_Recipe addBreederCell(ItemStack input, ItemStack output, boolean reflector, int heatStep, - int heatMultiplier, int requiredPulses) { + int heatMultiplier, int requiredPulses) { return addFakeRecipe( - input, - output, - reflector ? "Neutron reflecting breeder cell" : "Heat neutral Breeder Cell", - String.format("Every %d reactor hull heat", heatStep), - String.format("increase speed by %d00%%", heatMultiplier), - String.format("Required pulses: %d", requiredPulses)); + input, + output, + reflector ? "Neutron reflecting breeder cell" : "Heat neutral Breeder Cell", + String.format("Every %d reactor hull heat", heatStep), + String.format("increase speed by %d00%%", heatMultiplier), + String.format("Required pulses: %d", requiredPulses)); } public GT_Recipe addFakeRecipe(ItemStack input, ItemStack output, String... neiDesc) { GT_Recipe r = new GT_Recipe( - new ItemStack[] { input }, - new ItemStack[] { output }, - null, - new int[] { 10000 }, - null, - null, - 0, - 0, - 0); + new ItemStack[] { input }, + new ItemStack[] { output }, + null, + new int[] { 10000 }, + null, + null, + 0, + 0, + 0); r.setNeiDesc(neiDesc); return addRecipe(r, true, true, false); } @@ -6126,27 +6072,27 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public GT_Recipe_Map_LargeChemicalReactor() { super( - new HashSet<>(1000), - "gt.recipe.largechemicalreactor", - "Large Chemical Reactor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), - TOTAL_INPUT_COUNT, - OUTPUT_COUNT, - 0, - 0, - 1, - E, - 1, - E, - true, - true); + new HashSet<>(1000), + "gt.recipe.largechemicalreactor", + "Large Chemical Reactor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), + TOTAL_INPUT_COUNT, + OUTPUT_COUNT, + 0, + 0, + 1, + E, + 1, + E, + true, + true); } @Override public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, - int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { + int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue) { aOptimize = false; ArrayList<ItemStack> adjustedInputs = new ArrayList<>(); ArrayList<ItemStack> adjustedOutputs = new ArrayList<>(); @@ -6164,19 +6110,19 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (inputFluidContent != null) { inputFluidContent.amount *= input.stackSize; if (inputFluidContent.getFluid() - .getName() - .equals("ic2steam")) { + .getName() + .equals("ic2steam")) { inputFluidContent = GT_ModHandler.getSteam(inputFluidContent.amount); } adjustedFluidInputs.add(inputFluidContent); } else { ItemData itemData = GT_OreDictUnificator.getItemData(input); if (itemData != null && itemData.hasValidPrefixMaterialData() - && itemData.mMaterial.mMaterial == Materials.Empty) { + && itemData.mMaterial.mMaterial == Materials.Empty) { continue; } else { if (itemData != null && itemData.hasValidPrefixMaterialData() - && itemData.mPrefix == OrePrefixes.cell) { + && itemData.mPrefix == OrePrefixes.cell) { ItemStack dustStack = itemData.mMaterial.mMaterial.getDust(input.stackSize); if (dustStack != null) { adjustedInputs.add(dustStack); @@ -6208,15 +6154,15 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (outputFluidContent != null) { outputFluidContent.amount *= output.stackSize; if (outputFluidContent.getFluid() - .getName() - .equals("ic2steam")) { + .getName() + .equals("ic2steam")) { outputFluidContent = GT_ModHandler.getSteam(outputFluidContent.amount); } adjustedFluidOutputs.add(outputFluidContent); } else { ItemData itemData = GT_OreDictUnificator.getItemData(output); if (!(itemData != null && itemData.hasValidPrefixMaterialData() - && itemData.mMaterial.mMaterial == Materials.Empty)) { + && itemData.mMaterial.mMaterial == Materials.Empty)) { adjustedOutputs.add(output); } } @@ -6229,16 +6175,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> { aFluidOutputs = adjustedFluidOutputs.toArray(new FluidStack[0]); return super.addRecipe( - aOptimize, - aInputs, - aOutputs, - aSpecial, - aOutputChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue); + aOptimize, + aInputs, + aOutputs, + aSpecial, + aOutputChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); } } @@ -6246,21 +6192,21 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public GT_Recipe_Map_DistillationTower() { super( - new HashSet<>(110), - "gt.recipe.distillationtower", - "Distillation Tower", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "DistillationTower"), - 2, - 1, - 0, - 0, - 1, - E, - 1, - E, - true, - true); + new HashSet<>(110), + "gt.recipe.distillationtower", + "Distillation Tower", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "DistillationTower"), + 2, + 1, + 0, + 0, + 1, + E, + 1, + E, + true, + true); setLogoPos(80, 62); } @@ -6297,21 +6243,21 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public GT_Recipe_Map_OilCracker() { super( - new HashSet<>(70), - "gt.recipe.craker", - "Oil Cracker", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "OilCracker"), - 1, - 1, - 1, - 2, - 1, - E, - 1, - E, - true, - true); + new HashSet<>(70), + "gt.recipe.craker", + "Oil Cracker", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "OilCracker"), + 1, + 1, + 1, + 2, + 1, + E, + 1, + E, + true, + true); } @Override @@ -6319,16 +6265,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> { GT_Recipe ret = super.add(aRecipe); if (ret != null && ret.mFluidInputs != null && ret.mFluidInputs.length > 1 && ret.mFluidInputs[1] != null) { mValidCatalystFluidNames.add( - ret.mFluidInputs[1].getFluid() - .getName()); + ret.mFluidInputs[1].getFluid() + .getName()); } return ret; } public boolean isValidCatalystFluid(FluidStack aFluidStack) { return mValidCatalystFluidNames.contains( - aFluidStack.getFluid() - .getName()); + aFluidStack.getFluid() + .getName()); } } @@ -6337,42 +6283,42 @@ public class GT_Recipe implements Comparable<GT_Recipe> { ItemStack[][] mOreDictAlt; GT_Recipe_WithAlt(ItemStack[] mInputs, ItemStack[] mOutputs, FluidStack[] mFluidInputs, - FluidStack[] mFluidOutputs, int[] mChances, Object mSpecialItems, int mDuration, int mEUt, - int mSpecialValue, boolean mEnabled, boolean mHidden, boolean mFakeRecipe, boolean mCanBeBuffered, - boolean mNeedsEmptyOutput, String[] neiDesc, ItemStack[][] mOreDictAlt) { + FluidStack[] mFluidOutputs, int[] mChances, Object mSpecialItems, int mDuration, int mEUt, + int mSpecialValue, boolean mEnabled, boolean mHidden, boolean mFakeRecipe, boolean mCanBeBuffered, + boolean mNeedsEmptyOutput, String[] neiDesc, ItemStack[][] mOreDictAlt) { super( - mInputs, - mOutputs, - mFluidInputs, - mFluidOutputs, - mChances, - mSpecialItems, - mDuration, - mEUt, - mSpecialValue, - mEnabled, - mHidden, - mFakeRecipe, - mCanBeBuffered, - mNeedsEmptyOutput, - neiDesc); + mInputs, + mOutputs, + mFluidInputs, + mFluidOutputs, + mChances, + mSpecialItems, + mDuration, + mEUt, + mSpecialValue, + mEnabled, + mHidden, + mFakeRecipe, + mCanBeBuffered, + mNeedsEmptyOutput, + neiDesc); this.mOreDictAlt = mOreDictAlt; } public GT_Recipe_WithAlt(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, - int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue, ItemStack[][] aAlt) { + int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue, ItemStack[][] aAlt) { super( - aOptimize, - aInputs, - aOutputs, - aSpecialItems, - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue); + aOptimize, + aInputs, + aOutputs, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); mOreDictAlt = aAlt; } @@ -6395,101 +6341,100 @@ public class GT_Recipe implements Comparable<GT_Recipe> { private static class ReplicatorFakeMap extends GT_Recipe_Map { public ReplicatorFakeMap(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { + Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue) { AtomicInteger ai = new AtomicInteger(); Optional.ofNullable(GT_OreDictUnificator.getAssociation(aOutputs[0])) - .map(itemData -> itemData.mMaterial) - .map(materialsStack -> materialsStack.mMaterial) - .map(materials -> materials.mElement) - .map(Element::getMass) - .ifPresent(e -> { - aFluidInputs[0].amount = (int) GT_MetaTileEntity_Replicator.cubicFluidMultiplier(e); - ai.set(GT_Utility.safeInt(aFluidInputs[0].amount * 512L, 1)); - }); + .map(itemData -> itemData.mMaterial) + .map(materialsStack -> materialsStack.mMaterial) + .map(materials -> materials.mElement) + .map(Element::getMass) + .ifPresent(e -> { + aFluidInputs[0].amount = (int) GT_MetaTileEntity_Replicator.cubicFluidMultiplier(e); + ai.set(GT_Utility.safeInt(aFluidInputs[0].amount * 512L, 1)); + }); return addFakeRecipe( - aCheckForCollisions, - new GT_Recipe( - false, - aInputs, - aOutputs, - aSpecial, - null, - aFluidInputs, - aFluidOutputs, - ai.get(), - aEUt, - aSpecialValue)); + aCheckForCollisions, + new GT_Recipe( + false, + aInputs, + aOutputs, + aSpecial, + null, + aFluidInputs, + aFluidOutputs, + ai.get(), + aEUt, + aSpecialValue)); } } public static class GT_Recipe_Map_ComplexFusion extends GT_Recipe_Map { public GT_Recipe_Map_ComplexFusion(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, - String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, + int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, - int aDuration, int aEUt, int aSpecialValue) { + int aDuration, int aEUt, int aSpecialValue) { return addRecipe( - new GT_Recipe( - false, - null, - null, - null, - aOutputChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue), - false, + new GT_Recipe( false, - false); + null, + null, + null, + aOutputChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue), + false, + false, + false); } @Override @@ -6506,26 +6451,26 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static class GT_Recipe_Map_AssemblyLineFake extends GT_Recipe_Map { public GT_Recipe_Map_AssemblyLineFake(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, - String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, + int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); setNEITransferRect(new Rectangle(146, 26, 10, 18)); } @@ -6551,35 +6496,32 @@ public class GT_Recipe implements Comparable<GT_Recipe> { @Override public void addProgressBarUI(ModularWindow.Builder builder, Supplier<Float> progressSupplier, - Pos2d windowOffset) { + Pos2d windowOffset) { int bar1Width = 17; int bar2Width = 18; builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1, 17) - .setDirection(ProgressBar.Direction.RIGHT) - .setProgress( - () -> progressSupplier.get() - * ((float) (bar1Width + bar2Width) / bar1Width)) - .setSynced(false, false) - .setPos(new Pos2d(88, 8).add(windowOffset)) - .setSize(bar1Width, 72)); + new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1, 17) + .setDirection(ProgressBar.Direction.RIGHT) + .setProgress(() -> progressSupplier.get() * ((float) (bar1Width + bar2Width) / bar1Width)) + .setSynced(false, false) + .setPos(new Pos2d(88, 8).add(windowOffset)) + .setSize(bar1Width, 72)); builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_2, 18) - .setDirection(ProgressBar.Direction.RIGHT) - .setProgress( - () -> (progressSupplier.get() - - ((float) bar1Width / (bar1Width + bar2Width))) - * ((float) (bar1Width + bar2Width) / bar2Width)) - .setSynced(false, false) - .setPos(new Pos2d(124, 8).add(windowOffset)) - .setSize(bar2Width, 72)); + new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_2, 18) + .setDirection(ProgressBar.Direction.RIGHT) + .setProgress( + () -> (progressSupplier.get() - ((float) bar1Width / (bar1Width + bar2Width))) + * ((float) (bar1Width + bar2Width) / bar2Width)) + .setSynced(false, false) + .setPos(new Pos2d(124, 8).add(windowOffset)) + .setSize(bar2Width, 72)); builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_3, 18) - .setDirection(ProgressBar.Direction.UP) - .setProgress(progressSupplier) - .setSynced(false, false) - .setPos(new Pos2d(146, 26).add(windowOffset)) - .setSize(10, 18)); + new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_3, 18) + .setDirection(ProgressBar.Direction.UP) + .setProgress(progressSupplier) + .setSynced(false, false) + .setPos(new Pos2d(146, 26).add(windowOffset)) + .setSize(10, 18)); } } } diff --git a/src/main/java/gregtech/api/util/GT_RecipeBuilder.java b/src/main/java/gregtech/api/util/GT_RecipeBuilder.java index bd3e35c2a1..bb061eb2dc 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeBuilder.java +++ b/src/main/java/gregtech/api/util/GT_RecipeBuilder.java @@ -38,7 +38,7 @@ public class GT_RecipeBuilder { static { boolean tmp; if (System.getProperties() - .containsKey("gt.recipebuilder.debug")) { + .containsKey("gt.recipebuilder.debug")) { tmp = Boolean.getBoolean("gt.recipebuilder.debug"); } else { // turn on debug by default in dev mode @@ -72,10 +72,10 @@ public class GT_RecipeBuilder { GT_RecipeBuilder() {} private GT_RecipeBuilder(ItemStack[] inputsBasic, Object[] inputsOreDict, ItemStack[] outputs, ItemStack[][] alts, - FluidStack[] fluidInputs, FluidStack[] fluidOutputs, int[] chances, Object special, int duration, int eut, - int specialValue, boolean enabled, boolean hidden, boolean fakeRecipe, boolean mCanBeBuffered, - boolean mNeedsEmptyOutput, String[] neiDesc, boolean optimize, - Map<MetadataIdentifier<?>, Object> additionalData) { + FluidStack[] fluidInputs, FluidStack[] fluidOutputs, int[] chances, Object special, int duration, int eut, + int specialValue, boolean enabled, boolean hidden, boolean fakeRecipe, boolean mCanBeBuffered, + boolean mNeedsEmptyOutput, String[] neiDesc, boolean optimize, + Map<MetadataIdentifier<?>, Object> additionalData) { this.inputsBasic = inputsBasic; this.inputsOreDict = inputsOreDict; this.outputs = outputs; @@ -99,9 +99,9 @@ public class GT_RecipeBuilder { private static FluidStack[] fix(FluidStack[] fluidInputs) { return Arrays.stream(fluidInputs) - .filter(Objects::nonNull) - .map(GT_FluidStack::new) - .toArray(FluidStack[]::new); + .filter(Objects::nonNull) + .map(GT_FluidStack::new) + .toArray(FluidStack[]::new); } private static ItemStack[] fix(ItemStack[] inputs) { @@ -114,7 +114,7 @@ public class GT_RecipeBuilder { private static boolean containsNull(Object[] arr) { return arr == null || Arrays.stream(arr) - .anyMatch(Objects::isNull); + .anyMatch(Objects::isNull); } private static void handleNullRecipeComponents(String componentType) { @@ -168,9 +168,9 @@ public class GT_RecipeBuilder { if (ores.isEmpty()) continue; int size = ((Number) arr[1]).intValue(); alts[i] = ores.stream() - .map(s -> GT_Utility.copyAmount(size, s)) - .filter(GT_Utility::isStackValid) - .toArray(ItemStack[]::new); + .map(s -> GT_Utility.copyAmount(size, s)) + .filter(GT_Utility::isStackValid) + .toArray(ItemStack[]::new); } else if (input == null) { handleNullRecipeComponents("recipe oredict input"); alts[i] = new ItemStack[0]; @@ -179,8 +179,8 @@ public class GT_RecipeBuilder { } } inputsBasic = Arrays.stream(alts) - .map(ss -> ss.length > 0 ? ss[0] : null) - .toArray(ItemStack[]::new); + .map(ss -> ss.length > 0 ? ss[0] : null) + .toArray(ItemStack[]::new); // optimize cannot handle recipes with alts return noOptimize(); } @@ -368,25 +368,25 @@ public class GT_RecipeBuilder { */ public GT_RecipeBuilder copy() { return new GT_RecipeBuilder( - copy(inputsBasic), - copy(inputsOreDict), - copy(outputs), - copy(alts), - copy(fluidInputs), - copy(fluidOutputs), - copy(chances), - special, - duration, - eut, - specialValue, - enabled, - hidden, - fakeRecipe, - mCanBeBuffered, - mNeedsEmptyOutput, - neiDesc, - optimize, - additionalData); + copy(inputsBasic), + copy(inputsOreDict), + copy(outputs), + copy(alts), + copy(fluidInputs), + copy(fluidOutputs), + copy(chances), + special, + duration, + eut, + specialValue, + enabled, + hidden, + fakeRecipe, + mCanBeBuffered, + mNeedsEmptyOutput, + neiDesc, + optimize, + additionalData); } /** @@ -394,25 +394,25 @@ public class GT_RecipeBuilder { */ public GT_RecipeBuilder copyNoMetadata() { return new GT_RecipeBuilder( - copy(inputsBasic), - copy(inputsOreDict), - copy(outputs), - copy(alts), - copy(fluidInputs), - copy(fluidOutputs), - copy(chances), - special, - duration, - eut, - specialValue, - enabled, - hidden, - fakeRecipe, - mCanBeBuffered, - mNeedsEmptyOutput, - neiDesc, - optimize, - Collections.emptyMap()); + copy(inputsBasic), + copy(inputsOreDict), + copy(outputs), + copy(alts), + copy(fluidInputs), + copy(fluidOutputs), + copy(chances), + special, + duration, + eut, + specialValue, + enabled, + hidden, + fakeRecipe, + mCanBeBuffered, + mNeedsEmptyOutput, + neiDesc, + optimize, + Collections.emptyMap()); } public ItemStack getItemInputBasic(int index) { @@ -582,23 +582,23 @@ public class GT_RecipeBuilder { preBuildChecks(); optimize(); return Optional.of( - decorate( - new GT_Recipe( - inputsBasic, - outputs, - fluidInputs, - fluidOutputs, - chances, - special, - duration, - eut, - specialValue, - enabled, - hidden, - fakeRecipe, - mCanBeBuffered, - mNeedsEmptyOutput, - neiDesc))); + decorate( + new GT_Recipe( + inputsBasic, + outputs, + fluidInputs, + fluidOutputs, + chances, + special, + duration, + eut, + specialValue, + enabled, + hidden, + fakeRecipe, + mCanBeBuffered, + mNeedsEmptyOutput, + neiDesc))); } public GT_RecipeBuilder forceOreDictInput() { @@ -614,24 +614,24 @@ public class GT_RecipeBuilder { preBuildChecks(); // no optimize. return Optional.of( - decorate( - new GT_Recipe.GT_Recipe_WithAlt( - inputsBasic, - outputs, - fluidInputs, - fluidOutputs, - chances, - special, - duration, - eut, - specialValue, - enabled, - hidden, - fakeRecipe, - mCanBeBuffered, - mNeedsEmptyOutput, - neiDesc, - alts))); + decorate( + new GT_Recipe.GT_Recipe_WithAlt( + inputsBasic, + outputs, + fluidInputs, + fluidOutputs, + chances, + special, + duration, + eut, + specialValue, + enabled, + hidden, + fakeRecipe, + mCanBeBuffered, + mNeedsEmptyOutput, + neiDesc, + alts))); } private void preBuildChecks() { @@ -715,8 +715,8 @@ public class GT_RecipeBuilder { public final static class MetadataIdentifier<T> { - private static final Map<MetadataIdentifier<?>, MetadataIdentifier<?>> allIdentifiers = Collections.synchronizedMap( - new HashMap<>()); + private static final Map<MetadataIdentifier<?>, MetadataIdentifier<?>> allIdentifiers = Collections + .synchronizedMap(new HashMap<>()); private final Class<T> clazz; private final String identifier; diff --git a/src/main/java/gregtech/api/util/GT_RecipeConstants.java b/src/main/java/gregtech/api/util/GT_RecipeConstants.java index bdb3346454..2b97bc4f71 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeConstants.java +++ b/src/main/java/gregtech/api/util/GT_RecipeConstants.java @@ -23,64 +23,54 @@ public class GT_RecipeConstants { * Set to true to signal the recipe require low gravity. do nothing if recipe set specialValue explicitly. Can * coexist with CLEANROOM just fine */ - public static final GT_RecipeBuilder.MetadataIdentifier<Boolean> LOW_GRAVITY = GT_RecipeBuilder.MetadataIdentifier.create( - Boolean.class, - "low_gravity"); + public static final GT_RecipeBuilder.MetadataIdentifier<Boolean> LOW_GRAVITY = GT_RecipeBuilder.MetadataIdentifier + .create(Boolean.class, "low_gravity"); /** * Set to true to signal the recipe require cleanroom. do nothing if recipe set specialValue explicitly. Can coexist * with LOW_GRAVITY just fine */ - public static final GT_RecipeBuilder.MetadataIdentifier<Boolean> CLEANROOM = GT_RecipeBuilder.MetadataIdentifier.create( - Boolean.class, - "cleanroom"); + public static final GT_RecipeBuilder.MetadataIdentifier<Boolean> CLEANROOM = GT_RecipeBuilder.MetadataIdentifier + .create(Boolean.class, "cleanroom"); /** * Common additive to use in recipe, e.g. for PBF, this is coal amount. */ - public static final GT_RecipeBuilder.MetadataIdentifier<Integer> ADDITIVE_AMOUNT = GT_RecipeBuilder.MetadataIdentifier.create( - Integer.class, - "additives"); + public static final GT_RecipeBuilder.MetadataIdentifier<Integer> ADDITIVE_AMOUNT = GT_RecipeBuilder.MetadataIdentifier + .create(Integer.class, "additives"); /** * Used for fusion reactor. Denotes ignition threshold. */ - public static final GT_RecipeBuilder.MetadataIdentifier<Integer> FUSION_THRESHOLD = GT_RecipeBuilder.MetadataIdentifier.create( - Integer.class, - "fusion_threshold"); + public static final GT_RecipeBuilder.MetadataIdentifier<Integer> FUSION_THRESHOLD = GT_RecipeBuilder.MetadataIdentifier + .create(Integer.class, "fusion_threshold"); /** * Research time in a scanner used in ticks. */ - public static final GT_RecipeBuilder.MetadataIdentifier<Integer> RESEARCH_TIME = GT_RecipeBuilder.MetadataIdentifier.create( - Integer.class, - "research_time"); + public static final GT_RecipeBuilder.MetadataIdentifier<Integer> RESEARCH_TIME = GT_RecipeBuilder.MetadataIdentifier + .create(Integer.class, "research_time"); /** * Fuel type. TODO should we use enum directly? */ - public static final GT_RecipeBuilder.MetadataIdentifier<Integer> FUEL_TYPE = GT_RecipeBuilder.MetadataIdentifier.create( - Integer.class, - "fuel_type"); + public static final GT_RecipeBuilder.MetadataIdentifier<Integer> FUEL_TYPE = GT_RecipeBuilder.MetadataIdentifier + .create(Integer.class, "fuel_type"); /** * Fuel value. */ - public static final GT_RecipeBuilder.MetadataIdentifier<Integer> FUEL_VALUE = GT_RecipeBuilder.MetadataIdentifier.create( - Integer.class, - "fuel_value"); + public static final GT_RecipeBuilder.MetadataIdentifier<Integer> FUEL_VALUE = GT_RecipeBuilder.MetadataIdentifier + .create(Integer.class, "fuel_value"); /** * Fuel value. */ - public static final GT_RecipeBuilder.MetadataIdentifier<Integer> COIL_HEAT = GT_RecipeBuilder.MetadataIdentifier.create( - Integer.class, - "coil_heat"); + public static final GT_RecipeBuilder.MetadataIdentifier<Integer> COIL_HEAT = GT_RecipeBuilder.MetadataIdentifier + .create(Integer.class, "coil_heat"); /** * Research item used by assline recipes. */ - public static final GT_RecipeBuilder.MetadataIdentifier<ItemStack> RESEARCH_ITEM = GT_RecipeBuilder.MetadataIdentifier.create( - ItemStack.class, - "research_item"); + public static final GT_RecipeBuilder.MetadataIdentifier<ItemStack> RESEARCH_ITEM = GT_RecipeBuilder.MetadataIdentifier + .create(ItemStack.class, "research_item"); /** * For assembler. It accepts a single item as oredict. It looks like no one uses this anyway... */ - public static final GT_RecipeBuilder.MetadataIdentifier<Object> OREDICT_INPUT = GT_RecipeBuilder.MetadataIdentifier.create( - Object.class, - "oredict_input"); + public static final GT_RecipeBuilder.MetadataIdentifier<Object> OREDICT_INPUT = GT_RecipeBuilder.MetadataIdentifier + .create(Object.class, "oredict_input"); /** * Add fusion recipes. Dispatcher between complex fusion (which accepts arbitrarily many input/outputs) and classic @@ -88,8 +78,7 @@ public class GT_RecipeConstants { */ public static final IGT_RecipeMap Fusion = IGT_RecipeMap.newRecipeMap(builder -> { if (GT_Utility.isArrayEmptyOrNull(builder.getFluidInputs()) - || GT_Utility.isArrayEmptyOrNull(builder.getFluidOutputs())) - return Collections.emptyList(); + || GT_Utility.isArrayEmptyOrNull(builder.getFluidOutputs())) return Collections.emptyList(); if (builder.getFluidInputs().length > 2 || builder.getFluidOutputs().length > 2) return GT_Recipe_Map.sComplexFusionRecipes.doAdd(builder); return GT_Recipe_Map.sFusionRecipes.doAdd(builder); @@ -101,8 +90,7 @@ public class GT_RecipeConstants { */ public static final IGT_RecipeMap UniversalArcFurnace = IGT_RecipeMap.newRecipeMap(builder -> { if (!GT_Utility.isArrayOfLength(builder.getItemInputsBasic(), 1) - || GT_Utility.isArrayEmptyOrNull(builder.getItemOutputs())) - return Collections.emptyList(); + || GT_Utility.isArrayEmptyOrNull(builder.getItemOutputs())) return Collections.emptyList(); int aDuration = builder.getDuration(); if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", builder.getItemInputBasic(0), aDuration)) <= 0) { return Collections.emptyList(); @@ -113,13 +101,13 @@ public class GT_RecipeConstants { int tPlasmaAmount = (int) Math.max(1L, aDuration / (mat.getMass() * 16L)); GT_RecipeBuilder b2 = builder.copy(); b2.fluidInputs(mat.getPlasma(tPlasmaAmount)) - .fluidOutputs(mat.getGas(tPlasmaAmount)); + .fluidOutputs(mat.getGas(tPlasmaAmount)); ret.addAll(GT_Recipe_Map.sPlasmaArcFurnaceRecipes.doAdd(b2)); } ret.addAll( - GT_Recipe_Map.sArcFurnaceRecipes.doAdd( - builder.copy() - .fluidInputs(Materials.Oxygen.getGas(aDuration)))); + GT_Recipe_Map.sArcFurnaceRecipes.doAdd( + builder.copy() + .fluidInputs(Materials.Oxygen.getGas(aDuration)))); return ret; }); @@ -135,12 +123,12 @@ public class GT_RecipeConstants { } } return GT_Utility.concat( - builder.copy() - .addTo(GT_Recipe_Map.sChemicalRecipes), - convertCellToFluid(builder, false) - // LCR does not need cleanroom, for now. - .metadata(CLEANROOM, false) - .addTo(GT_Recipe_Map.sMultiblockChemicalRecipes)); + builder.copy() + .addTo(GT_Recipe_Map.sChemicalRecipes), + convertCellToFluid(builder, false) + // LCR does not need cleanroom, for now. + .metadata(CLEANROOM, false) + .addTo(GT_Recipe_Map.sMultiblockChemicalRecipes)); }); /** @@ -150,11 +138,11 @@ public class GT_RecipeConstants { */ public static final IGT_RecipeMap AssemblyLine = IGT_RecipeMap.newRecipeMap(builder -> { Optional<GT_Recipe.GT_Recipe_WithAlt> rr = builder.forceOreDictInput() - .validateInputCount(4, 16) - .validateOutputCount(1, 1) - .validateOutputFluidCount(-1, 0) - .validateInputFluidCount(0, 4) - .buildWithAlt(); + .validateInputCount(4, 16) + .validateOutputCount(1, 1) + .validateOutputFluidCount(-1, 0) + .validateInputFluidCount(0, 4) + .buildWithAlt(); if (!rr.isPresent()) return Collections.emptyList(); GT_Recipe.GT_Recipe_WithAlt r = rr.get(); ItemStack[][] mOreDictAlt = r.mOreDictAlt; @@ -174,21 +162,21 @@ public class GT_RecipeConstants { tPersistentHash *= 31; } else if (input instanceof Object[]objs) { Arrays.sort( - alts, - Comparator.<ItemStack, String>comparing( - s -> GameRegistry.findUniqueIdentifierFor(s.getItem()).modId) - .thenComparing(s -> GameRegistry.findUniqueIdentifierFor(s.getItem()).name) - .thenComparingInt(Items.feather::getDamage) - .thenComparingInt(s -> s.stackSize)); + alts, + Comparator + .<ItemStack, String>comparing(s -> GameRegistry.findUniqueIdentifierFor(s.getItem()).modId) + .thenComparing(s -> GameRegistry.findUniqueIdentifierFor(s.getItem()).name) + .thenComparingInt(Items.feather::getDamage) + .thenComparingInt(s -> s.stackSize)); tPersistentHash = tPersistentHash * 31 + (objs[0] == null ? "" : objs[0].toString()).hashCode(); tPersistentHash = tPersistentHash * 31 + ((Number) objs[1]).intValue(); } GT_Log.err.println( - "addAssemblingLineRecipe " + aResearchItem.getDisplayName() - + " --> " - + aOutput.getUnlocalizedName() - + " there is some null item in that recipe"); + "addAssemblingLineRecipe " + aResearchItem.getDisplayName() + + " --> " + + aOutput.getUnlocalizedName() + + " there is some null item in that recipe"); } tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(aResearchItem, true, false); tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(aOutput, true, false); @@ -202,40 +190,40 @@ public class GT_RecipeConstants { tPersistentHash = tPersistentHash * 31 + r.mEUt; Collection<GT_Recipe> ret = new ArrayList<>(3); ret.add( - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { aResearchItem }, - new ItemStack[] { aOutput }, - new ItemStack[] { ItemList.Tool_DataStick.getWithName(1L, "Writes Research result") }, - null, - null, - aResearchTime, - 30, - -201)); // means it's scanned + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( + false, + new ItemStack[] { aResearchItem }, + new ItemStack[] { aOutput }, + new ItemStack[] { ItemList.Tool_DataStick.getWithName(1L, "Writes Research result") }, + null, + null, + aResearchTime, + 30, + -201)); // means it's scanned ret.add( - GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe( - false, - r.mInputs, - new ItemStack[] { aOutput }, - new ItemStack[] { ItemList.Tool_DataStick.getWithName(1L, "Reads Research result") }, - r.mFluidInputs, - null, - r.mDuration, - r.mEUt, - 0, - r.mOreDictAlt, - false)); - - GT_Recipe.GT_Recipe_AssemblyLine tRecipe = new GT_Recipe.GT_Recipe_AssemblyLine( - aResearchItem, - aResearchTime, + GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe( + false, r.mInputs, + new ItemStack[] { aOutput }, + new ItemStack[] { ItemList.Tool_DataStick.getWithName(1L, "Reads Research result") }, r.mFluidInputs, - aOutput, + null, r.mDuration, r.mEUt, - r.mOreDictAlt); + 0, + r.mOreDictAlt, + false)); + + GT_Recipe.GT_Recipe_AssemblyLine tRecipe = new GT_Recipe.GT_Recipe_AssemblyLine( + aResearchItem, + aResearchTime, + r.mInputs, + r.mFluidInputs, + aOutput, + r.mDuration, + r.mEUt, + r.mOreDictAlt); tRecipe.setPersistentHash(tPersistentHash); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(tRecipe); GT_AssemblyLineUtils.addRecipeToCache(tRecipe); @@ -250,9 +238,9 @@ public class GT_RecipeConstants { Collection<GT_Recipe> ret = new ArrayList<>(); for (ItemStack input : GT_OreDictUnificator.getOresImmutable(builder.getMetadata(OREDICT_INPUT))) { ret.addAll( - builder.copy() - .itemInputs(GT_RecipeMapUtil.appendArray(builder.getItemInputsBasic(), input)) - .addTo(GT_Recipe_Map.sAssemblerRecipes)); + builder.copy() + .itemInputs(GT_RecipeMapUtil.appendArray(builder.getItemInputsBasic(), input)) + .addTo(GT_Recipe_Map.sAssemblerRecipes)); } return ret; }); @@ -265,20 +253,18 @@ public class GT_RecipeConstants { */ public static IGT_RecipeMap Fuel = IGT_RecipeMap.newRecipeMap(builder -> { builder.validateInputCount(1, 1) - .validateNoInputFluid() - .validateOutputCount(-1, 0) - .validateNoOutputFluid(); + .validateNoInputFluid() + .validateOutputCount(-1, 0) + .validateNoOutputFluid(); if (!builder.isValid()) return Collections.emptyList(); int fuelType = builder.getMetadata(FUEL_TYPE); builder.metadata( - FUEL_VALUE, - GregTech_API.sRecipeFile.get( - "fuel_" + fuelType, - builder.getItemInputBasic(0), - builder.getMetadata(FUEL_VALUE))); + FUEL_VALUE, + GregTech_API.sRecipeFile + .get("fuel_" + fuelType, builder.getItemInputBasic(0), builder.getMetadata(FUEL_VALUE))); return FuelType.get(fuelType) - .getTarget() - .doAdd(builder); + .getTarget() + .doAdd(builder); }); public enum FuelType { diff --git a/src/main/java/gregtech/api/util/GT_RecipeMapUtil.java b/src/main/java/gregtech/api/util/GT_RecipeMapUtil.java index ee524c913c..4f7f2e199b 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeMapUtil.java +++ b/src/main/java/gregtech/api/util/GT_RecipeMapUtil.java @@ -31,31 +31,31 @@ public class GT_RecipeMapUtil { }; public static final Function<GT_Recipe, String> FIRST_FLUID_INPUT = r -> isArrayEmptyOrNull(r.mFluidInputs) ? null - : r.mFluidInputs[0].getFluid() - .getName(); + : r.mFluidInputs[0].getFluid() + .getName(); public static final Function<GT_Recipe, String> FIRST_FLUID_OUTPUT = r -> isArrayEmptyOrNull(r.mFluidInputs) ? null - : r.mFluidOutputs[0].getFluid() - .getName(); + : r.mFluidOutputs[0].getFluid() + .getName(); public static final Function<GT_Recipe, String> FIRST_FLUIDSTACK_INPUT = r -> isArrayEmptyOrNull(r.mFluidInputs) - ? null - : r.mFluidInputs[0].getUnlocalizedName(); + ? null + : r.mFluidInputs[0].getUnlocalizedName(); public static final Function<GT_Recipe, String> FIRST_FLUIDSTACK_OUTPUT = r -> isArrayEmptyOrNull(r.mFluidOutputs) - ? null - : r.mFluidOutputs[0].getUnlocalizedName(); + ? null + : r.mFluidOutputs[0].getUnlocalizedName(); public static final Function<GT_Recipe, String> FIRST_ITEM_INPUT = r -> isArrayEmptyOrNull(r.mInputs) ? null - : getStackConfigName(r.mInputs[0]); + : getStackConfigName(r.mInputs[0]); public static final Function<GT_Recipe, String> FIRST_ITEM_OUTPUT = r -> isArrayEmptyOrNull(r.mOutputs) ? null - : getStackConfigName(r.mOutputs[0]); + : getStackConfigName(r.mOutputs[0]); public static final Function<GT_Recipe, String> FIRST_ITEM_OR_FLUID_INPUT = r -> isArrayEmptyOrNull(r.mInputs) - ? isArrayEmptyOrNull(r.mFluidInputs) ? null - : r.mFluidInputs[0].getFluid() - .getName() - : getStackConfigName(r.mInputs[0]); + ? isArrayEmptyOrNull(r.mFluidInputs) ? null + : r.mFluidInputs[0].getFluid() + .getName() + : getStackConfigName(r.mInputs[0]); public static final Function<GT_Recipe, String> FIRST_ITEM_OR_FLUID_OUTPUT = r -> isArrayEmptyOrNull(r.mOutputs) - ? isArrayEmptyOrNull(r.mFluidOutputs) ? null - : r.mFluidOutputs[0].getFluid() - .getName() - : getStackConfigName(r.mOutputs[0]); + ? isArrayEmptyOrNull(r.mFluidOutputs) ? null + : r.mFluidOutputs[0].getFluid() + .getName() + : getStackConfigName(r.mOutputs[0]); private static final Map<String, IGT_RecipeMap> addonRecipeMaps = new HashMap<>(); private static final Multimap<String, Consumer<IGT_RecipeMap>> delayedActions = ArrayListMultimap.create(); @@ -93,17 +93,17 @@ public class GT_RecipeMapUtil { cellToFluid(itemInputs, fluidInputs, removeIntegratedCircuit, null); cellToFluid(itemOutputs, fluidOutputs, removeIntegratedCircuit, chances); return b.itemInputs(itemInputs.toArray(new ItemStack[0])) - .itemOutputs(itemOutputs.toArray(new ItemStack[0]), chances != null ? chances.toArray() : null) - .fluidInputs(fluidInputs.toArray(new FluidStack[0])) - .fluidOutputs(fluidOutputs.toArray(new FluidStack[0])); + .itemOutputs(itemOutputs.toArray(new ItemStack[0]), chances != null ? chances.toArray() : null) + .fluidInputs(fluidInputs.toArray(new FluidStack[0])) + .fluidOutputs(fluidOutputs.toArray(new FluidStack[0])); } private static void cellToFluid(List<ItemStack> items, List<FluidStack> fluids, boolean removeIntegratedCircuit, - TIntList chances) { + TIntList chances) { for (int i = items.size() - 1; i >= 0; i--) { ItemStack item = items.get(i); if (GT_Utility.getFluidForFilledItem(item, true) != null || GT_Utility.isCellEmpty(item) - || (removeIntegratedCircuit && GT_Utility.isAnyIntegratedCircuit(item))) { + || (removeIntegratedCircuit && GT_Utility.isAnyIntegratedCircuit(item))) { fluids.add(GT_Utility.convertCellToFluid(item)); items.remove(i); if (chances != null) chances.removeAt(i); @@ -113,8 +113,8 @@ public class GT_RecipeMapUtil { public static List<GT_Recipe> buildOrEmpty(GT_RecipeBuilder builder) { return builder.build() - .map(Collections::singletonList) - .orElse(Collections.emptyList()); + .map(Collections::singletonList) + .orElse(Collections.emptyList()); } /** @@ -128,12 +128,12 @@ public class GT_RecipeMapUtil { * end up with a bunch of weird concurrency bugs. */ public static void registerRecipeMap(String identifier, IGT_RecipeMap recipeMap, - RecipeMapDependency... dependencies) { + RecipeMapDependency... dependencies) { String modId = Loader.instance() - .activeModContainer() - .getModId(); + .activeModContainer() + .getModId(); if (GregTech.ID.equals(modId)) throw new IllegalStateException( - "do not register recipe map under the name of gregtech! do it in your own preinit!"); + "do not register recipe map under the name of gregtech! do it in your own preinit!"); String id = modId + "@" + identifier; addonRecipeMaps.put(id, recipeMap); for (Consumer<IGT_RecipeMap> action : delayedActions.get(id)) { diff --git a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java index 2c08e461b7..a9e8f5cc09 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java +++ b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java @@ -45,84 +45,83 @@ public class GT_RecipeRegistrator { private static final ItemStack sMt1 = new ItemStack(Blocks.dirt, 1, 0), sMt2 = new ItemStack(Blocks.dirt, 1, 0); private static final String s_H = "h", s_F = "f", s_I = "I", s_P = "P", s_R = "R"; private static final RecipeShape[] sShapes = new RecipeShape[] { - new RecipeShape(sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null), - new RecipeShape(sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1), - new RecipeShape(null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1), - new RecipeShape(sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null), - new RecipeShape(sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1), - new RecipeShape(sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1), - new RecipeShape(null, null, null, sMt1, null, sMt1, sMt1, null, sMt1), - new RecipeShape(null, sMt1, null, null, sMt1, null, null, sMt2, null), - new RecipeShape(sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null), - new RecipeShape(null, sMt1, null, null, sMt2, null, null, sMt2, null), - new RecipeShape(sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null), - new RecipeShape(null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null), - new RecipeShape(sMt1, sMt1, null, null, sMt2, null, null, sMt2, null), - new RecipeShape(null, sMt1, sMt1, null, sMt2, null, null, sMt2, null), - new RecipeShape(null, sMt1, null, sMt1, null, null, null, sMt1, sMt2), - new RecipeShape(null, sMt1, null, null, null, sMt1, sMt2, sMt1, null), - new RecipeShape(null, sMt1, null, sMt1, null, sMt1, null, null, sMt2), - new RecipeShape(null, sMt1, null, sMt1, null, sMt1, sMt2, null, null), - new RecipeShape(null, sMt2, null, null, sMt1, null, null, sMt1, null), - new RecipeShape(null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1), - new RecipeShape(null, sMt2, null, null, sMt2, null, null, sMt1, null), - new RecipeShape(null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null), - new RecipeShape(null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1), - new RecipeShape(null, sMt2, null, null, sMt2, null, sMt1, sMt1, null), - new RecipeShape(sMt1, null, null, null, sMt2, null, null, null, sMt2), - new RecipeShape(null, null, sMt1, null, sMt2, null, sMt2, null, null), - new RecipeShape(sMt1, null, null, null, sMt2, null, null, null, null), - new RecipeShape(null, null, sMt1, null, sMt2, null, null, null, null), - new RecipeShape(sMt1, sMt2, null, null, null, null, null, null, null), - new RecipeShape(sMt2, sMt1, null, null, null, null, null, null, null), - new RecipeShape(sMt1, null, null, sMt2, null, null, null, null, null), - new RecipeShape(sMt2, null, null, sMt1, null, null, null, null, null), - new RecipeShape(sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null), - new RecipeShape(sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null), - new RecipeShape(null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1), - new RecipeShape(null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1), - new RecipeShape(sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null), - new RecipeShape(sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null), - new RecipeShape(null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1), - new RecipeShape(null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1), - new RecipeShape(sMt1, null, null, null, sMt1, null, null, null, null), - new RecipeShape(null, sMt1, null, sMt1, null, null, null, null, null), - new RecipeShape(sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null), - new RecipeShape(null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2) }; + new RecipeShape(sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null), + new RecipeShape(sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1), + new RecipeShape(null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1), + new RecipeShape(sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null), + new RecipeShape(sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1), + new RecipeShape(sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1), + new RecipeShape(null, null, null, sMt1, null, sMt1, sMt1, null, sMt1), + new RecipeShape(null, sMt1, null, null, sMt1, null, null, sMt2, null), + new RecipeShape(sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null), + new RecipeShape(null, sMt1, null, null, sMt2, null, null, sMt2, null), + new RecipeShape(sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null), + new RecipeShape(null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null), + new RecipeShape(sMt1, sMt1, null, null, sMt2, null, null, sMt2, null), + new RecipeShape(null, sMt1, sMt1, null, sMt2, null, null, sMt2, null), + new RecipeShape(null, sMt1, null, sMt1, null, null, null, sMt1, sMt2), + new RecipeShape(null, sMt1, null, null, null, sMt1, sMt2, sMt1, null), + new RecipeShape(null, sMt1, null, sMt1, null, sMt1, null, null, sMt2), + new RecipeShape(null, sMt1, null, sMt1, null, sMt1, sMt2, null, null), + new RecipeShape(null, sMt2, null, null, sMt1, null, null, sMt1, null), + new RecipeShape(null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1), + new RecipeShape(null, sMt2, null, null, sMt2, null, null, sMt1, null), + new RecipeShape(null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null), + new RecipeShape(null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1), + new RecipeShape(null, sMt2, null, null, sMt2, null, sMt1, sMt1, null), + new RecipeShape(sMt1, null, null, null, sMt2, null, null, null, sMt2), + new RecipeShape(null, null, sMt1, null, sMt2, null, sMt2, null, null), + new RecipeShape(sMt1, null, null, null, sMt2, null, null, null, null), + new RecipeShape(null, null, sMt1, null, sMt2, null, null, null, null), + new RecipeShape(sMt1, sMt2, null, null, null, null, null, null, null), + new RecipeShape(sMt2, sMt1, null, null, null, null, null, null, null), + new RecipeShape(sMt1, null, null, sMt2, null, null, null, null, null), + new RecipeShape(sMt2, null, null, sMt1, null, null, null, null, null), + new RecipeShape(sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null), + new RecipeShape(sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null), + new RecipeShape(null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1), + new RecipeShape(null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1), + new RecipeShape(sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null), + new RecipeShape(sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null), + new RecipeShape(null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1), + new RecipeShape(null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1), + new RecipeShape(sMt1, null, null, null, sMt1, null, null, null, null), + new RecipeShape(null, sMt1, null, sMt1, null, null, null, null, null), + new RecipeShape(sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null), + new RecipeShape(null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2) }; public static final Field SHAPED_ORE_RECIPE_WIDTH = ReflectionHelper.findField(ShapedOreRecipe.class, "width"); public static final Field SHAPED_ORE_RECIPE_HEIGHT = ReflectionHelper.findField(ShapedOreRecipe.class, "height"); private static volatile Map<RecipeShape, List<IRecipe>> indexedRecipeListCache; private static final String[][] sShapesA = new String[][] { null, null, null, - { "Helmet", s_P + s_P + s_P, s_P + s_H + s_P }, - { "ChestPlate", s_P + s_H + s_P, s_P + s_P + s_P, s_P + s_P + s_P }, - { "Pants", s_P + s_P + s_P, s_P + s_H + s_P, s_P + " " + s_P }, - { "Boots", s_P + " " + s_P, s_P + s_H + s_P }, - { "Sword", " " + s_P + " ", s_F + s_P + s_H, " " + s_R + " " }, - { "Pickaxe", s_P + s_I + s_I, s_F + s_R + s_H, " " + s_R + " " }, - { "Shovel", s_F + s_P + s_H, " " + s_R + " ", " " + s_R + " " }, - { "Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " " }, - { "Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " " }, - { "Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " " }, - { "Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " " }, - { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, - { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, - { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, - { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, - { "Sword", " " + s_R + " ", s_F + s_P + s_H, " " + s_P + " " }, - { "Pickaxe", " " + s_R + " ", s_F + s_R + s_H, s_P + s_I + s_I }, - { "Shovel", " " + s_R + " ", " " + s_R + " ", s_F + s_P + s_H }, - { "Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H }, - { "Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H }, - { "Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H }, - { "Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H }, - { "Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R }, - { "Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R }, { "Knive", s_H + s_P, s_R + s_F }, - { "Knive", s_F + s_H, s_P + s_R }, { "Knive", s_F + s_H, s_P + s_R }, { "Knive", s_P + s_F, s_R + s_H }, - { "Knive", s_P + s_F, s_R + s_H }, null, null, null, null, - { "WarAxe", s_P + s_P + s_P, s_P + s_R + s_P, s_F + s_R + s_H }, null, null, null, - { "Shears", s_H + s_P, s_P + s_F }, { "Shears", s_H + s_P, s_P + s_F }, - { "Scythe", s_I + s_P + s_H, s_R + s_F + s_P, s_R + " " + " " }, - { "Scythe", s_H + s_P + s_I, s_P + s_F + s_R, " " + " " + s_R } }; + { "Helmet", s_P + s_P + s_P, s_P + s_H + s_P }, + { "ChestPlate", s_P + s_H + s_P, s_P + s_P + s_P, s_P + s_P + s_P }, + { "Pants", s_P + s_P + s_P, s_P + s_H + s_P, s_P + " " + s_P }, { "Boots", s_P + " " + s_P, s_P + s_H + s_P }, + { "Sword", " " + s_P + " ", s_F + s_P + s_H, " " + s_R + " " }, + { "Pickaxe", s_P + s_I + s_I, s_F + s_R + s_H, " " + s_R + " " }, + { "Shovel", s_F + s_P + s_H, " " + s_R + " ", " " + s_R + " " }, + { "Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " " }, + { "Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " " }, + { "Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " " }, + { "Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " " }, + { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, + { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, + { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, + { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, + { "Sword", " " + s_R + " ", s_F + s_P + s_H, " " + s_P + " " }, + { "Pickaxe", " " + s_R + " ", s_F + s_R + s_H, s_P + s_I + s_I }, + { "Shovel", " " + s_R + " ", " " + s_R + " ", s_F + s_P + s_H }, + { "Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H }, + { "Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H }, + { "Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H }, + { "Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H }, + { "Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R }, + { "Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R }, { "Knive", s_H + s_P, s_R + s_F }, + { "Knive", s_F + s_H, s_P + s_R }, { "Knive", s_F + s_H, s_P + s_R }, { "Knive", s_P + s_F, s_R + s_H }, + { "Knive", s_P + s_F, s_R + s_H }, null, null, null, null, + { "WarAxe", s_P + s_P + s_P, s_P + s_R + s_P, s_F + s_R + s_H }, null, null, null, + { "Shears", s_H + s_P, s_P + s_F }, { "Shears", s_H + s_P, s_P + s_F }, + { "Scythe", s_I + s_P + s_H, s_R + s_F + s_P, s_R + " " + " " }, + { "Scythe", s_H + s_P + s_I, s_P + s_F + s_R, " " + " " + s_R } }; public static volatile int VERSION = 509; static { @@ -131,37 +130,36 @@ public class GT_RecipeRegistrator { } public static void registerMaterialRecycling(ItemStack aStack, Materials aMaterial, long aMaterialAmount, - MaterialStack aByproduct) { + MaterialStack aByproduct) { if (GT_Utility.isStackInvalid(aStack)) return; if (aByproduct != null) { aByproduct = aByproduct.clone(); aByproduct.mAmount /= aStack.stackSize; } GT_OreDictUnificator.addItemData( - GT_Utility.copyAmount(1, aStack), - new ItemData(aMaterial, aMaterialAmount / aStack.stackSize, aByproduct)); + GT_Utility.copyAmount(1, aStack), + new ItemData(aMaterial, aMaterialAmount / aStack.stackSize, aByproduct)); } public static void registerMaterialRecycling(ItemStack aStack, ItemData aData) { if (GT_Utility.isStackInvalid(aStack) || GT_Utility.areStacksEqual(new ItemStack(Items.blaze_rod), aStack) - || aData == null - || !aData.hasValidMaterialData() - || !aData.mMaterial.mMaterial.mAutoGenerateRecycleRecipes - || aData.mMaterial.mAmount <= 0 - || GT_Utility.getFluidForFilledItem(aStack, false) != null - || aData.mMaterial.mMaterial.mSubTags.contains(SubTag.NO_RECIPES)) - return; + || aData == null + || !aData.hasValidMaterialData() + || !aData.mMaterial.mMaterial.mAutoGenerateRecycleRecipes + || aData.mMaterial.mAmount <= 0 + || GT_Utility.getFluidForFilledItem(aStack, false) != null + || aData.mMaterial.mMaterial.mSubTags.contains(SubTag.NO_RECIPES)) return; registerReverseMacerating(GT_Utility.copyAmount(1, aStack), aData, aData.mPrefix == null); registerReverseSmelting( - GT_Utility.copyAmount(1, aStack), - aData.mMaterial.mMaterial, - aData.mMaterial.mAmount, - true); + GT_Utility.copyAmount(1, aStack), + aData.mMaterial.mMaterial, + aData.mMaterial.mAmount, + true); registerReverseFluidSmelting( - GT_Utility.copyAmount(1, aStack), - aData.mMaterial.mMaterial, - aData.mMaterial.mAmount, - aData.getByProduct(0)); + GT_Utility.copyAmount(1, aStack), + aData.mMaterial.mMaterial, + aData.mMaterial.mAmount, + aData.getByProduct(0)); registerReverseArcSmelting(GT_Utility.copyAmount(1, aStack), aData); } @@ -171,20 +169,18 @@ public class GT_RecipeRegistrator { * @param aMaterialAmount the amount of it in Material Units. */ public static void registerReverseFluidSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount, - MaterialStack aByproduct) { + MaterialStack aByproduct) { if (aStack == null || aMaterial == null - || aMaterial.mSmeltInto.mStandardMoltenFluid == null - || !aMaterial.contains(SubTag.SMELTING_TO_FLUID) - || (L * aMaterialAmount) / (M * aStack.stackSize) <= 0) - return; + || aMaterial.mSmeltInto.mStandardMoltenFluid == null + || !aMaterial.contains(SubTag.SMELTING_TO_FLUID) + || (L * aMaterialAmount) / (M * aStack.stackSize) <= 0) return; ItemData tData = GT_OreDictUnificator.getItemData(aStack); boolean tHide = aStack.getUnlocalizedName() - .startsWith("gt.blockmachines") - && (GT_Mod.gregtechproxy.mHideRecyclingRecipes); + .startsWith("gt.blockmachines") && (GT_Mod.gregtechproxy.mHideRecyclingRecipes); if (GT_Mod.gregtechproxy.mHideRecyclingRecipes && tData != null - && tData.hasValidPrefixData() - && !(tData.mPrefix == OrePrefixes.dust || tData.mPrefix == OrePrefixes.ingot - || tData.mPrefix == OrePrefixes.block | tData.mPrefix == OrePrefixes.plate)) { + && tData.hasValidPrefixData() + && !(tData.mPrefix == OrePrefixes.dust || tData.mPrefix == OrePrefixes.ingot + || tData.mPrefix == OrePrefixes.block | tData.mPrefix == OrePrefixes.plate)) { tHide = true; } // boolean tHide = (aMaterial != Materials.Iron && aMaterial!= @@ -193,29 +189,23 @@ public class GT_RecipeRegistrator { // tHide=false; // } RA.addFluidSmelterRecipe( - GT_Utility.copyAmount(1, aStack), - aByproduct == null - || (tData != null && tData.hasValidPrefixData() && tData.mPrefix == OrePrefixes.toolHeadDrill) - ? null - : aByproduct.mMaterial.contains(SubTag.NO_SMELTING) - || !aByproduct.mMaterial.contains(SubTag.METAL) - ? aByproduct.mMaterial.contains(SubTag.FLAMMABLE) - ? GT_OreDictUnificator.getDust( - Materials.Ash, - aByproduct.mAmount / 2) - : aByproduct.mMaterial.contains(SubTag.UNBURNABLE) - ? GT_OreDictUnificator.getDustOrIngot( - aByproduct.mMaterial.mSmeltInto, - aByproduct.mAmount) - : null - : GT_OreDictUnificator.getIngotOrDust( - aByproduct.mMaterial.mSmeltInto, - aByproduct.mAmount), - aMaterial.mSmeltInto.getMolten((L * aMaterialAmount) / (M * aStack.stackSize)), - 10000, - (int) Math.max(1, (24 * aMaterialAmount) / M), - Math.max(8, (int) Math.sqrt(2 * aMaterial.mSmeltInto.mStandardMoltenFluid.getTemperature())), - tHide); + GT_Utility.copyAmount(1, aStack), + aByproduct == null + || (tData != null && tData.hasValidPrefixData() && tData.mPrefix == OrePrefixes.toolHeadDrill) + ? null + : aByproduct.mMaterial.contains(SubTag.NO_SMELTING) || !aByproduct.mMaterial.contains(SubTag.METAL) + ? aByproduct.mMaterial.contains(SubTag.FLAMMABLE) + ? GT_OreDictUnificator.getDust(Materials.Ash, aByproduct.mAmount / 2) + : aByproduct.mMaterial.contains(SubTag.UNBURNABLE) + ? GT_OreDictUnificator + .getDustOrIngot(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount) + : null + : GT_OreDictUnificator.getIngotOrDust(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount), + aMaterial.mSmeltInto.getMolten((L * aMaterialAmount) / (M * aStack.stackSize)), + 10000, + (int) Math.max(1, (24 * aMaterialAmount) / M), + Math.max(8, (int) Math.sqrt(2 * aMaterial.mSmeltInto.mStandardMoltenFluid.getTemperature())), + tHide); } /** @@ -225,36 +215,35 @@ public class GT_RecipeRegistrator { * @param aAllowAlloySmelter if it is allowed to be recycled inside the Alloy Smelter. */ public static void registerReverseSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount, - boolean aAllowAlloySmelter) { + boolean aAllowAlloySmelter) { if (aStack == null || aMaterial == null - || aMaterialAmount <= 0 - || aMaterial.contains(SubTag.NO_SMELTING) - || (aMaterialAmount > M && aMaterial.contains(SubTag.METAL)) - || (aMaterial.getProcessingMaterialTierEU() > TierEU.IV)) - return; + || aMaterialAmount <= 0 + || aMaterial.contains(SubTag.NO_SMELTING) + || (aMaterialAmount > M && aMaterial.contains(SubTag.METAL)) + || (aMaterial.getProcessingMaterialTierEU() > TierEU.IV)) return; if (aMaterial == Materials.Naquadah || aMaterial == Materials.NaquadahEnriched) return; aMaterialAmount /= aStack.stackSize; boolean tHide = (aMaterial != Materials.Iron) && (GT_Mod.gregtechproxy.mHideRecyclingRecipes); if (aAllowAlloySmelter) GT_ModHandler.addSmeltingAndAlloySmeltingRecipe( - GT_Utility.copyAmount(1, aStack), - GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount), - tHide); + GT_Utility.copyAmount(1, aStack), + GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount), + tHide); else GT_ModHandler.addSmeltingRecipe( - GT_Utility.copyAmount(1, aStack), - GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount)); + GT_Utility.copyAmount(1, aStack), + GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount)); } public static void registerReverseArcSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount, - MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03) { + MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03) { registerReverseArcSmelting( - aStack, - new ItemData( - aMaterial == null ? null : new MaterialStack(aMaterial, aMaterialAmount), - aByProduct01, - aByProduct02, - aByProduct03)); + aStack, + new ItemData( + aMaterial == null ? null : new MaterialStack(aMaterial, aMaterialAmount), + aByProduct01, + aByProduct02, + aByProduct03)); } public static void registerReverseArcSmelting(ItemStack aStack, ItemData aData) { @@ -266,9 +255,8 @@ public class GT_RecipeRegistrator { for (MaterialStack tMaterial : aData.getAllMaterialStacks()) { if (tMaterial.mMaterial == Materials.Iron || tMaterial.mMaterial == Materials.Copper - || tMaterial.mMaterial == Materials.WroughtIron - || tMaterial.mMaterial == Materials.AnnealedCopper) - tIron = true; + || tMaterial.mMaterial == Materials.WroughtIron + || tMaterial.mMaterial == Materials.AnnealedCopper) tIron = true; if (tMaterial.mMaterial.contains(SubTag.UNBURNABLE)) { tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto; @@ -315,41 +303,41 @@ public class GT_RecipeRegistrator { boolean tHide = !tIron && GT_Mod.gregtechproxy.mHideRecyclingRecipes; if (aData.mPrefix == OrePrefixes.toolHeadDrill) { RA.addArcFurnaceRecipe( - aStack, - new ItemStack[] { GT_OreDictUnificator.getIngotOrDust(aData.mMaterial) }, - null, - 90, - (int) Math.max(16, tAmount / M), - tHide); + aStack, + new ItemStack[] { GT_OreDictUnificator.getIngotOrDust(aData.mMaterial) }, + null, + 90, + (int) Math.max(16, tAmount / M), + tHide); } else { RA.addArcFurnaceRecipe( - aStack, - new ItemStack[] { GT_OreDictUnificator.getIngotOrDust(aData.mMaterial), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(0)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(1)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(2)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(3)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(5)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(6)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(7)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(8)) }, - null, - (int) Math.max(16, tAmount / M), - 90, - tHide); + aStack, + new ItemStack[] { GT_OreDictUnificator.getIngotOrDust(aData.mMaterial), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(0)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(1)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(2)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(3)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(5)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(6)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(7)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(8)) }, + null, + (int) Math.max(16, tAmount / M), + 90, + tHide); } } public static void registerReverseMacerating(ItemStack aStack, Materials aMaterial, long aMaterialAmount, - MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03, boolean aAllowHammer) { + MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03, boolean aAllowHammer) { registerReverseMacerating( - aStack, - new ItemData( - aMaterial == null ? null : new MaterialStack(aMaterial, aMaterialAmount), - aByProduct01, - aByProduct02, - aByProduct03), - aAllowHammer); + aStack, + new ItemData( + aMaterial == null ? null : new MaterialStack(aMaterial, aMaterialAmount), + aByProduct01, + aByProduct02, + aByProduct03), + aAllowHammer); } public static void registerReverseMacerating(ItemStack aStack, ItemData aData, boolean aAllowHammer) { @@ -371,42 +359,41 @@ public class GT_RecipeRegistrator { boolean tHide = (aData.mMaterial.mMaterial != Materials.Iron) && (GT_Mod.gregtechproxy.mHideRecyclingRecipes); if (aData.mPrefix == OrePrefixes.toolHeadDrill) { RA.addPulveriserRecipe( - aStack, - new ItemStack[] { GT_OreDictUnificator.getDust(aData.mMaterial) }, - null, - aData.mMaterial.mMaterial == Materials.Marble ? 1 : (int) Math.max(16, tAmount / M), - 4, - tHide); + aStack, + new ItemStack[] { GT_OreDictUnificator.getDust(aData.mMaterial) }, + null, + aData.mMaterial.mMaterial == Materials.Marble ? 1 : (int) Math.max(16, tAmount / M), + 4, + tHide); } else { RA.addPulveriserRecipe( - aStack, - new ItemStack[] { GT_OreDictUnificator.getDust(aData.mMaterial), - GT_OreDictUnificator.getDust(aData.getByProduct(0)), - GT_OreDictUnificator.getDust(aData.getByProduct(1)), - GT_OreDictUnificator.getDust(aData.getByProduct(2)) }, - null, - aData.mMaterial.mMaterial == Materials.Marble ? 1 : (int) Math.max(16, tAmount / M), - 4, - tHide); + aStack, + new ItemStack[] { GT_OreDictUnificator.getDust(aData.mMaterial), + GT_OreDictUnificator.getDust(aData.getByProduct(0)), + GT_OreDictUnificator.getDust(aData.getByProduct(1)), + GT_OreDictUnificator.getDust(aData.getByProduct(2)) }, + null, + aData.mMaterial.mMaterial == Materials.Marble ? 1 : (int) Math.max(16, tAmount / M), + 4, + tHide); } if (aAllowHammer) for (MaterialStack tMaterial : aData.getAllMaterialStacks()) if (tMaterial.mMaterial.contains(SubTag.CRYSTAL) && !tMaterial.mMaterial.contains(SubTag.METAL) - && tMaterial.mMaterial != Materials.Glass) { - if (RA.addForgeHammerRecipe( - GT_Utility.copyAmount(1, aStack), - GT_OreDictUnificator.getDust(aData.mMaterial), - 200, - 30)) - break; - } + && tMaterial.mMaterial != Materials.Glass) { + if (RA.addForgeHammerRecipe( + GT_Utility.copyAmount(1, aStack), + GT_OreDictUnificator.getDust(aData.mMaterial), + 200, + 30)) break; + } } /** * Place Materials which you want to replace in Non-GT-Recipes here (warning HUGHE impact on loading times!) */ private static final Materials[] VANILLA_MATS = { Cobalt, Gold, Iron, Lead, FierySteel, Void, Bronze, Diamond, Ruby, - Sapphire, Steel, IronWood, Steeleaf, Knightmetal, Thaumium, DarkSteel, }; + Sapphire, Steel, IronWood, Steeleaf, Knightmetal, Thaumium, DarkSteel, }; /** * You give this Function a Material and it will scan almost everything for adding recycling Recipes and replacing @@ -417,7 +404,7 @@ public class GT_RecipeRegistrator { * @param aRecipeReplacing allows to replace the Recipe with a Plate variant */ public static synchronized void registerUsagesForMaterials(String aPlate, boolean aRecipeReplacing, - ItemStack... aMats) { + ItemStack... aMats) { for (ItemStack aMat : aMats) { aMat = GT_Utility.copyOrNull(aMat); @@ -439,10 +426,8 @@ public class GT_RecipeRegistrator { for (RecipeShape tRecipe : sShapes) { for (ItemStack tCrafted : GT_ModHandler.getRecipeOutputsBuffered(tRecipe.shape)) { GT_OreDictUnificator.addItemData( - tCrafted, - new ItemData( - aItemData.mMaterial.mMaterial, - aItemData.mMaterial.mAmount * tRecipe.amount1)); + tCrafted, + new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tRecipe.amount1)); // // GT_Log.out.println("###################################################################################"); // GT_Log.out.println("registerUsagesForMaterials used aPlate: "+aPlate); @@ -475,7 +460,7 @@ public class GT_RecipeRegistrator { Map<RecipeShape, List<IRecipe>> result = new IdentityHashMap<>(); @SuppressWarnings("unchecked") ArrayList<IRecipe> allRecipeList = (ArrayList<IRecipe>) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); // filter using the empty slots in the shape. // if the empty slots doesn't match, the recipe will definitely fail SetMultimap<List<Integer>, RecipeShape> filter = HashMultimap.create(); @@ -493,33 +478,33 @@ public class GT_RecipeRegistrator { buffer.clear(); ItemStack tStack = tRecipe.getRecipeOutput(); if (GT_Utility.isStackValid(tStack) && tStack.getMaxStackSize() == 1 - && tStack.getMaxDamage() > 0 - && !(tStack.getItem() instanceof ItemBlock) - && !(tStack.getItem() instanceof IReactorComponent) - && !GT_ModHandler.isElectricItem(tStack) - && !GT_Utility.isStackInList(tStack, GT_ModHandler.sNonReplaceableItems)) { + && tStack.getMaxDamage() > 0 + && !(tStack.getItem() instanceof ItemBlock) + && !(tStack.getItem() instanceof IReactorComponent) + && !GT_ModHandler.isElectricItem(tStack) + && !GT_Utility.isStackInList(tStack, GT_ModHandler.sNonReplaceableItems)) { if (tRecipe instanceof ShapedOreRecipe) { ShapedOreRecipe tShapedRecipe = (ShapedOreRecipe) tRecipe; if (checkRecipeShape( - buffer, - tShapedRecipe.getInput(), - getRecipeWidth(tShapedRecipe), - getRecipeHeight(tShapedRecipe))) { + buffer, + tShapedRecipe.getInput(), + getRecipeWidth(tShapedRecipe), + getRecipeHeight(tShapedRecipe))) { for (RecipeShape s : filter.get(buffer)) { result.computeIfAbsent(s, k -> new ArrayList<>()) - .add(tRecipe); + .add(tRecipe); } } } else if (tRecipe instanceof ShapedRecipes) { ShapedRecipes tShapedRecipe = (ShapedRecipes) tRecipe; if (checkRecipeShape( - buffer, - tShapedRecipe.recipeItems, - getRecipeWidth(tShapedRecipe), - getRecipeHeight(tShapedRecipe))) { + buffer, + tShapedRecipe.recipeItems, + getRecipeWidth(tShapedRecipe), + getRecipeHeight(tShapedRecipe))) { for (RecipeShape s : filter.get(buffer)) { result.computeIfAbsent(s, k -> new ArrayList<>()) - .add(tRecipe); + .add(tRecipe); } } } else { @@ -527,7 +512,7 @@ public class GT_RecipeRegistrator { // unknown recipe type. cannot determine empty slots. we choose to add to the recipe list for // all shapes result.computeIfAbsent(s, k -> new ArrayList<>()) - .add(tRecipe); + .add(tRecipe); } } } @@ -536,7 +521,7 @@ public class GT_RecipeRegistrator { } private static boolean checkRecipeShape(List<Integer> emptySlotIndexesBuffer, Object[] input, int tRecipeWidth, - int tRecipeHeight) { + int tRecipeHeight) { for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { if (x >= tRecipeWidth || y >= tRecipeHeight) { @@ -549,9 +534,9 @@ public class GT_RecipeRegistrator { continue; } if (tObject instanceof ItemStack - && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 - || ((ItemStack) tObject).getMaxDamage() > 0 - || ((ItemStack) tObject).getItem() instanceof ItemBlock)) { + && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 + || ((ItemStack) tObject).getMaxDamage() > 0 + || ((ItemStack) tObject).getItem() instanceof ItemBlock)) { return false; } if (tObject instanceof List && ((List<?>) tObject).isEmpty()) { @@ -574,45 +559,41 @@ public class GT_RecipeRegistrator { for (int i = 0; i < sShapes.length; i++) { RecipeShape tRecipe = sShapes[i]; - for (ItemStack tCrafted : GT_ModHandler.getRecipeOutputs( - getRecipeList(tRecipe), - true, - tRecipe.shape)) { + for (ItemStack tCrafted : GT_ModHandler + .getRecipeOutputs(getRecipeList(tRecipe), true, tRecipe.shape)) { if (aItemData != null && aItemData.hasValidPrefixMaterialData()) GT_OreDictUnificator.addItemData( - tCrafted, - new ItemData( - aItemData.mMaterial.mMaterial, - aItemData.mMaterial.mAmount * tRecipe.amount1, - new MaterialStack( - tMaterial, - OrePrefixes.stick.mMaterialAmount * tRecipe.amount2))); + tCrafted, + new ItemData( + aItemData.mMaterial.mMaterial, + aItemData.mMaterial.mAmount * tRecipe.amount1, + new MaterialStack(tMaterial, OrePrefixes.stick.mMaterialAmount * tRecipe.amount2))); if (aRecipeReplacing && aPlate != null && sShapesA[i] != null && sShapesA[i].length > 1) { assert aItemData != null; if (GregTech_API.sRecipeFile.get( - ConfigCategories.Recipes.recipereplacements, - aItemData.mMaterial.mMaterial + "." + sShapesA[i][0], - true)) { + ConfigCategories.Recipes.recipereplacements, + aItemData.mMaterial.mMaterial + "." + sShapesA[i][0], + true)) { if (null != (tStack = GT_ModHandler.removeRecipe(tRecipe.shape))) { switch (sShapesA[i].length) { case 2 -> GT_ModHandler.addCraftingRecipe( - tStack, - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { sShapesA[i][1], s_P.charAt(0), aPlate, s_R.charAt(0), - OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData }); + tStack, + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { sShapesA[i][1], s_P.charAt(0), aPlate, s_R.charAt(0), + OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData }); case 3 -> GT_ModHandler.addCraftingRecipe( - tStack, - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { sShapesA[i][1], sShapesA[i][2], s_P.charAt(0), aPlate, - s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), - aItemData }); + tStack, + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { sShapesA[i][1], sShapesA[i][2], s_P.charAt(0), aPlate, + s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), + aItemData }); default -> GT_ModHandler.addCraftingRecipe( - tStack, - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { sShapesA[i][1], sShapesA[i][2], sShapesA[i][3], - s_P.charAt(0), aPlate, s_R.charAt(0), - OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData }); + tStack, + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { sShapesA[i][1], sShapesA[i][2], sShapesA[i][3], + s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), + s_I.charAt(0), aItemData }); } } } @@ -633,12 +614,12 @@ public class GT_RecipeRegistrator { */ public static void registerWiremillRecipes(Materials aMaterial, int baseDuration, int aEUt) { registerWiremillRecipes( - aMaterial, - baseDuration, - calculateRecipeEU(aMaterial, aEUt), - OrePrefixes.ingot, - OrePrefixes.stick, - 2); + aMaterial, + baseDuration, + calculateRecipeEU(aMaterial, aEUt), + OrePrefixes.ingot, + OrePrefixes.stick, + 2); } /** @@ -652,96 +633,96 @@ public class GT_RecipeRegistrator { * @param multiplier amount of wires created from 1 ingot */ public static void registerWiremillRecipes(Materials aMaterial, int baseDuration, int aEUt, OrePrefixes prefix1, - OrePrefixes prefix2, int multiplier) { + OrePrefixes prefix2, int multiplier) { GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 1L), - GT_Utility.getIntegratedCircuit(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, multiplier), - baseDuration, - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 1L), + GT_Utility.getIntegratedCircuit(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, multiplier), + baseDuration, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 2L / multiplier), - GT_Utility.getIntegratedCircuit(2), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L), - (int) (baseDuration * 1.5f), - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 2L / multiplier), + GT_Utility.getIntegratedCircuit(2), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L), + (int) (baseDuration * 1.5f), + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 4L / multiplier), - GT_Utility.getIntegratedCircuit(4), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L), - baseDuration * 2, - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 4L / multiplier), + GT_Utility.getIntegratedCircuit(4), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L), + baseDuration * 2, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 8L / multiplier), - GT_Utility.getIntegratedCircuit(8), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L), - (int) (baseDuration * 2.5f), - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 8L / multiplier), + GT_Utility.getIntegratedCircuit(8), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L), + (int) (baseDuration * 2.5f), + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 12L / multiplier), - GT_Utility.getIntegratedCircuit(12), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L), - baseDuration * 3, - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 12L / multiplier), + GT_Utility.getIntegratedCircuit(12), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L), + baseDuration * 3, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 16L / multiplier), - GT_Utility.getIntegratedCircuit(16), - GT_OreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L), - (int) (baseDuration * 3.5f), - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 16L / multiplier), + GT_Utility.getIntegratedCircuit(16), + GT_OreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L), + (int) (baseDuration * 3.5f), + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 2L / multiplier), - GT_Utility.getIntegratedCircuit(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L), - baseDuration / 2, - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 2L / multiplier), + GT_Utility.getIntegratedCircuit(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L), + baseDuration / 2, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 4L / multiplier), - GT_Utility.getIntegratedCircuit(2), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L), - baseDuration, - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 4L / multiplier), + GT_Utility.getIntegratedCircuit(2), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L), + baseDuration, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 8L / multiplier), - GT_Utility.getIntegratedCircuit(4), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L), - (int) (baseDuration * 1.5f), - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 8L / multiplier), + GT_Utility.getIntegratedCircuit(4), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L), + (int) (baseDuration * 1.5f), + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 16L / multiplier), - GT_Utility.getIntegratedCircuit(8), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L), - baseDuration * 2, - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 16L / multiplier), + GT_Utility.getIntegratedCircuit(8), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L), + baseDuration * 2, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 24L / multiplier), - GT_Utility.getIntegratedCircuit(12), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L), - (int) (baseDuration * 2.5f), - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 24L / multiplier), + GT_Utility.getIntegratedCircuit(12), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L), + (int) (baseDuration * 2.5f), + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 32L / multiplier), - GT_Utility.getIntegratedCircuit(16), - GT_OreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L), - baseDuration * 3, - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 32L / multiplier), + GT_Utility.getIntegratedCircuit(16), + GT_OreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L), + baseDuration * 3, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 1L), - GT_Utility.getIntegratedCircuit(3), - GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 4L * multiplier), - baseDuration, - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 1L), + GT_Utility.getIntegratedCircuit(3), + GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 4L * multiplier), + baseDuration, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 1L), - GT_Utility.getIntegratedCircuit(3), - GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 2L * multiplier), - baseDuration / 2, - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 1L), + GT_Utility.getIntegratedCircuit(3), + GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 2L * multiplier), + baseDuration / 2, + aEUt); } public static boolean hasVanillaRecipes(Materials materials) { return Arrays.stream(VANILLA_MATS) - .anyMatch(mat -> mat == materials); + .anyMatch(mat -> mat == materials); } private static int getRecipeWidth(ShapedOreRecipe r) { diff --git a/src/main/java/gregtech/api/util/GT_RenderingWorld.java b/src/main/java/gregtech/api/util/GT_RenderingWorld.java index 4ada7decab..7220b921a5 100644 --- a/src/main/java/gregtech/api/util/GT_RenderingWorld.java +++ b/src/main/java/gregtech/api/util/GT_RenderingWorld.java @@ -61,7 +61,7 @@ public class GT_RenderingWorld implements IBlockAccess { ChunkPosition key = new ChunkPosition(x, y, z); infos.put(key, new BlockInfo(block, meta)); index.computeIfAbsent(new ChunkCoordIntPair(x >> 4, z >> 4), p -> new HashSet<>()) - .add(key); + .add(key); } public void unregister(int x, int y, int z, Block block, int meta) { @@ -130,8 +130,8 @@ public class GT_RenderingWorld implements IBlockAccess { public FMLEventHandler() { FMLCommonHandler.instance() - .bus() - .register(this); + .bus() + .register(this); } @SubscribeEvent(priority = EventPriority.HIGHEST) @@ -150,10 +150,10 @@ public class GT_RenderingWorld implements IBlockAccess { public void onChunkUnloaded(ChunkEvent.Unload e) { if (!e.world.isRemote) return; Set<ChunkPosition> set = index.remove( - e.getChunk() - .getChunkCoordIntPair()); + e.getChunk() + .getChunkCoordIntPair()); if (set != null) infos.keySet() - .removeAll(set); + .removeAll(set); } @SubscribeEvent diff --git a/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java b/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java index 02bc0ba0bf..95a1a0bb66 100644 --- a/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java @@ -17,7 +17,7 @@ public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRec private final int[] mEnchantmentLevelsAdded; public GT_Shaped_Recipe(ItemStack aResult, boolean aDismantleAble, boolean aRemovableByGT, boolean aKeepingNBT, - Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) { + Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) { super(aResult, aRecipe); mEnchantmentsAdded = aEnchantmentsAdded; mEnchantmentLevelsAdded = aEnchantmentLevelsAdded; @@ -33,11 +33,11 @@ public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRec if (aGrid.getStackInSlot(i) != null) { if (tStack != null) { if ((tStack.hasTagCompound() != aGrid.getStackInSlot(i) - .hasTagCompound()) - || (tStack.hasTagCompound() && !tStack.getTagCompound() - .equals( - aGrid.getStackInSlot(i) - .getTagCompound()))) + .hasTagCompound()) || (tStack.hasTagCompound() + && !tStack.getTagCompound() + .equals( + aGrid.getStackInSlot(i) + .getTagCompound()))) return false; } tStack = aGrid.getStackInSlot(i); @@ -57,11 +57,11 @@ public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRec // Keeping NBT if (mKeepingNBT) for (int i = 0; i < aGrid.getSizeInventory(); i++) { if (aGrid.getStackInSlot(i) != null && aGrid.getStackInSlot(i) - .hasTagCompound()) { + .hasTagCompound()) { rStack.setTagCompound( - (NBTTagCompound) aGrid.getStackInSlot(i) - .getTagCompound() - .copy()); + (NBTTagCompound) aGrid.getStackInSlot(i) + .getTagCompound() + .copy()); break; } } @@ -71,21 +71,21 @@ public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRec GT_ModHandler.dischargeElectricItem(rStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true); int tCharge = 0; for (int i = 0; i < aGrid.getSizeInventory(); i++) tCharge += GT_ModHandler.dischargeElectricItem( - aGrid.getStackInSlot(i), - Integer.MAX_VALUE, - Integer.MAX_VALUE, - true, - true, - true); + aGrid.getStackInSlot(i), + Integer.MAX_VALUE, + Integer.MAX_VALUE, + true, + true, + true); if (tCharge > 0) GT_ModHandler.chargeElectricItem(rStack, tCharge, Integer.MAX_VALUE, true, false); } // Add Enchantments for (int i = 0; i < mEnchantmentsAdded.length; i++) GT_Utility.ItemNBT.addEnchantment( - rStack, - mEnchantmentsAdded[i], - EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack) - + mEnchantmentLevelsAdded[i]); + rStack, + mEnchantmentsAdded[i], + EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack) + + mEnchantmentLevelsAdded[i]); // Update the Stack again GT_Utility.updateItemStack(rStack); diff --git a/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java b/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java index 93ba33da31..582dd7cc10 100644 --- a/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java @@ -17,7 +17,7 @@ public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_Craft private final int[] mEnchantmentLevelsAdded; public GT_Shapeless_Recipe(ItemStack aResult, boolean aDismantleAble, boolean aRemovableByGT, boolean aKeepingNBT, - Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) { + Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) { super(aResult, aRecipe); mEnchantmentsAdded = aEnchantmentsAdded; mEnchantmentLevelsAdded = aEnchantmentLevelsAdded; @@ -33,11 +33,11 @@ public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_Craft if (aGrid.getStackInSlot(i) != null) { if (tStack != null) { if ((tStack.hasTagCompound() != aGrid.getStackInSlot(i) - .hasTagCompound()) - || (tStack.hasTagCompound() && !tStack.getTagCompound() - .equals( - aGrid.getStackInSlot(i) - .getTagCompound()))) + .hasTagCompound()) || (tStack.hasTagCompound() + && !tStack.getTagCompound() + .equals( + aGrid.getStackInSlot(i) + .getTagCompound()))) return false; } tStack = aGrid.getStackInSlot(i); @@ -57,11 +57,11 @@ public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_Craft // Keeping NBT if (mKeepingNBT) for (int i = 0; i < aGrid.getSizeInventory(); i++) { if (aGrid.getStackInSlot(i) != null && aGrid.getStackInSlot(i) - .hasTagCompound()) { + .hasTagCompound()) { rStack.setTagCompound( - (NBTTagCompound) aGrid.getStackInSlot(i) - .getTagCompound() - .copy()); + (NBTTagCompound) aGrid.getStackInSlot(i) + .getTagCompound() + .copy()); break; } } @@ -71,21 +71,21 @@ public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_Craft GT_ModHandler.dischargeElectricItem(rStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true); int tCharge = 0; for (int i = 0; i < aGrid.getSizeInventory(); i++) tCharge += GT_ModHandler.dischargeElectricItem( - aGrid.getStackInSlot(i), - Integer.MAX_VALUE, - Integer.MAX_VALUE, - true, - true, - true); + aGrid.getStackInSlot(i), + Integer.MAX_VALUE, + Integer.MAX_VALUE, + true, + true, + true); if (tCharge > 0) GT_ModHandler.chargeElectricItem(rStack, tCharge, Integer.MAX_VALUE, true, false); } // Add Enchantments for (int i = 0; i < mEnchantmentsAdded.length; i++) GT_Utility.ItemNBT.addEnchantment( - rStack, - mEnchantmentsAdded[i], - EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack) - + mEnchantmentLevelsAdded[i]); + rStack, + mEnchantmentsAdded[i], + EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack) + + mEnchantmentLevelsAdded[i]); // Update the Stack again GT_Utility.updateItemStack(rStack); diff --git a/src/main/java/gregtech/api/util/GT_Single_Recipe_Check.java b/src/main/java/gregtech/api/util/GT_Single_Recipe_Check.java index 806d892365..f46159a89f 100644 --- a/src/main/java/gregtech/api/util/GT_Single_Recipe_Check.java +++ b/src/main/java/gregtech/api/util/GT_Single_Recipe_Check.java @@ -36,20 +36,20 @@ public class GT_Single_Recipe_Check { protected final int totalFluidCost; protected GT_Single_Recipe_Check(GT_MetaTileEntity_MultiBlockBase multiBlockBase, GT_Recipe recipe, - ImmutableMap<GT_Utility.ItemId, Integer> itemCost, ImmutableMap<Fluid, Integer> fluidCost) { + ImmutableMap<GT_Utility.ItemId, Integer> itemCost, ImmutableMap<Fluid, Integer> fluidCost) { this.multiBlockBase = multiBlockBase; this.recipe = recipe; this.itemCost = itemCost; this.fluidCost = fluidCost; this.totalItemCost = itemCost.values() - .stream() - .mapToInt(Integer::intValue) - .sum(); + .stream() + .mapToInt(Integer::intValue) + .sum(); this.totalFluidCost = fluidCost.values() - .stream() - .mapToInt(Integer::intValue) - .sum(); + .stream() + .mapToInt(Integer::intValue) + .sum(); } public GT_Recipe getRecipe() { @@ -68,9 +68,9 @@ public class GT_Single_Recipe_Check { itemMap = new HashMap<>(); for (ItemStack itemStack : multiBlockBase.getStoredInputs()) { itemMap.merge( - GT_Utility.ItemId.createNoCopy(itemStack), - itemStack, - (a, b) -> a.stackSize >= b.stackSize ? a : b); + GT_Utility.ItemId.createNoCopy(itemStack), + itemStack, + (a, b) -> a.stackSize >= b.stackSize ? a : b); } for (Map.Entry<GT_Utility.ItemId, Integer> entry : itemCost.entrySet()) { @@ -200,33 +200,31 @@ public class GT_Single_Recipe_Check { tag.setTag("outputs", writeList(recipe.mOutputs, GT_Utility::saveItem)); tag.setIntArray("chances", recipe.mChances); tag.setTag( - "fInputs", - writeList( - recipe.mFluidInputs, - s -> s == null ? new NBTTagCompound() : s.writeToNBT(new NBTTagCompound()))); + "fInputs", + writeList(recipe.mFluidInputs, s -> s == null ? new NBTTagCompound() : s.writeToNBT(new NBTTagCompound()))); tag.setTag( - "fOutputs", - writeList( - recipe.mFluidOutputs, - s -> s == null ? new NBTTagCompound() : s.writeToNBT(new NBTTagCompound()))); + "fOutputs", + writeList( + recipe.mFluidOutputs, + s -> s == null ? new NBTTagCompound() : s.writeToNBT(new NBTTagCompound()))); tag.setInteger("eut", recipe.mEUt); tag.setInteger("duration", recipe.mDuration); tag.setInteger("specialValue", recipe.mSpecialValue); tag.setTag("itemCost", writeList(itemCost.entrySet(), e -> { NBTTagCompound ret = new NBTTagCompound(); ret.setTag( - "id", - e.getKey() - .writeToNBT()); + "id", + e.getKey() + .writeToNBT()); ret.setInteger("count", e.getValue()); return ret; })); tag.setTag("fluidCost", writeList(fluidCost.entrySet(), e -> { NBTTagCompound ret = new NBTTagCompound(); ret.setString( - "id", - e.getKey() - .getName()); + "id", + e.getKey() + .getName()); ret.setInteger("count", e.getValue()); return ret; })); @@ -253,7 +251,7 @@ public class GT_Single_Recipe_Check { @Nullable public static GT_Single_Recipe_Check tryLoad(GT_MetaTileEntity_MultiBlockBase parent, - GT_Recipe.GT_Recipe_Map recipeMap, NBTTagCompound tag) { + GT_Recipe.GT_Recipe_Map recipeMap, NBTTagCompound tag) { GT_Recipe found = tryFindRecipe(parent, recipeMap, tag); if (found == null) return null; return new GT_Single_Recipe_Check(parent, found, loadItemCost(tag), loadFluidCost(tag)); @@ -261,52 +259,46 @@ public class GT_Single_Recipe_Check { protected static ImmutableMap<Fluid, Integer> loadFluidCost(NBTTagCompound tag) { return GT_Utility.streamCompounds(tag.getTagList("fluidCost", Constants.NBT.TAG_COMPOUND)) - .collect( - GT_Utility.toImmutableMapSerial( - t -> FluidRegistry.getFluid(t.getString("id")), - t -> t.getInteger("count"))); + .collect( + GT_Utility + .toImmutableMapSerial(t -> FluidRegistry.getFluid(t.getString("id")), t -> t.getInteger("count"))); } protected static ImmutableMap<GT_Utility.ItemId, Integer> loadItemCost(NBTTagCompound tag) { return GT_Utility.streamCompounds(tag.getTagList("itemCost", Constants.NBT.TAG_COMPOUND)) - .collect( - GT_Utility.toImmutableMapSerial( - t -> GT_Utility.ItemId.create(t.getCompoundTag("id")), - t -> t.getInteger("count"))); + .collect( + GT_Utility.toImmutableMapSerial( + t -> GT_Utility.ItemId.create(t.getCompoundTag("id")), + t -> t.getInteger("count"))); } protected static GT_Recipe tryFindRecipe(GT_MetaTileEntity_MultiBlockBase parent, GT_Recipe.GT_Recipe_Map recipeMap, - NBTTagCompound tag) { + NBTTagCompound tag) { if (tag == null || tag.hasNoTags()) return null; ItemStack[] inputs = GT_Utility.streamCompounds(tag.getTagList("inputs", Constants.NBT.TAG_COMPOUND)) - .map(GT_Utility::loadItem) - .toArray(ItemStack[]::new); + .map(GT_Utility::loadItem) + .toArray(ItemStack[]::new); ItemStack[] outputs = GT_Utility.streamCompounds(tag.getTagList("outputs", Constants.NBT.TAG_COMPOUND)) - .map(GT_Utility::loadItem) - .toArray(ItemStack[]::new); + .map(GT_Utility::loadItem) + .toArray(ItemStack[]::new); FluidStack[] fInputs = GT_Utility.streamCompounds(tag.getTagList("fInputs", Constants.NBT.TAG_COMPOUND)) - .map(FluidStack::loadFluidStackFromNBT) - .toArray(FluidStack[]::new); + .map(FluidStack::loadFluidStackFromNBT) + .toArray(FluidStack[]::new); FluidStack[] fOutputs = GT_Utility.streamCompounds(tag.getTagList("fOutputs", Constants.NBT.TAG_COMPOUND)) - .map(FluidStack::loadFluidStackFromNBT) - .toArray(FluidStack[]::new); + .map(FluidStack::loadFluidStackFromNBT) + .toArray(FluidStack[]::new); int eut = tag.getInteger("eut"); - GT_Recipe found = recipeMap.findRecipe( - parent.getBaseMetaTileEntity(), - false, - GT_Values.V[GT_Utility.getTier(eut)], - fInputs, - inputs); + GT_Recipe found = recipeMap + .findRecipe(parent.getBaseMetaTileEntity(), false, GT_Values.V[GT_Utility.getTier(eut)], fInputs, inputs); int[] chances = tag.getIntArray("chances"); if (found == null || !GT_Utility.equals(inputs, found.mInputs) - || !Arrays.equals(fInputs, found.mFluidInputs) - || !GT_Utility.equals(outputs, found.mOutputs) - || !Arrays.equals(fOutputs, found.mFluidOutputs) - || !Arrays.equals(chances, found.mChances) - || found.mDuration != tag.getInteger("duration") - || found.mEUt != eut - || found.mSpecialValue != tag.getInteger("specialValue")) - return null; + || !Arrays.equals(fInputs, found.mFluidInputs) + || !GT_Utility.equals(outputs, found.mOutputs) + || !Arrays.equals(fOutputs, found.mFluidOutputs) + || !Arrays.equals(chances, found.mChances) + || found.mDuration != tag.getInteger("duration") + || found.mEUt != eut + || found.mSpecialValue != tag.getInteger("specialValue")) return null; return found; } @@ -384,10 +376,10 @@ public class GT_Single_Recipe_Check { } return new GT_Single_Recipe_Check( - multiBlockBase, - recipe, - itemCostBuilder.build(), - fluidCostBuilder.build()); + multiBlockBase, + recipe, + itemCostBuilder.build(), + fluidCostBuilder.build()); } } } diff --git a/src/main/java/gregtech/api/util/GT_Single_Recipe_Check_Processing_Array.java b/src/main/java/gregtech/api/util/GT_Single_Recipe_Check_Processing_Array.java index 3996484935..99ed0370d8 100644 --- a/src/main/java/gregtech/api/util/GT_Single_Recipe_Check_Processing_Array.java +++ b/src/main/java/gregtech/api/util/GT_Single_Recipe_Check_Processing_Array.java @@ -26,8 +26,8 @@ public class GT_Single_Recipe_Check_Processing_Array extends GT_Single_Recipe_Ch protected final ItemStack machineStack; protected GT_Single_Recipe_Check_Processing_Array(GT_MetaTileEntity_MultiBlockBase multiBlockBase, GT_Recipe recipe, - ImmutableMap<GT_Utility.ItemId, Integer> itemCost, ImmutableMap<Fluid, Integer> fluidCost, - int recipeAmperage, ItemStack machineStack) { + ImmutableMap<GT_Utility.ItemId, Integer> itemCost, ImmutableMap<Fluid, Integer> fluidCost, int recipeAmperage, + ItemStack machineStack) { super(multiBlockBase, recipe, itemCost, fluidCost); this.recipeAmperage = recipeAmperage; @@ -95,12 +95,8 @@ public class GT_Single_Recipe_Check_Processing_Array extends GT_Single_Recipe_Ch if (totalItemCost > 0) { int remainingItemCost = totalItemCost * finalParallel; Map<GT_Utility.ItemId, Integer> runningItemCost = itemCost.entrySet() - .stream() - .collect( - Collectors.toMap( - Map.Entry::getKey, - entry -> entry.getValue() - * finalParallel)); + .stream() + .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue() * finalParallel)); for (ItemStack itemStack : items) { GT_Utility.ItemId key = GT_Utility.ItemId.createNoCopy(itemStack); @@ -119,12 +115,8 @@ public class GT_Single_Recipe_Check_Processing_Array extends GT_Single_Recipe_Ch if (totalFluidCost > 0) { int remainingFluidCost = totalFluidCost * finalParallel; Map<Fluid, Integer> runningFluidCost = fluidCost.entrySet() - .stream() - .collect( - Collectors.toMap( - Map.Entry::getKey, - entry -> entry.getValue() - * finalParallel)); + .stream() + .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue() * finalParallel)); for (FluidStack fluidStack : fluids) { Fluid key = fluidStack.getFluid(); @@ -147,17 +139,17 @@ public class GT_Single_Recipe_Check_Processing_Array extends GT_Single_Recipe_Ch @Nullable public static GT_Single_Recipe_Check tryLoad(GT_MetaTileEntity_MultiBlockBase parent, - GT_Recipe.GT_Recipe_Map recipeMap, NBTTagCompound tag, ItemStack machineStack) { + GT_Recipe.GT_Recipe_Map recipeMap, NBTTagCompound tag, ItemStack machineStack) { if (recipeMap == null || machineStack == null) return null; GT_Recipe found = tryFindRecipe(parent, recipeMap, tag); if (found == null) return null; return new GT_Single_Recipe_Check_Processing_Array( - parent, - found, - loadItemCost(tag), - loadFluidCost(tag), - recipeMap.mAmperage, - machineStack.copy()); + parent, + found, + loadItemCost(tag), + loadFluidCost(tag), + recipeMap.mAmperage, + machineStack.copy()); } public static Builder processingArrayBuilder(GT_MetaTileEntity_MultiBlockBase multiBlockBase) { @@ -240,12 +232,12 @@ public class GT_Single_Recipe_Check_Processing_Array extends GT_Single_Recipe_Ch } return new GT_Single_Recipe_Check_Processing_Array( - multiBlockBase, - recipe, - itemCostBuilder.build(), - fluidCostBuilder.build(), - recipeAmperage, - multiBlockBase.mInventory[1].copy()); + multiBlockBase, + recipe, + itemCostBuilder.build(), + fluidCostBuilder.build(), + recipeAmperage, + multiBlockBase.mInventory[1].copy()); } } } diff --git a/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java b/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java index c17f73a147..5bbaa32007 100644 --- a/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java +++ b/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java @@ -41,8 +41,7 @@ public class GT_SpawnEventHandler { if (event.getResult() == Event.Result.DENY) return; if (event.entityLiving instanceof EntitySlime && !(((EntitySlime) event.entityLiving).getCustomNameTag() - .length() - > 0)) { + .length() > 0)) { if (event.getResult() == Event.Result.ALLOW) event.setResult(Event.Result.DEFAULT); } @@ -65,9 +64,10 @@ public class GT_SpawnEventHandler { if (check > maxRangeCheck) continue; final TileEntity tTile = event.entity.worldObj.getTileEntity(rep[0], rep[1], rep[2]); - if (tTile instanceof BaseMetaTileEntity - && ((BaseMetaTileEntity) tTile).getMetaTileEntity() instanceof GT_MetaTileEntity_MonsterRepellent) { - final int r = ((GT_MetaTileEntity_MonsterRepellent) ((BaseMetaTileEntity) tTile).getMetaTileEntity()).mRange; + if (tTile instanceof BaseMetaTileEntity && ((BaseMetaTileEntity) tTile) + .getMetaTileEntity() instanceof GT_MetaTileEntity_MonsterRepellent) { + final int r = ((GT_MetaTileEntity_MonsterRepellent) ((BaseMetaTileEntity) tTile) + .getMetaTileEntity()).mRange; if (check <= Math.pow(r, 2)) { if (event.entityLiving instanceof EntitySlime) ((EntitySlime) event.entityLiving).setCustomNameTag("DoNotSpawnSlimes"); diff --git a/src/main/java/gregtech/api/util/GT_StructureUtility.java b/src/main/java/gregtech/api/util/GT_StructureUtility.java index 703e056bc9..2447bea63f 100644 --- a/src/main/java/gregtech/api/util/GT_StructureUtility.java +++ b/src/main/java/gregtech/api/util/GT_StructureUtility.java @@ -53,7 +53,7 @@ public class GT_StructureUtility { } public static <T> IStructureElementNoPlacement<T> ofHatchAdder(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex, - int aDots) { + int aDots) { return ofHatchAdder(aHatchAdder, aTextureIndex, StructureLibAPI.getBlockHint(), aDots - 1); } @@ -88,20 +88,9 @@ public class GT_StructureUtility { public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { ItemStack tFrameStack = getFrameStack(); if (!GT_Utility.isStackValid(tFrameStack) - || !(tFrameStack.getItem() instanceof ItemBlock tFrameStackItem)) - return false; - return tFrameStackItem.placeBlockAt( - tFrameStack, - null, - world, - x, - y, - z, - 6, - 0, - 0, - 0, - Items.feather.getDamage(tFrameStack)); + || !(tFrameStack.getItem() instanceof ItemBlock tFrameStackItem)) return false; + return tFrameStackItem + .placeBlockAt(tFrameStack, null, world, x, y, z, 6, 0, 0, 0, Items.feather.getDamage(tFrameStack)); } private ItemStack getFrameStack() { @@ -110,7 +99,7 @@ public class GT_StructureUtility { @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { ItemStack tFrameStack = getFrameStack(); if (!GT_Utility.isStackValid(tFrameStack) || !(tFrameStack.getItem() instanceof ItemBlock)) return BlocksToPlace.errored; @@ -119,36 +108,36 @@ public class GT_StructureUtility { @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { + IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { return survivalPlaceBlock( - t, - world, - x, - y, - z, - trigger, - AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); + t, + world, + x, + y, + z, + trigger, + AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { if (check(t, world, x, y, z)) return SKIP; ItemStack tFrameStack = getFrameStack(); if (!GT_Utility.isStackValid(tFrameStack) || !(tFrameStack.getItem() instanceof ItemBlock)) return REJECT; // honestly, this is more like a programming error or pack issue return StructureUtility.survivalPlaceBlock( - tFrameStack, - ItemStackPredicate.NBTMode.IGNORE_KNOWN_INSIGNIFICANT_TAGS, - null, - false, - world, - x, - y, - z, - env.getSource(), - env.getActor(), - env.getChatter()); + tFrameStack, + ItemStackPredicate.NBTMode.IGNORE_KNOWN_INSIGNIFICANT_TAGS, + null, + false, + world, + x, + y, + z, + env.getSource(), + env.getActor(), + env.getChatter()); } }; } @@ -166,7 +155,7 @@ public class GT_StructureUtility { } public static <T> IStructureElementNoPlacement<T> ofHatchAdder(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex, - Block aHintBlock, int aHintMeta) { + Block aHintBlock, int aHintMeta) { if (aHatchAdder == null || aHintBlock == null) { throw new IllegalArgumentException(); } @@ -176,7 +165,7 @@ public class GT_StructureUtility { public boolean check(T t, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); return tileEntity instanceof IGregTechTileEntity - && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex); + && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex); } @Override @@ -188,8 +177,8 @@ public class GT_StructureUtility { } public static <T> IStructureElement<T> ofHatchAdder(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex, - Block aHintBlock, int aHintMeta, BiPredicate<T, IGregTechTileEntity> shouldSkip, - Function<T, Class<? extends IMetaTileEntity>> aMetaId, final IStructureElement.PlaceResult acceptType) { + Block aHintBlock, int aHintMeta, BiPredicate<T, IGregTechTileEntity> shouldSkip, + Function<T, Class<? extends IMetaTileEntity>> aMetaId, final IStructureElement.PlaceResult acceptType) { if (aHatchAdder == null) { throw new IllegalArgumentException(); } @@ -199,7 +188,7 @@ public class GT_StructureUtility { public boolean check(T t, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); return tileEntity instanceof IGregTechTileEntity - && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex); + && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex); } @Override @@ -216,7 +205,7 @@ public class GT_StructureUtility { @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { Class<? extends IMetaTileEntity> clazz = aMetaId.apply(t); if (clazz == null) return BlocksToPlace.createEmpty(); return BlocksToPlace.create(is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is))); @@ -224,58 +213,48 @@ public class GT_StructureUtility { @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { + IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { return survivalPlaceBlock( - t, - world, - x, - y, - z, - trigger, - AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); + t, + world, + x, + y, + z, + trigger, + AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { if (shouldSkip != null) { TileEntity tileEntity = world.getTileEntity(x, y, z); if (tileEntity instanceof IGregTechTileEntity - && shouldSkip.test(t, (IGregTechTileEntity) tileEntity)) - return SKIP; + && shouldSkip.test(t, (IGregTechTileEntity) tileEntity)) return SKIP; } if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, env.getActor())) return REJECT; Class<? extends IMetaTileEntity> clazz = aMetaId.apply(t); if (clazz == null) return REJECT; ItemStack taken = env.getSource() - .takeOne(is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is)), true); + .takeOne(is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is)), true); if (GT_Utility.isStackInvalid(taken)) { env.getChatter() - .accept( - new ChatComponentTranslation( - "GT5U.autoplace.error.no_mte.class_name", - clazz.getSimpleName())); + .accept( + new ChatComponentTranslation( + "GT5U.autoplace.error.no_mte.class_name", + clazz.getSimpleName())); return REJECT; } - if (StructureUtility.survivalPlaceBlock( - taken, - EXACT, - null, - true, - world, - x, - y, - z, - env.getSource(), - env.getActor()) == ACCEPT) - return acceptType; + if (StructureUtility + .survivalPlaceBlock(taken, EXACT, null, true, world, x, y, z, env.getSource(), env.getActor()) + == ACCEPT) return acceptType; return REJECT; } }; } public static <T> IStructureElement<T> ofHatchAdder(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex, - Block aHintBlock, int aHintMeta, BiPredicate<T, IGregTechTileEntity> shouldSkip, ToIntFunction<T> aMetaId) { + Block aHintBlock, int aHintMeta, BiPredicate<T, IGregTechTileEntity> shouldSkip, ToIntFunction<T> aMetaId) { if (aHatchAdder == null) { throw new IllegalArgumentException(); } @@ -285,7 +264,7 @@ public class GT_StructureUtility { public boolean check(T t, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); return tileEntity instanceof IGregTechTileEntity - && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex); + && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex); } @Override @@ -302,79 +281,70 @@ public class GT_StructureUtility { @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { GT_Item_Machines item = (GT_Item_Machines) Item.getItemFromBlock(GregTech_API.sBlockMachines); int meta = aMetaId.applyAsInt(t); if (meta < 0) return BlocksToPlace.createEmpty(); return BlocksToPlace.create( - ItemStackPredicate.from(item) - .setMeta(meta)); + ItemStackPredicate.from(item) + .setMeta(meta)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { + IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { return survivalPlaceBlock( - t, - world, - x, - y, - z, - trigger, - AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); + t, + world, + x, + y, + z, + trigger, + AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { if (shouldSkip != null) { TileEntity tileEntity = world.getTileEntity(x, y, z); if (tileEntity instanceof IGregTechTileEntity - && shouldSkip.test(t, (IGregTechTileEntity) tileEntity)) - return SKIP; + && shouldSkip.test(t, (IGregTechTileEntity) tileEntity)) return SKIP; } if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, env.getActor())) return REJECT; GT_Item_Machines item = (GT_Item_Machines) Item.getItemFromBlock(GregTech_API.sBlockMachines); int meta = aMetaId.applyAsInt(t); if (meta < 0) return REJECT; ItemStack taken = env.getSource() - .takeOne( - ItemStackPredicate.from(item) - .setMeta(meta), - true); + .takeOne( + ItemStackPredicate.from(item) + .setMeta(meta), + true); if (GT_Utility.isStackInvalid(taken)) { env.getChatter() - .accept(new ChatComponentTranslation("GT5U.autoplace.error.no_mte.id", meta)); + .accept(new ChatComponentTranslation("GT5U.autoplace.error.no_mte.id", meta)); return REJECT; } - return StructureUtility.survivalPlaceBlock( - taken, - EXACT, - null, - true, - world, - x, - y, - z, - env.getSource(), - env.getActor()) == ACCEPT ? ACCEPT_STOP : REJECT; + return StructureUtility + .survivalPlaceBlock(taken, EXACT, null, true, world, x, y, z, env.getSource(), env.getActor()) + == ACCEPT ? ACCEPT_STOP : REJECT; } }; } public static <T> IStructureElement<T> ofHatchAdderOptional(IGT_HatchAdder<T> aHatchAdder, int textureIndex, - int dots, Block placeCasing, int placeCasingMeta) { + int dots, Block placeCasing, int placeCasingMeta) { return ofHatchAdderOptional( - aHatchAdder, - textureIndex, - StructureLibAPI.getBlockHint(), - dots - 1, - placeCasing, - placeCasingMeta); + aHatchAdder, + textureIndex, + StructureLibAPI.getBlockHint(), + dots - 1, + placeCasing, + placeCasingMeta); } public static <T> IStructureElement<T> ofHatchAdderOptional(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex, - Block aHintBlock, int hintMeta, Block placeCasing, int placeCasingMeta) { + Block aHintBlock, int hintMeta, Block placeCasing, int placeCasingMeta) { if (aHatchAdder == null || aHintBlock == null) { throw new IllegalArgumentException(); } @@ -385,8 +355,8 @@ public class GT_StructureUtility { TileEntity tileEntity = world.getTileEntity(x, y, z); Block worldBlock = world.getBlock(x, y, z); return (tileEntity instanceof IGregTechTileEntity - && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex)) - || (worldBlock == placeCasing && worldBlock.getDamageValue(world, x, y, z) == placeCasingMeta); + && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex)) + || (worldBlock == placeCasing && worldBlock.getDamageValue(world, x, y, z) == placeCasingMeta); } @Override @@ -403,18 +373,10 @@ public class GT_StructureUtility { @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { + IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { if (check(t, world, x, y, z)) return SKIP; - return StructureUtility.survivalPlaceBlock( - placeCasing, - placeCasingMeta, - world, - x, - y, - z, - s, - actor, - chatter); + return StructureUtility + .survivalPlaceBlock(placeCasing, placeCasingMeta, world, x, y, z, s, actor, chatter); } }; } @@ -425,7 +387,7 @@ public class GT_StructureUtility { * @see #ofCoil(BiPredicate, Function) */ public static <T> IStructureElement<T> ofCoil(BiConsumer<T, HeatingCoilLevel> aHeatingCoilSetter, - Function<T, HeatingCoilLevel> aHeatingCoilGetter) { + Function<T, HeatingCoilLevel> aHeatingCoilGetter) { return ofCoil((t, l) -> { aHeatingCoilSetter.accept(t, l); return true; @@ -441,7 +403,7 @@ public class GT_StructureUtility { * @param aHeatingCoilGetter Get the current heating level. Null means no coil recorded yet. */ public static <T> IStructureElement<T> ofCoil(BiPredicate<T, HeatingCoilLevel> aHeatingCoilSetter, - Function<T, HeatingCoilLevel> aHeatingCoilGetter) { + Function<T, HeatingCoilLevel> aHeatingCoilGetter) { if (aHeatingCoilSetter == null || aHeatingCoilGetter == null) { throw new IllegalArgumentException(); } @@ -452,7 +414,7 @@ public class GT_StructureUtility { Block block = world.getBlock(x, y, z); if (!(block instanceof IHeatingCoil)) return false; HeatingCoilLevel existingLevel = aHeatingCoilGetter.apply(t), - newLevel = ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z)); + newLevel = ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z)); if (existingLevel == null || existingLevel == HeatingCoilLevel.None) { return aHeatingCoilSetter.test(t, newLevel); } else { @@ -471,8 +433,8 @@ public class GT_StructureUtility { } private HeatingCoilLevel getHeatFromHint(ItemStack trigger) { - return HeatingCoilLevel.getFromTier( - (byte) Math.min(HeatingCoilLevel.getMaxTier(), Math.max(0, trigger.stackSize - 1))); + return HeatingCoilLevel + .getFromTier((byte) Math.min(HeatingCoilLevel.getMaxTier(), Math.max(0, trigger.stackSize - 1))); } @Override @@ -482,41 +444,40 @@ public class GT_StructureUtility { @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { return BlocksToPlace.create(GregTech_API.sBlockCasings5, getMetaFromHint(trigger)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { + IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { return survivalPlaceBlock( - t, - world, - x, - y, - z, - trigger, - AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); + t, + world, + x, + y, + z, + trigger, + AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { Block block = world.getBlock(x, y, z); boolean isCoil = block instanceof IHeatingCoil - && ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z)) - == getHeatFromHint(trigger); + && ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z)) == getHeatFromHint(trigger); if (isCoil) return SKIP; return StructureUtility.survivalPlaceBlock( - GregTech_API.sBlockCasings5, - getMetaFromHint(trigger), - world, - x, - y, - z, - env.getSource(), - env.getActor(), - env.getChatter()); + GregTech_API.sBlockCasings5, + getMetaFromHint(trigger), + world, + x, + y, + z, + env.getSource(), + env.getActor(), + env.getChatter()); } }; } @@ -526,7 +487,7 @@ public class GT_StructureUtility { return is -> { IMetaTileEntity tile = GT_Item_Machines.getMetaTileEntity(is); return tile != null && list.stream() - .anyMatch(c -> c.isInstance(tile)); + .anyMatch(c -> c.isInstance(tile)); }; } @@ -535,8 +496,8 @@ public class GT_StructureUtility { return is -> { IMetaTileEntity tile = GT_Item_Machines.getMetaTileEntity(is); return tile instanceof GT_MetaTileEntity_TieredMachineBlock - && ((GT_MetaTileEntity_TieredMachineBlock) tile).mTier <= aMaxTier - && ((GT_MetaTileEntity_TieredMachineBlock) tile).mTier >= aMinTier; + && ((GT_MetaTileEntity_TieredMachineBlock) tile).mTier <= aMaxTier + && ((GT_MetaTileEntity_TieredMachineBlock) tile).mTier >= aMinTier; }; } } diff --git a/src/main/java/gregtech/api/util/GT_TooltipDataCache.java b/src/main/java/gregtech/api/util/GT_TooltipDataCache.java index cb702688cf..431ef34fa4 100644 --- a/src/main/java/gregtech/api/util/GT_TooltipDataCache.java +++ b/src/main/java/gregtech/api/util/GT_TooltipDataCache.java @@ -58,10 +58,9 @@ public class GT_TooltipDataCache { lines.add(key); // Fallback in case no lines could be found at all } return new TooltipData( - lines.subList(0, getVerbosityIndex(GT_Mod.gregtechproxy.mTooltipVerbosity, normalLines, lines.size())), - lines.subList( - 0, - getVerbosityIndex(GT_Mod.gregtechproxy.mTooltipShiftVerbosity, normalLines, lines.size()))); + lines.subList(0, getVerbosityIndex(GT_Mod.gregtechproxy.mTooltipVerbosity, normalLines, lines.size())), + lines + .subList(0, getVerbosityIndex(GT_Mod.gregtechproxy.mTooltipShiftVerbosity, normalLines, lines.size()))); } /** diff --git a/src/main/java/gregtech/api/util/GT_Util.java b/src/main/java/gregtech/api/util/GT_Util.java index 177b391f5d..8a799a9616 100644 --- a/src/main/java/gregtech/api/util/GT_Util.java +++ b/src/main/java/gregtech/api/util/GT_Util.java @@ -39,46 +39,46 @@ public class GT_Util { if (t.getSecond() == null) continue; if (t.getSecond() instanceof Boolean) rNBT.setBoolean( - t.getFirst() - .toString(), - (Boolean) t.getSecond()); + t.getFirst() + .toString(), + (Boolean) t.getSecond()); else if (t.getSecond() instanceof Byte) rNBT.setByte( - t.getFirst() - .toString(), - (Byte) t.getSecond()); + t.getFirst() + .toString(), + (Byte) t.getSecond()); else if (t.getSecond() instanceof Short) rNBT.setShort( - t.getFirst() - .toString(), - (Short) t.getSecond()); + t.getFirst() + .toString(), + (Short) t.getSecond()); else if (t.getSecond() instanceof Integer) rNBT.setInteger( - t.getFirst() - .toString(), - (Integer) t.getSecond()); + t.getFirst() + .toString(), + (Integer) t.getSecond()); else if (t.getSecond() instanceof Long) rNBT.setLong( - t.getFirst() - .toString(), - (Long) t.getSecond()); + t.getFirst() + .toString(), + (Long) t.getSecond()); else if (t.getSecond() instanceof Float) rNBT.setFloat( - t.getFirst() - .toString(), - (Float) t.getSecond()); + t.getFirst() + .toString(), + (Float) t.getSecond()); else if (t.getSecond() instanceof Double) rNBT.setDouble( - t.getFirst() - .toString(), - (Double) t.getSecond()); + t.getFirst() + .toString(), + (Double) t.getSecond()); else if (t.getSecond() instanceof String) rNBT.setString( - t.getFirst() - .toString(), - (String) t.getSecond()); + t.getFirst() + .toString(), + (String) t.getSecond()); else if (t.getSecond() instanceof NBTBase) rNBT.setTag( - t.getFirst() - .toString(), - (NBTBase) t.getSecond()); + t.getFirst() + .toString(), + (NBTBase) t.getSecond()); else rNBT.setString( - t.getFirst() - .toString(), - t.getSecond() - .toString()); + t.getFirst() + .toString(), + t.getSecond() + .toString()); } return rNBT; @@ -101,7 +101,7 @@ public class GT_Util { /** Sets the TileEntity at the passed position, with the option of turning adjacent TileEntity updates off. */ public static TileEntity setTileEntity(World aWorld, int aX, int aY, int aZ, TileEntity aTileEntity, - boolean aCauseTileEntityUpdates) { + boolean aCauseTileEntityUpdates) { if (aCauseTileEntityUpdates) aWorld.setTileEntity(aX, aY, aZ, aTileEntity); else { Chunk tChunk = aWorld.getChunkFromChunkCoords(aX >> 4, aZ >> 4); @@ -115,7 +115,7 @@ public class GT_Util { } public static boolean setTileEntity(World aWorld, int aX, int aY, int aZ, Block aBlock, short aMeta, long aFlags, - boolean aRemoveGrassBelow) { + boolean aRemoveGrassBelow) { if (aRemoveGrassBelow) { final Block tBlock = aWorld.getBlock(aX, aY - 1, aZ); if (tBlock == Blocks.grass || tBlock == Blocks.mycelium) @@ -137,9 +137,7 @@ public class GT_Util { aChunk = aWorld.getChunkFromBlockCoords(aX, aZ); if (aChunk == null) { GT_Log.err.println( - "Some important Chunk does not exist for some reason at Coordinates X: " + aX - + " and Z: " - + aZ); + "Some important Chunk does not exist for some reason at Coordinates X: " + aX + " and Z: " + aZ); return false; } } @@ -150,15 +148,15 @@ public class GT_Util { /** Marks a Chunk dirty so it is saved */ public static boolean markChunkDirty(Object aTileEntity) { return aTileEntity instanceof TileEntity && markChunkDirty( - ((TileEntity) aTileEntity).getWorldObj(), - ((TileEntity) aTileEntity).xCoord, - ((TileEntity) aTileEntity).zCoord); + ((TileEntity) aTileEntity).getWorldObj(), + ((TileEntity) aTileEntity).xCoord, + ((TileEntity) aTileEntity).zCoord); } public static int mixRGBInt(int aRGB1, int aRGB2) { return getRGBInt( - new short[] { (short) ((getR(aRGB1) + getR(aRGB2)) >> 1), (short) ((getG(aRGB1) + getG(aRGB2)) >> 1), - (short) ((getB(aRGB1) + getB(aRGB2)) >> 1) }); + new short[] { (short) ((getR(aRGB1) + getR(aRGB2)) >> 1), (short) ((getG(aRGB1) + getG(aRGB2)) >> 1), + (short) ((getB(aRGB1) + getB(aRGB2)) >> 1) }); } public static int getRGBInt(short[] aColors) { @@ -183,7 +181,7 @@ public class GT_Util { public static short[] getRGBaArray(int aColors) { return new short[] { (short) ((aColors >>> 16) & 255), (short) ((aColors >>> 8) & 255), (short) (aColors & 255), - (short) ((aColors >>> 24) & 255) }; + (short) ((aColors >>> 24) & 255) }; } public static short getR(int aColors) { diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 12e5022ef0..8d9d0814dc 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -172,8 +172,8 @@ public class GT_Utility { // 1 is the magic index to get the cobblestone block. // See: GT_Block_Stones.java, GT_Block_Granites.java Function<Materials, Supplier<ItemStack>> materialToCobble = m -> Suppliers.memoize( - () -> GT_OreDictUnificator.getOres(OrePrefixes.stone, m) - .get(1))::get; + () -> GT_OreDictUnificator.getOres(OrePrefixes.stone, m) + .get(1))::get; sOreToCobble.put(OrePrefixes.oreBlackgranite, materialToCobble.apply(Materials.GraniteBlack)); sOreToCobble.put(OrePrefixes.oreRedgranite, materialToCobble.apply(Materials.GraniteRed)); sOreToCobble.put(OrePrefixes.oreMarble, materialToCobble.apply(Materials.Marble)); @@ -188,14 +188,14 @@ public class GT_Utility { public static int safeInt(long number) { return number > V[V.length - 1] ? safeInt(V[V.length - 1], 1) - : number < Integer.MIN_VALUE ? Integer.MIN_VALUE : (int) number; + : number < Integer.MIN_VALUE ? Integer.MIN_VALUE : (int) number; } public static Field getPublicField(Object aObject, String aField) { Field rField = null; try { rField = aObject.getClass() - .getDeclaredField(aField); + .getDeclaredField(aField); } catch (Throwable e) { /* Do nothing */ } @@ -206,7 +206,7 @@ public class GT_Utility { Field rField = null; try { rField = aObject.getClass() - .getDeclaredField(aField); + .getDeclaredField(aField); rField.setAccessible(true); } catch (Throwable e) { /* Do nothing */ @@ -240,7 +240,7 @@ public class GT_Utility { Method rMethod = null; try { rMethod = aObject.getClass() - .getMethod(aMethod, aParameterTypes); + .getMethod(aMethod, aParameterTypes); rMethod.setAccessible(true); } catch (Throwable e) { /* Do nothing */ @@ -251,10 +251,10 @@ public class GT_Utility { public static Field getField(Object aObject, String aField, boolean aPrivate, boolean aLogErrors) { try { Field tField = (aObject instanceof Class) ? ((Class<?>) aObject).getDeclaredField(aField) - : (aObject instanceof String) ? Class.forName((String) aObject) - .getDeclaredField(aField) - : aObject.getClass() - .getDeclaredField(aField); + : (aObject instanceof String) ? Class.forName((String) aObject) + .getDeclaredField(aField) + : aObject.getClass() + .getDeclaredField(aField); if (aPrivate) tField.setAccessible(true); return tField; } catch (Throwable e) { @@ -266,10 +266,10 @@ public class GT_Utility { public static Object getFieldContent(Object aObject, String aField, boolean aPrivate, boolean aLogErrors) { try { Field tField = (aObject instanceof Class) ? ((Class<?>) aObject).getDeclaredField(aField) - : (aObject instanceof String) ? Class.forName((String) aObject) - .getDeclaredField(aField) - : aObject.getClass() - .getDeclaredField(aField); + : (aObject instanceof String) ? Class.forName((String) aObject) + .getDeclaredField(aField) + : aObject.getClass() + .getDeclaredField(aField); if (aPrivate) tField.setAccessible(true); return tField.get(aObject instanceof Class || aObject instanceof String ? null : aObject); } catch (Throwable e) { @@ -287,7 +287,7 @@ public class GT_Utility { } public static Object callMethod(Object aObject, String aMethod, boolean aPrivate, boolean aUseUpperCasedDataTypes, - boolean aLogErrors, Object... aParameters) { + boolean aLogErrors, Object... aParameters) { try { Class<?>[] tParameterTypes = new Class<?>[aParameters.length]; for (byte i = 0; i < aParameters.length; i++) { @@ -309,8 +309,8 @@ public class GT_Utility { } Method tMethod = (aObject instanceof Class) ? ((Class<?>) aObject).getMethod(aMethod, tParameterTypes) - : aObject.getClass() - .getMethod(aMethod, tParameterTypes); + : aObject.getClass() + .getMethod(aMethod, tParameterTypes); if (aPrivate) tMethod.setAccessible(true); return tMethod.invoke(aObject, aParameters); } catch (Throwable e) { @@ -320,14 +320,14 @@ public class GT_Utility { } public static Object callConstructor(String aClass, int aConstructorIndex, Object aReplacementObject, - boolean aLogErrors, Object... aParameters) { + boolean aLogErrors, Object... aParameters) { try { return callConstructor( - Class.forName(aClass), - aConstructorIndex, - aReplacementObject, - aLogErrors, - aParameters); + Class.forName(aClass), + aConstructorIndex, + aReplacementObject, + aLogErrors, + aParameters); } catch (Throwable e) { if (aLogErrors) e.printStackTrace(GT_Log.err); } @@ -335,7 +335,7 @@ public class GT_Utility { } public static Object callConstructor(Class<?> aClass, int aConstructorIndex, Object aReplacementObject, - boolean aLogErrors, Object... aParameters) { + boolean aLogErrors, Object... aParameters) { if (aConstructorIndex < 0) { try { for (Constructor<?> tConstructor : aClass.getConstructors()) { @@ -358,8 +358,7 @@ public class GT_Utility { public static String capitalizeString(String aString) { if (aString != null && aString.length() > 0) return aString.substring(0, 1) - .toUpperCase() - + aString.substring(1); + .toUpperCase() + aString.substring(1); return E; } @@ -387,11 +386,11 @@ public class GT_Utility { public static String getClassName(Object aObject) { if (aObject == null) return "null"; return aObject.getClass() - .getName() - .substring( - aObject.getClass() - .getName() - .lastIndexOf(".") + 1); + .getName() + .substring( + aObject.getClass() + .getName() + .lastIndexOf(".") + 1); } public static void removePotion(EntityLivingBase aPlayer, int aPotionIndex) { @@ -421,7 +420,7 @@ public class GT_Utility { if (aPlayer.inventory.armorInventory[i] != null) { if (aPlayer.inventory.armorInventory[i].getItem() instanceof GT_EnergyArmor_Item) { if ((((GT_EnergyArmor_Item) aPlayer.inventory.armorInventory[i].getItem()).mSpecials & 512) - != 0) { + != 0) { if (GT_ModHandler.canUseElectricItem(aPlayer.inventory.armorInventory[i], 10000)) { return true; } @@ -437,10 +436,10 @@ public class GT_Utility { } public static ItemStack suckOneItemStackAt(World aWorld, double aX, double aY, double aZ, double aL, double aH, - double aW) { + double aW) { for (EntityItem tItem : aWorld.getEntitiesWithinAABB( - EntityItem.class, - AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + aL, aY + aH, aZ + aW))) { + EntityItem.class, + AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + aL, aY + aH, aZ + aW))) { if (!tItem.isDead) { aWorld.removeEntity(tItem); tItem.setDead(); @@ -452,8 +451,8 @@ public class GT_Utility { public static byte getOppositeSide(int aSide) { return (byte) ForgeDirection.getOrientation(aSide) - .getOpposite() - .ordinal(); + .getOpposite() + .ordinal(); } public static byte getTier(long l) { @@ -508,8 +507,8 @@ public class GT_Utility { checkAvailabilities(); if (TE_CHECK && aTileEntity instanceof IItemDuct) return true; if (BC_CHECK && aTileEntity instanceof buildcraft.api.transport.IPipeTile) - return ((buildcraft.api.transport.IPipeTile) aTileEntity).isPipeConnected( - ForgeDirection.getOrientation(aSide)); + return ((buildcraft.api.transport.IPipeTile) aTileEntity) + .isPipeConnected(ForgeDirection.getOrientation(aSide)); return GregTech_API.mTranslocator && aTileEntity instanceof codechicken.translocator.TileItemTranslocator; } @@ -519,21 +518,21 @@ public class GT_Utility { * @return the Amount of moved Items */ public static byte moveStackIntoPipe(IInventory aTileEntity1, Object aTileEntity2, int[] aGrabSlots, int aGrabFrom, - int aPutTo, List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, - byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + int aPutTo, List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { return moveStackIntoPipe( - aTileEntity1, - aTileEntity2, - aGrabSlots, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - true); + aTileEntity1, + aTileEntity2, + aGrabSlots, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + true); } /** @@ -542,36 +541,34 @@ public class GT_Utility { * @return the Amount of moved Items */ public static byte moveStackIntoPipe(IInventory aTileEntity1, Object aTileEntity2, int[] aGrabSlots, int aGrabFrom, - int aPutTo, List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, - byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean dropItem) { + int aPutTo, List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean dropItem) { if (aTileEntity1 == null || aMaxTargetStackSize <= 0 - || aMinTargetStackSize <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMaxMoveAtOnce <= 0 - || aMinMoveAtOnce > aMaxMoveAtOnce) - return 0; + || aMinTargetStackSize <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMaxMoveAtOnce <= 0 + || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; if (aTileEntity2 != null) { checkAvailabilities(); if (TE_CHECK && aTileEntity2 instanceof IItemDuct) { for (int aGrabSlot : aGrabSlots) { if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabSlot), true, aInvertFilter)) { if (isAllowedToTakeFromSlot( - aTileEntity1, - aGrabSlot, - (byte) aGrabFrom, - aTileEntity1.getStackInSlot(aGrabSlot))) { + aTileEntity1, + aGrabSlot, + (byte) aGrabFrom, + aTileEntity1.getStackInSlot(aGrabSlot))) { if (Math.max(aMinMoveAtOnce, aMinTargetStackSize) - <= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) { + <= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) { ItemStack tStack = copyAmount( - Math.min( - aTileEntity1.getStackInSlot(aGrabSlot).stackSize, - Math.min(aMaxMoveAtOnce, aMaxTargetStackSize)), - aTileEntity1.getStackInSlot(aGrabSlot)); - ItemStack rStack = ((IItemDuct) aTileEntity2).insertItem( - ForgeDirection.getOrientation(aPutTo), - copyOrNull(tStack)); + Math.min( + aTileEntity1.getStackInSlot(aGrabSlot).stackSize, + Math.min(aMaxMoveAtOnce, aMaxTargetStackSize)), + aTileEntity1.getStackInSlot(aGrabSlot)); + ItemStack rStack = ((IItemDuct) aTileEntity2) + .insertItem(ForgeDirection.getOrientation(aPutTo), copyOrNull(tStack)); byte tMovedItemCount = (byte) (tStack.stackSize - - (rStack == null ? 0 : rStack.stackSize)); + - (rStack == null ? 0 : rStack.stackSize)); if (tMovedItemCount >= 1 /* Math.max(aMinMoveAtOnce, aMinTargetStackSize) */) { // ((cofh.api.transport.IItemConduit)aTileEntity2).insertItem(ForgeDirection.getOrientation(aPutTo), // copyAmount(tMovedItemCount, tStack), F); @@ -589,23 +586,22 @@ public class GT_Utility { for (int aGrabSlot : aGrabSlots) { if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabSlot), true, aInvertFilter)) { if (isAllowedToTakeFromSlot( - aTileEntity1, - aGrabSlot, - (byte) aGrabFrom, - aTileEntity1.getStackInSlot(aGrabSlot))) { + aTileEntity1, + aGrabSlot, + (byte) aGrabFrom, + aTileEntity1.getStackInSlot(aGrabSlot))) { if (Math.max(aMinMoveAtOnce, aMinTargetStackSize) - <= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) { + <= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) { ItemStack tStack = copyAmount( - Math.min( - aTileEntity1.getStackInSlot(aGrabSlot).stackSize, - Math.min(aMaxMoveAtOnce, aMaxTargetStackSize)), - aTileEntity1.getStackInSlot(aGrabSlot)); - byte tMovedItemCount = (byte) ((buildcraft.api.transport.IPipeTile) aTileEntity2).injectItem( - copyOrNull(tStack), - false, - ForgeDirection.getOrientation(aPutTo)); + Math.min( + aTileEntity1.getStackInSlot(aGrabSlot).stackSize, + Math.min(aMaxMoveAtOnce, aMaxTargetStackSize)), + aTileEntity1.getStackInSlot(aGrabSlot)); + byte tMovedItemCount = (byte) ((buildcraft.api.transport.IPipeTile) aTileEntity2) + .injectItem(copyOrNull(tStack), false, ForgeDirection.getOrientation(aPutTo)); if (tMovedItemCount >= Math.max(aMinMoveAtOnce, aMinTargetStackSize)) { - tMovedItemCount = (byte) (((buildcraft.api.transport.IPipeTile) aTileEntity2).injectItem( + tMovedItemCount = (byte) (((buildcraft.api.transport.IPipeTile) aTileEntity2) + .injectItem( copyAmount(tMovedItemCount, tStack), true, ForgeDirection.getOrientation(aPutTo))); @@ -623,34 +619,34 @@ public class GT_Utility { ForgeDirection tDirection = ForgeDirection.getOrientation(aGrabFrom); if (aTileEntity1 instanceof TileEntity && tDirection != ForgeDirection.UNKNOWN - && tDirection.getOpposite() == ForgeDirection.getOrientation(aPutTo)) { + && tDirection.getOpposite() == ForgeDirection.getOrientation(aPutTo)) { int tX = ((TileEntity) aTileEntity1).xCoord + tDirection.offsetX, - tY = ((TileEntity) aTileEntity1).yCoord + tDirection.offsetY, - tZ = ((TileEntity) aTileEntity1).zCoord + tDirection.offsetZ; + tY = ((TileEntity) aTileEntity1).yCoord + tDirection.offsetY, + tZ = ((TileEntity) aTileEntity1).zCoord + tDirection.offsetZ; if (!hasBlockHitBox(((TileEntity) aTileEntity1).getWorldObj(), tX, tY, tZ) && dropItem) { for (int aGrabSlot : aGrabSlots) { if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabSlot), true, aInvertFilter)) { if (isAllowedToTakeFromSlot( - aTileEntity1, - aGrabSlot, - (byte) aGrabFrom, - aTileEntity1.getStackInSlot(aGrabSlot))) { + aTileEntity1, + aGrabSlot, + (byte) aGrabFrom, + aTileEntity1.getStackInSlot(aGrabSlot))) { if (Math.max(aMinMoveAtOnce, aMinTargetStackSize) - <= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) { + <= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) { ItemStack tStack = copyAmount( - Math.min( - aTileEntity1.getStackInSlot(aGrabSlot).stackSize, - Math.min(aMaxMoveAtOnce, aMaxTargetStackSize)), - aTileEntity1.getStackInSlot(aGrabSlot)); + Math.min( + aTileEntity1.getStackInSlot(aGrabSlot).stackSize, + Math.min(aMaxMoveAtOnce, aMaxTargetStackSize)), + aTileEntity1.getStackInSlot(aGrabSlot)); EntityItem tEntity = new EntityItem( - ((TileEntity) aTileEntity1).getWorldObj(), - tX + 0.5, - tY + 0.5, - tZ + 0.5, - tStack); + ((TileEntity) aTileEntity1).getWorldObj(), + tX + 0.5, + tY + 0.5, + tZ + 0.5, + tStack); tEntity.motionX = tEntity.motionY = tEntity.motionZ = 0; ((TileEntity) aTileEntity1).getWorldObj() - .spawnEntityInWorld(tEntity); + .spawnEntityInWorld(tEntity); aTileEntity1.decrStackSize(aGrabSlot, tStack.stackSize); aTileEntity1.markDirty(); return (byte) tStack.stackSize; @@ -670,34 +666,31 @@ public class GT_Utility { * @return the Amount of moved Items */ public static byte moveStackFromSlotAToSlotB(IInventory aTileEntity1, IInventory aTileEntity2, int aGrabFrom, - int aPutTo, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + int aPutTo, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { if (aTileEntity1 == null || aTileEntity2 == null - || aMaxTargetStackSize <= 0 - || aMinTargetStackSize <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMaxMoveAtOnce <= 0 - || aMinMoveAtOnce > aMaxMoveAtOnce) - return 0; + || aMaxTargetStackSize <= 0 + || aMinTargetStackSize <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMaxMoveAtOnce <= 0 + || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; ItemStack tStack1 = aTileEntity1.getStackInSlot(aGrabFrom), tStack2 = aTileEntity2.getStackInSlot(aPutTo), - tStack3 = null; + tStack3 = null; if (tStack1 != null) { if (tStack2 != null && !areStacksEqual(tStack1, tStack2)) return 0; tStack3 = copyOrNull(tStack1); aMaxTargetStackSize = (byte) Math.min( - aMaxTargetStackSize, + aMaxTargetStackSize, + Math.min( + tStack3.getMaxStackSize(), Math.min( - tStack3.getMaxStackSize(), - Math.min( - tStack2 == null ? Integer.MAX_VALUE : tStack2.getMaxStackSize(), - aTileEntity2.getInventoryStackLimit()))); - tStack3.stackSize = Math.min( - tStack3.stackSize, - aMaxTargetStackSize - (tStack2 == null ? 0 : tStack2.stackSize)); + tStack2 == null ? Integer.MAX_VALUE : tStack2.getMaxStackSize(), + aTileEntity2.getInventoryStackLimit()))); + tStack3.stackSize = Math + .min(tStack3.stackSize, aMaxTargetStackSize - (tStack2 == null ? 0 : tStack2.stackSize)); if (tStack3.stackSize > aMaxMoveAtOnce) tStack3.stackSize = aMaxMoveAtOnce; if (tStack3.stackSize + (tStack2 == null ? 0 : tStack2.stackSize) - >= Math.min(tStack3.getMaxStackSize(), aMinTargetStackSize) - && tStack3.stackSize >= aMinMoveAtOnce) { + >= Math.min(tStack3.getMaxStackSize(), aMinTargetStackSize) && tStack3.stackSize >= aMinMoveAtOnce) { tStack3 = aTileEntity1.decrStackSize(aGrabFrom, tStack3.stackSize); aTileEntity1.markDirty(); if (tStack3 != null) { @@ -717,11 +710,11 @@ public class GT_Utility { public static boolean isAllowedToTakeFromSlot(IInventory aTileEntity, int aSlot, byte aSide, ItemStack aStack) { if (ForgeDirection.getOrientation(aSide) == ForgeDirection.UNKNOWN) { return isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 0, aStack) - || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 1, aStack) - || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 2, aStack) - || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 3, aStack) - || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 4, aStack) - || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 5, aStack); + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 1, aStack) + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 2, aStack) + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 3, aStack) + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 4, aStack) + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 5, aStack); } if (aTileEntity instanceof ISidedInventory) return ((ISidedInventory) aTileEntity).canExtractItem(aSlot, aStack, aSide); @@ -729,21 +722,20 @@ public class GT_Utility { } public static boolean isAllowedToPutIntoSlot(IInventory aTileEntity, int aSlot, byte aSide, ItemStack aStack, - byte aMaxStackSize) { + byte aMaxStackSize) { ItemStack tStack = aTileEntity.getStackInSlot(aSlot); if (tStack != null && (!areStacksEqual(tStack, aStack) || tStack.stackSize >= tStack.getMaxStackSize())) return false; if (ForgeDirection.getOrientation(aSide) == ForgeDirection.UNKNOWN) { return isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 0, aStack, aMaxStackSize) - || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 1, aStack, aMaxStackSize) - || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 2, aStack, aMaxStackSize) - || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 3, aStack, aMaxStackSize) - || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 4, aStack, aMaxStackSize) - || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 5, aStack, aMaxStackSize); + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 1, aStack, aMaxStackSize) + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 2, aStack, aMaxStackSize) + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 3, aStack, aMaxStackSize) + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 4, aStack, aMaxStackSize) + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 5, aStack, aMaxStackSize); } if (aTileEntity instanceof ISidedInventory - && !((ISidedInventory) aTileEntity).canInsertItem(aSlot, aStack, aSide)) - return false; + && !((ISidedInventory) aTileEntity).canInsertItem(aSlot, aStack, aSide)) return false; return aSlot < aTileEntity.getSizeInventory() && aTileEntity.isItemValidForSlot(aSlot, aStack); } @@ -753,34 +745,33 @@ public class GT_Utility { * @return the Amount of moved Items */ public static int moveMultipleItemStacks(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, - List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aStackAmount) { + List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aStackAmount) { if (aTileEntity1 instanceof IInventory) return moveMultipleItemStacks( - (IInventory) aTileEntity1, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aStackAmount, - true); + (IInventory) aTileEntity1, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aStackAmount, + true); return 0; } public static int moveMultipleItemStacks(IInventory aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, - List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer, boolean aDoCheckChests) { + List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer, boolean aDoCheckChests) { if (aTileEntity1 == null || aMaxTargetStackSize <= 0 - || aMinTargetStackSize <= 0 - || aMaxMoveAtOnce <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMinMoveAtOnce > aMaxMoveAtOnce - || aMaxStackTransfer == 0) - return 0; + || aMinTargetStackSize <= 0 + || aMaxMoveAtOnce <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMinMoveAtOnce > aMaxMoveAtOnce + || aMaxStackTransfer == 0) return 0; // find where to take from final int[] tGrabSlots = new int[aTileEntity1.getSizeInventory()]; @@ -789,9 +780,8 @@ public class GT_Utility { for (int i : ((ISidedInventory) aTileEntity1).getAccessibleSlotsFromSide(aGrabFrom)) { final ItemStack s = aTileEntity1.getStackInSlot(i); if (s == null || !isAllowedToTakeFromSlot(aTileEntity1, i, aGrabFrom, s) - || s.stackSize < aMinMoveAtOnce - || !listContainsItem(aFilter, s, true, aInvertFilter)) - continue; + || s.stackSize < aMinMoveAtOnce + || !listContainsItem(aFilter, s, true, aInvertFilter)) continue; tGrabSlots[tGrabSlotsSize++] = i; } } else { @@ -807,17 +797,17 @@ public class GT_Utility { if (tGrabSlotsSize == 0) { // maybe source is a double chest. check it if (aDoCheckChests && aTileEntity1 instanceof TileEntityChest) return moveFromAdjacentChests( - (TileEntityChest) aTileEntity1, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer); + (TileEntityChest) aTileEntity1, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer); return 0; } @@ -846,33 +836,32 @@ public class GT_Utility { if (s == null) { tPutFreeSlots.add(slot); } else if ((s.stackSize < s.getMaxStackSize() && s.stackSize < tPutInventory.getInventoryStackLimit()) - && aMinMoveAtOnce <= s.getMaxStackSize() - s.stackSize) { - ItemId sID = ItemId.createNoCopy(s); - tPutItems.merge( - sID, - (Math.min(s.getMaxStackSize(), tPutInventory.getInventoryStackLimit()) - - s.stackSize), - Integer::sum); - tPutItemStacks.computeIfAbsent(sID, k -> new ArrayList<>()) - .add(s); - } + && aMinMoveAtOnce <= s.getMaxStackSize() - s.stackSize) { + ItemId sID = ItemId.createNoCopy(s); + tPutItems.merge( + sID, + (Math.min(s.getMaxStackSize(), tPutInventory.getInventoryStackLimit()) - s.stackSize), + Integer::sum); + tPutItemStacks.computeIfAbsent(sID, k -> new ArrayList<>()) + .add(s); + } } // target completely filled, bail out if (tPutItems.isEmpty() && tPutFreeSlots.isEmpty()) { // maybe target is a double chest. check it. if (aDoCheckChests && aTileEntity2 instanceof TileEntityChest) return moveToAdjacentChests( - aTileEntity1, - (TileEntityChest) aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer); + aTileEntity1, + (TileEntityChest) aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer); return 0; } @@ -901,17 +890,17 @@ public class GT_Utility { for (int i = 0; i < putStack.size(); i++) { final ItemStack s = putStack.get(i); final int sToPut = Math.min( - Math.min( - Math.min(toPut, s.getMaxStackSize() - s.stackSize), - tPutInventory.getInventoryStackLimit() - s.stackSize), - aMaxTargetStackSize - s.stackSize); + Math.min( + Math.min(toPut, s.getMaxStackSize() - s.stackSize), + tPutInventory.getInventoryStackLimit() - s.stackSize), + aMaxTargetStackSize - s.stackSize); if (sToPut <= 0) continue; if (sToPut < aMinMoveAtOnce) continue; if (s.stackSize + sToPut < aMinTargetStackSize) continue; toPut -= sToPut; s.stackSize += sToPut; if (s.stackSize == s.getMaxStackSize() - || s.stackSize == tPutInventory.getInventoryStackLimit()) { + || s.stackSize == tPutInventory.getInventoryStackLimit()) { // this slot is full. remove this stack from candidate list putStack.remove(i); i--; @@ -941,29 +930,29 @@ public class GT_Utility { if (isAllowedToPutIntoSlot(tPutInventory, tPutSlot, aPutTo, tGrabStack, (byte) 64)) { // allowed, now do moving final int tMoved = moveStackFromSlotAToSlotB( - aTileEntity1, - tPutInventory, - grabSlot, - tPutSlot, - aMaxTargetStackSize, - aMinTargetStackSize, - (byte) (aMaxMoveAtOnce - tMovedItems), - aMinMoveAtOnce); + aTileEntity1, + tPutInventory, + grabSlot, + tPutSlot, + aMaxTargetStackSize, + aMinTargetStackSize, + (byte) (aMaxMoveAtOnce - tMovedItems), + aMinMoveAtOnce); if (tMoved > 0) { final ItemStack s = tPutInventory.getStackInSlot(tPutSlot); if (s != null) { // s might be null if tPutInventory is very special, e.g. infinity chest // if s is null, we will not mark this slot as target candidate for anything - final int spare = Math.min( - s.getMaxStackSize(), - tPutInventory.getInventoryStackLimit()) - s.stackSize; + final int spare = Math + .min(s.getMaxStackSize(), tPutInventory.getInventoryStackLimit()) + - s.stackSize; if (spare > 0) { final ItemId ssID = ItemId.createNoCopy(s); // add back to spare space count tPutItems.merge(ssID, spare, Integer::sum); // add to partially filled slot list tPutItemStacks.computeIfAbsent(ssID, k -> new ArrayList<>()) - .add(s); + .add(s); } // this is no longer free tPutFreeSlots.remove(i); @@ -991,34 +980,34 @@ public class GT_Utility { // check if source is a double chest, if yes, try move from the adjacent as well if (aDoCheckChests && aTileEntity1 instanceof TileEntityChest) { final int tAmount = moveFromAdjacentChests( - (TileEntityChest) aTileEntity1, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer - tStacksMoved); + (TileEntityChest) aTileEntity1, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer - tStacksMoved); if (tAmount != 0) return tAmount + tTotalItemsMoved; } // check if target is a double chest, if yes, try move to the adjacent as well if (aDoCheckChests && aTileEntity2 instanceof TileEntityChest) { final int tAmount = moveToAdjacentChests( - aTileEntity1, - (TileEntityChest) aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer - tStacksMoved); + aTileEntity1, + (TileEntityChest) aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer - tStacksMoved); if (tAmount != 0) return tAmount + tTotalItemsMoved; } @@ -1030,18 +1019,18 @@ public class GT_Utility { final int tGrabInventorySize = tGrabSlots.length; for (int i = 0; i < tGrabInventorySize; i++) { final int tMoved = moveStackIntoPipe( - aTileEntity1, - aTileEntity2, - tGrabSlots, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aDoCheckChests); + aTileEntity1, + aTileEntity2, + tGrabSlots, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aDoCheckChests); if (tMoved == 0) return tTotalItemsMoved; else tTotalItemsMoved += tMoved; } @@ -1049,77 +1038,13 @@ public class GT_Utility { } private static int moveToAdjacentChests(IInventory aTileEntity1, TileEntityChest aTargetChest, byte aGrabFrom, - byte aPutTo, List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, - byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer) { + byte aPutTo, List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer) { if (aTargetChest.adjacentChestChecked) { if (aTargetChest.adjacentChestXNeg != null) { return moveMultipleItemStacks( - aTileEntity1, - aTargetChest.adjacentChestXNeg, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer, - false); - } else if (aTargetChest.adjacentChestZNeg != null) { - return moveMultipleItemStacks( - aTileEntity1, - aTargetChest.adjacentChestZNeg, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer, - false); - } else if (aTargetChest.adjacentChestXPos != null) { - return moveMultipleItemStacks( - aTileEntity1, - aTargetChest.adjacentChestXPos, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer, - false); - } else if (aTargetChest.adjacentChestZPos != null) { - return moveMultipleItemStacks( - aTileEntity1, - aTargetChest.adjacentChestZPos, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer, - false); - } - } - return 0; - } - - private static int moveFromAdjacentChests(TileEntityChest aChest, Object aTileEntity2, byte aGrabFrom, byte aPutTo, - List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer) { - if (aChest.adjacentChestXNeg != null) { - return moveMultipleItemStacks( - aChest.adjacentChestXNeg, - aTileEntity2, + aTileEntity1, + aTargetChest.adjacentChestXNeg, aGrabFrom, aPutTo, aFilter, @@ -1130,10 +1055,10 @@ public class GT_Utility { aMinMoveAtOnce, aMaxStackTransfer, false); - } else if (aChest.adjacentChestZNeg != null) { - return moveMultipleItemStacks( - aChest.adjacentChestZNeg, - aTileEntity2, + } else if (aTargetChest.adjacentChestZNeg != null) { + return moveMultipleItemStacks( + aTileEntity1, + aTargetChest.adjacentChestZNeg, aGrabFrom, aPutTo, aFilter, @@ -1144,10 +1069,10 @@ public class GT_Utility { aMinMoveAtOnce, aMaxStackTransfer, false); - } else if (aChest.adjacentChestXPos != null) { - return moveMultipleItemStacks( - aChest.adjacentChestXPos, - aTileEntity2, + } else if (aTargetChest.adjacentChestXPos != null) { + return moveMultipleItemStacks( + aTileEntity1, + aTargetChest.adjacentChestXPos, aGrabFrom, aPutTo, aFilter, @@ -1158,10 +1083,10 @@ public class GT_Utility { aMinMoveAtOnce, aMaxStackTransfer, false); - } else if (aChest.adjacentChestZPos != null) { - return moveMultipleItemStacks( - aChest.adjacentChestZPos, - aTileEntity2, + } else if (aTargetChest.adjacentChestZPos != null) { + return moveMultipleItemStacks( + aTileEntity1, + aTargetChest.adjacentChestZPos, aGrabFrom, aPutTo, aFilter, @@ -1172,20 +1097,45 @@ public class GT_Utility { aMinMoveAtOnce, aMaxStackTransfer, false); + } } return 0; } - /** - * Moves Stack from Inv-Side to Inv-Side. - * - * @return the Amount of moved Items - */ - public static byte moveOneItemStack(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, - List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { - if (aTileEntity1 instanceof IInventory) return moveOneItemStack( - (IInventory) aTileEntity1, + private static int moveFromAdjacentChests(TileEntityChest aChest, Object aTileEntity2, byte aGrabFrom, byte aPutTo, + List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer) { + if (aChest.adjacentChestXNeg != null) { + return moveMultipleItemStacks( + aChest.adjacentChestXNeg, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer, + false); + } else if (aChest.adjacentChestZNeg != null) { + return moveMultipleItemStacks( + aChest.adjacentChestZNeg, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer, + false); + } else if (aChest.adjacentChestXPos != null) { + return moveMultipleItemStacks( + aChest.adjacentChestXPos, aTileEntity2, aGrabFrom, aPutTo, @@ -1195,7 +1145,46 @@ public class GT_Utility { aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, - true); + aMaxStackTransfer, + false); + } else if (aChest.adjacentChestZPos != null) { + return moveMultipleItemStacks( + aChest.adjacentChestZPos, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer, + false); + } + return 0; + } + + /** + * Moves Stack from Inv-Side to Inv-Side. + * + * @return the Amount of moved Items + */ + public static byte moveOneItemStack(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, + List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + if (aTileEntity1 instanceof IInventory) return moveOneItemStack( + (IInventory) aTileEntity1, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + true); return 0; } @@ -1203,14 +1192,13 @@ public class GT_Utility { * This is only because I needed an additional Parameter for the Double Chest Check. */ private static byte moveOneItemStack(IInventory aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, - List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean aDoCheckChests) { + List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean aDoCheckChests) { if (aTileEntity1 == null || aMaxTargetStackSize <= 0 - || aMinTargetStackSize <= 0 - || aMaxMoveAtOnce <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMinMoveAtOnce > aMaxMoveAtOnce) - return 0; + || aMinTargetStackSize <= 0 + || aMaxMoveAtOnce <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; int[] tGrabSlots = null; if (aTileEntity1 instanceof ISidedInventory) @@ -1235,26 +1223,25 @@ public class GT_Utility { ItemStack tGrabStack = aTileEntity1.getStackInSlot(tGrabSlot); if (listContainsItem(aFilter, tGrabStack, true, aInvertFilter)) { if (tGrabStack.stackSize >= aMinMoveAtOnce - && isAllowedToTakeFromSlot(aTileEntity1, tGrabSlot, aGrabFrom, tGrabStack)) { + && isAllowedToTakeFromSlot(aTileEntity1, tGrabSlot, aGrabFrom, tGrabStack)) { for (int tPutSlot : tPutSlots) { if (isAllowedToPutIntoSlot( + (IInventory) aTileEntity2, + tPutSlot, + aPutTo, + tGrabStack, + aMaxTargetStackSize)) { + tMovedItemCount += moveStackFromSlotAToSlotB( + aTileEntity1, (IInventory) aTileEntity2, + tGrabSlot, tPutSlot, - aPutTo, - tGrabStack, - aMaxTargetStackSize)) { - tMovedItemCount += moveStackFromSlotAToSlotB( - aTileEntity1, - (IInventory) aTileEntity2, - tGrabSlot, - tPutSlot, - aMaxTargetStackSize, - aMinTargetStackSize, - (byte) (aMaxMoveAtOnce - tMovedItemCount), - aMinMoveAtOnce); + aMaxTargetStackSize, + aMinTargetStackSize, + (byte) (aMaxMoveAtOnce - tMovedItemCount), + aMinMoveAtOnce); if (tMovedItemCount >= aMaxMoveAtOnce - || (tMovedItemCount > 0 && aMaxTargetStackSize < 64)) - return tMovedItemCount; + || (tMovedItemCount > 0 && aMaxTargetStackSize < 64)) return tMovedItemCount; } } } @@ -1267,56 +1254,56 @@ public class GT_Utility { byte tAmount = 0; if (tTileEntity1.adjacentChestXNeg != null) { tAmount = moveOneItemStack( - tTileEntity1.adjacentChestXNeg, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + tTileEntity1.adjacentChestXNeg, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity1.adjacentChestZNeg != null) { tAmount = moveOneItemStack( - tTileEntity1.adjacentChestZNeg, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + tTileEntity1.adjacentChestZNeg, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity1.adjacentChestXPos != null) { tAmount = moveOneItemStack( - tTileEntity1.adjacentChestXPos, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + tTileEntity1.adjacentChestXPos, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity1.adjacentChestZPos != null) { tAmount = moveOneItemStack( - tTileEntity1.adjacentChestZPos, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + tTileEntity1.adjacentChestZPos, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } if (tAmount != 0) return tAmount; } @@ -1326,56 +1313,56 @@ public class GT_Utility { byte tAmount = 0; if (tTileEntity2.adjacentChestXNeg != null) { tAmount = moveOneItemStack( - aTileEntity1, - tTileEntity2.adjacentChestXNeg, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + aTileEntity1, + tTileEntity2.adjacentChestXNeg, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity2.adjacentChestZNeg != null) { tAmount = moveOneItemStack( - aTileEntity1, - tTileEntity2.adjacentChestZNeg, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + aTileEntity1, + tTileEntity2.adjacentChestZNeg, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity2.adjacentChestXPos != null) { tAmount = moveOneItemStack( - aTileEntity1, - tTileEntity2.adjacentChestXPos, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + aTileEntity1, + tTileEntity2.adjacentChestXPos, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity2.adjacentChestZPos != null) { tAmount = moveOneItemStack( - aTileEntity1, - tTileEntity2.adjacentChestZPos, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + aTileEntity1, + tTileEntity2.adjacentChestZPos, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } if (tAmount != 0) return tAmount; } @@ -1383,18 +1370,18 @@ public class GT_Utility { } return moveStackIntoPipe( - aTileEntity1, - aTileEntity2, - tGrabSlots, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aDoCheckChests); + aTileEntity1, + aTileEntity2, + tGrabSlots, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aDoCheckChests); } /** @@ -1403,16 +1390,15 @@ public class GT_Utility { * @return the Amount of moved Items */ public static byte moveOneItemStackIntoSlot(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, int aPutTo, - List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { if (aTileEntity1 == null || !(aTileEntity1 instanceof IInventory) - || aPutTo < 0 - || aMaxTargetStackSize <= 0 - || aMinTargetStackSize <= 0 - || aMaxMoveAtOnce <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMinMoveAtOnce > aMaxMoveAtOnce) - return 0; + || aPutTo < 0 + || aMaxTargetStackSize <= 0 + || aMinTargetStackSize <= 0 + || aMaxMoveAtOnce <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; int[] tGrabSlots = null; if (aTileEntity1 instanceof ISidedInventory) @@ -1425,30 +1411,30 @@ public class GT_Utility { if (aTileEntity2 instanceof IInventory) { for (int tGrabSlot : tGrabSlots) { if (listContainsItem( - aFilter, - ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot), - true, - aInvertFilter)) { + aFilter, + ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot), + true, + aInvertFilter)) { if (isAllowedToTakeFromSlot( - (IInventory) aTileEntity1, - tGrabSlot, - aGrabFrom, - ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot))) { + (IInventory) aTileEntity1, + tGrabSlot, + aGrabFrom, + ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot))) { if (isAllowedToPutIntoSlot( + (IInventory) aTileEntity2, + aPutTo, + (byte) 6, + ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot), + aMaxTargetStackSize)) { + byte tMovedItemCount = moveStackFromSlotAToSlotB( + (IInventory) aTileEntity1, (IInventory) aTileEntity2, + tGrabSlot, aPutTo, - (byte) 6, - ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot), - aMaxTargetStackSize)) { - byte tMovedItemCount = moveStackFromSlotAToSlotB( - (IInventory) aTileEntity1, - (IInventory) aTileEntity2, - tGrabSlot, - aPutTo, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce); + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce); if (tMovedItemCount > 0) return tMovedItemCount; } } @@ -1457,17 +1443,17 @@ public class GT_Utility { } moveStackIntoPipe( - ((IInventory) aTileEntity1), - aTileEntity2, - tGrabSlots, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce); + ((IInventory) aTileEntity1), + aTileEntity2, + tGrabSlots, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce); return 0; } @@ -1477,34 +1463,33 @@ public class GT_Utility { * @return the Amount of moved Items */ public static byte moveFromSlotToSlot(IInventory aTileEntity1, IInventory aTileEntity2, int aGrabFrom, int aPutTo, - List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { if (aTileEntity1 == null || aTileEntity2 == null - || aGrabFrom < 0 - || aPutTo < 0 - || aMaxTargetStackSize <= 0 - || aMinTargetStackSize <= 0 - || aMaxMoveAtOnce <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMinMoveAtOnce > aMaxMoveAtOnce) - return 0; + || aGrabFrom < 0 + || aPutTo < 0 + || aMaxTargetStackSize <= 0 + || aMinTargetStackSize <= 0 + || aMaxMoveAtOnce <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabFrom), true, aInvertFilter)) { if (isAllowedToTakeFromSlot(aTileEntity1, aGrabFrom, (byte) 6, aTileEntity1.getStackInSlot(aGrabFrom))) { if (isAllowedToPutIntoSlot( + aTileEntity2, + aPutTo, + (byte) 6, + aTileEntity1.getStackInSlot(aGrabFrom), + aMaxTargetStackSize)) { + byte tMovedItemCount = moveStackFromSlotAToSlotB( + aTileEntity1, aTileEntity2, + aGrabFrom, aPutTo, - (byte) 6, - aTileEntity1.getStackInSlot(aGrabFrom), - aMaxTargetStackSize)) { - byte tMovedItemCount = moveStackFromSlotAToSlotB( - aTileEntity1, - aTileEntity2, - aGrabFrom, - aPutTo, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce); + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce); if (tMovedItemCount > 0) return tMovedItemCount; } } @@ -1518,18 +1503,16 @@ public class GT_Utility { * @return the Amount of moved Items */ public static byte moveFromSlotToSide(IInventory fromTile, Object toTile, int aGrabFrom, byte aPutTo, - List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean aDoCheckChests) { + List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean aDoCheckChests) { if (fromTile == null || aGrabFrom < 0 - || aMinTargetStackSize <= 0 - || aMaxMoveAtOnce <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMinMoveAtOnce > aMaxMoveAtOnce) - return 0; + || aMinTargetStackSize <= 0 + || aMaxMoveAtOnce <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; if (!listContainsItem(aFilter, fromTile.getStackInSlot(aGrabFrom), true, aInvertFilter) - || !isAllowedToTakeFromSlot(fromTile, aGrabFrom, (byte) 6, fromTile.getStackInSlot(aGrabFrom))) - return 0; + || !isAllowedToTakeFromSlot(fromTile, aGrabFrom, (byte) 6, fromTile.getStackInSlot(aGrabFrom))) return 0; if (toTile instanceof IInventory) { int[] tPutSlots = null; @@ -1544,20 +1527,20 @@ public class GT_Utility { byte tMovedItemCount = 0; for (int tPutSlot : tPutSlots) { if (isAllowedToPutIntoSlot( + (IInventory) toTile, + tPutSlot, + aPutTo, + fromTile.getStackInSlot(aGrabFrom), + aMaxTargetStackSize)) { + tMovedItemCount += moveStackFromSlotAToSlotB( + fromTile, (IInventory) toTile, + aGrabFrom, tPutSlot, - aPutTo, - fromTile.getStackInSlot(aGrabFrom), - aMaxTargetStackSize)) { - tMovedItemCount += moveStackFromSlotAToSlotB( - fromTile, - (IInventory) toTile, - aGrabFrom, - tPutSlot, - aMaxTargetStackSize, - aMinTargetStackSize, - (byte) (aMaxMoveAtOnce - tMovedItemCount), - aMinMoveAtOnce); + aMaxTargetStackSize, + aMinTargetStackSize, + (byte) (aMaxMoveAtOnce - tMovedItemCount), + aMinMoveAtOnce); if (tMovedItemCount >= aMaxMoveAtOnce) { return tMovedItemCount; } @@ -1569,95 +1552,95 @@ public class GT_Utility { if (tTileEntity2.adjacentChestChecked) { if (tTileEntity2.adjacentChestXNeg != null) { tMovedItemCount = moveFromSlotToSide( - fromTile, - tTileEntity2.adjacentChestXNeg, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + fromTile, + tTileEntity2.adjacentChestXNeg, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity2.adjacentChestZNeg != null) { tMovedItemCount = moveFromSlotToSide( - fromTile, - tTileEntity2.adjacentChestZNeg, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + fromTile, + tTileEntity2.adjacentChestZNeg, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity2.adjacentChestXPos != null) { tMovedItemCount = moveFromSlotToSide( - fromTile, - tTileEntity2.adjacentChestXPos, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + fromTile, + tTileEntity2.adjacentChestXPos, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity2.adjacentChestZPos != null) { tMovedItemCount = moveFromSlotToSide( - fromTile, - tTileEntity2.adjacentChestZPos, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + fromTile, + tTileEntity2.adjacentChestZPos, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } if (tMovedItemCount > 0) return tMovedItemCount; } } } return moveStackIntoPipe( - fromTile, - toTile, - new int[] { aGrabFrom }, - (byte) 6, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aDoCheckChests); + fromTile, + toTile, + new int[] { aGrabFrom }, + (byte) 6, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aDoCheckChests); } public static byte moveFromSlotToSide(IInventory fromTile, Object toTile, int aGrabFrom, byte aPutTo, - List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { return moveFromSlotToSide( - fromTile, - toTile, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - true); + fromTile, + toTile, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + true); } public static boolean listContainsItem(Collection<ItemStack> aList, ItemStack aStack, boolean aTIfListEmpty, - boolean aInvertFilter) { + boolean aInvertFilter) { if (aStack == null || aStack.stackSize < 1) return false; if (aList == null) return aTIfListEmpty; boolean tEmpty = true; @@ -1675,14 +1658,13 @@ public class GT_Utility { public static boolean areStacksOrToolsEqual(ItemStack aStack1, ItemStack aStack2) { if (aStack1 != null && aStack2 != null && aStack1.getItem() == aStack2.getItem()) { if (aStack1.getItem() - .isDamageable()) - return true; + .isDamageable()) return true; return ((aStack1.getTagCompound() == null) == (aStack2.getTagCompound() == null)) - && (aStack1.getTagCompound() == null || aStack1.getTagCompound() - .equals(aStack2.getTagCompound())) - && (Items.feather.getDamage(aStack1) == Items.feather.getDamage(aStack2) - || Items.feather.getDamage(aStack1) == W - || Items.feather.getDamage(aStack2) == W); + && (aStack1.getTagCompound() == null || aStack1.getTagCompound() + .equals(aStack2.getTagCompound())) + && (Items.feather.getDamage(aStack1) == Items.feather.getDamage(aStack2) + || Items.feather.getDamage(aStack1) == W + || Items.feather.getDamage(aStack2) == W); } return false; } @@ -1693,9 +1675,9 @@ public class GT_Utility { public static boolean areFluidsEqual(FluidStack aFluid1, FluidStack aFluid2, boolean aIgnoreNBT) { return aFluid1 != null && aFluid2 != null - && aFluid1.getFluid() == aFluid2.getFluid() - && (aIgnoreNBT || ((aFluid1.tag == null) == (aFluid2.tag == null)) - && (aFluid1.tag == null || aFluid1.tag.equals(aFluid2.tag))); + && aFluid1.getFluid() == aFluid2.getFluid() + && (aIgnoreNBT || ((aFluid1.tag == null) == (aFluid2.tag == null)) + && (aFluid1.tag == null || aFluid1.tag.equals(aFluid2.tag))); } public static boolean areStacksEqual(ItemStack aStack1, ItemStack aStack2) { @@ -1704,13 +1686,13 @@ public class GT_Utility { public static boolean areStacksEqual(ItemStack aStack1, ItemStack aStack2, boolean aIgnoreNBT) { return aStack1 != null && aStack2 != null - && aStack1.getItem() == aStack2.getItem() - && (aIgnoreNBT || (((aStack1.getTagCompound() == null) == (aStack2.getTagCompound() == null)) - && (aStack1.getTagCompound() == null || aStack1.getTagCompound() - .equals(aStack2.getTagCompound())))) - && (Items.feather.getDamage(aStack1) == Items.feather.getDamage(aStack2) - || Items.feather.getDamage(aStack1) == W - || Items.feather.getDamage(aStack2) == W); + && aStack1.getItem() == aStack2.getItem() + && (aIgnoreNBT || (((aStack1.getTagCompound() == null) == (aStack2.getTagCompound() == null)) + && (aStack1.getTagCompound() == null || aStack1.getTagCompound() + .equals(aStack2.getTagCompound())))) + && (Items.feather.getDamage(aStack1) == Items.feather.getDamage(aStack2) + || Items.feather.getDamage(aStack1) == W + || Items.feather.getDamage(aStack2) == W); } /** @@ -1719,7 +1701,7 @@ public class GT_Utility { * Since ItemStack doesn't override equals and hashCode, you cannot just use Objects.equals */ public static boolean areStackListsEqual(List<ItemStack> lhs, List<ItemStack> rhs, boolean ignoreStackSize, - boolean ignoreNBT) { + boolean ignoreNBT) { if (lhs == null) return rhs == null; if (rhs == null) return false; if (lhs.size() != rhs.size()) return false; @@ -1730,12 +1712,12 @@ public class GT_Utility { } private static boolean areStacksEqualExtended(ItemStack lhs, ItemStack rhs, boolean ignoreStackSize, - boolean ignoreNBT) { + boolean ignoreNBT) { if (lhs == null) return rhs == null; if (rhs == null) return false; return lhs.getItem() == rhs.getItem() - && (ignoreNBT || Objects.equals(lhs.stackTagCompound, rhs.stackTagCompound)) - && (ignoreStackSize || lhs.stackSize == rhs.stackSize); + && (ignoreNBT || Objects.equals(lhs.stackTagCompound, rhs.stackTagCompound)) + && (ignoreStackSize || lhs.stackSize == rhs.stackSize); } public static boolean areUnificationsEqual(ItemStack aStack1, ItemStack aStack2) { @@ -1744,17 +1726,17 @@ public class GT_Utility { public static boolean areUnificationsEqual(ItemStack aStack1, ItemStack aStack2, boolean aIgnoreNBT) { return areStacksEqual( - GT_OreDictUnificator.get_nocopy(aStack1), - GT_OreDictUnificator.get_nocopy(aStack2), - aIgnoreNBT); + GT_OreDictUnificator.get_nocopy(aStack1), + GT_OreDictUnificator.get_nocopy(aStack2), + aIgnoreNBT); } public static String getFluidName(Fluid aFluid, boolean aLocalized) { if (aFluid == null) return E; String rName = aLocalized ? aFluid.getLocalizedName(new FluidStack(aFluid, 0)) : aFluid.getUnlocalizedName(); if (rName.contains("fluid.") || rName.contains("tile.")) return capitalizeString( - rName.replaceAll("fluid.", E) - .replaceAll("tile.", E)); + rName.replaceAll("fluid.", E) + .replaceAll("tile.", E)); return rName; } @@ -1770,13 +1752,12 @@ public class GT_Utility { sFluidUnlocalizedNameToFluid.clear(); for (FluidContainerData tData : sFluidContainerList) { sFilledContainerToData.put(new GT_ItemStack(tData.filledContainer), tData); - Map<Fluid, FluidContainerData> tFluidToContainer = sEmptyContainerToFluidToData.get( - new GT_ItemStack(tData.emptyContainer)); + Map<Fluid, FluidContainerData> tFluidToContainer = sEmptyContainerToFluidToData + .get(new GT_ItemStack(tData.emptyContainer)); List<ItemStack> tContainers = sFluidToContainers.get(tData.fluid.getFluid()); if (tFluidToContainer == null) { - sEmptyContainerToFluidToData.put( - new GT_ItemStack(tData.emptyContainer), - tFluidToContainer = new /* Concurrent */ HashMap<>()); + sEmptyContainerToFluidToData + .put(new GT_ItemStack(tData.emptyContainer), tFluidToContainer = new /* Concurrent */ HashMap<>()); GregTech_API.sFluidMappings.add(tFluidToContainer); } tFluidToContainer.put(tData.fluid.getFluid(), tData); @@ -1787,7 +1768,7 @@ public class GT_Utility { } else tContainers.add(tData.filledContainer); } for (Fluid tFluid : FluidRegistry.getRegisteredFluids() - .values()) { + .values()) { sFluidUnlocalizedNameToFluid.put(tFluid.getUnlocalizedName(), tFluid); } } @@ -1799,13 +1780,12 @@ public class GT_Utility { public static void addFluidContainerData(FluidContainerData aData) { sFluidContainerList.add(aData); sFilledContainerToData.put(new GT_ItemStack(aData.filledContainer), aData); - Map<Fluid, FluidContainerData> tFluidToContainer = sEmptyContainerToFluidToData.get( - new GT_ItemStack(aData.emptyContainer)); + Map<Fluid, FluidContainerData> tFluidToContainer = sEmptyContainerToFluidToData + .get(new GT_ItemStack(aData.emptyContainer)); List<ItemStack> tContainers = sFluidToContainers.get(aData.fluid.getFluid()); if (tFluidToContainer == null) { - sEmptyContainerToFluidToData.put( - new GT_ItemStack(aData.emptyContainer), - tFluidToContainer = new /* Concurrent */ HashMap<>()); + sEmptyContainerToFluidToData + .put(new GT_ItemStack(aData.emptyContainer), tFluidToContainer = new /* Concurrent */ HashMap<>()); GregTech_API.sFluidMappings.add(tFluidToContainer); } tFluidToContainer.put(aData.fluid.getFluid(), aData); @@ -1826,7 +1806,7 @@ public class GT_Utility { } public static ItemStack fillFluidContainer(FluidStack aFluid, ItemStack aStack, boolean aRemoveFluidDirectly, - boolean aCheckIFluidContainerItems) { + boolean aCheckIFluidContainerItems) { if (isStackInvalid(aStack) || aFluid == null) return null; if (GT_ModHandler.isWater(aFluid) && ItemList.Bottle_Empty.isStackEqual(aStack)) { if (aFluid.amount >= 250) { @@ -1836,12 +1816,10 @@ public class GT_Utility { return null; } if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem - && ((IFluidContainerItem) aStack.getItem()).getFluid(aStack) == null - && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) <= aFluid.amount) { - if (aRemoveFluidDirectly) aFluid.amount -= ((IFluidContainerItem) aStack.getItem()).fill( - aStack = copyAmount(1, aStack), - aFluid, - true); + && ((IFluidContainerItem) aStack.getItem()).getFluid(aStack) == null + && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) <= aFluid.amount) { + if (aRemoveFluidDirectly) aFluid.amount -= ((IFluidContainerItem) aStack.getItem()) + .fill(aStack = copyAmount(1, aStack), aFluid, true); else((IFluidContainerItem) aStack.getItem()).fill(aStack = copyAmount(1, aStack), aFluid, true); return aStack; } @@ -1855,7 +1833,7 @@ public class GT_Utility { public static int calculateRecipeEU(Materials aMaterial, int defaultRecipeEUPerTick) { return aMaterial.getProcessingMaterialTierEU() == 0 ? defaultRecipeEUPerTick - : aMaterial.getProcessingMaterialTierEU(); + : aMaterial.getProcessingMaterialTierEU(); } public static ItemStack getFluidDisplayStack(Fluid aFluid) { @@ -1871,7 +1849,7 @@ public class GT_Utility { int tmp = 0; try { tmp = aFluid.getFluid() - .getID(); + .getID(); } catch (Exception e) { System.err.println(e); } @@ -1879,13 +1857,13 @@ public class GT_Utility { NBTTagCompound tNBT = new NBTTagCompound(); tNBT.setLong("mFluidDisplayAmount", aUseStackSize ? aFluid.amount : 0); tNBT.setLong( - "mFluidDisplayHeat", - aFluid.getFluid() - .getTemperature(aFluid)); + "mFluidDisplayHeat", + aFluid.getFluid() + .getTemperature(aFluid)); tNBT.setBoolean( - "mFluidState", - aFluid.getFluid() - .isGaseous(aFluid)); + "mFluidState", + aFluid.getFluid() + .isGaseous(aFluid)); tNBT.setBoolean("mHideStackSize", aHideStackSize); try { tNBT.setString("mFluidMaterialName", FLUID_MAP.get(aFluid.getFluid()).mName); @@ -1896,23 +1874,22 @@ public class GT_Utility { public static FluidStack getFluidFromDisplayStack(ItemStack aDisplayStack) { if (!isStackValid(aDisplayStack) || aDisplayStack.getItem() != ItemList.Display_Fluid.getItem() - || !aDisplayStack.hasTagCompound()) - return null; + || !aDisplayStack.hasTagCompound()) return null; Fluid tFluid = FluidRegistry.getFluid( - ItemList.Display_Fluid.getItem() - .getDamage(aDisplayStack)); + ItemList.Display_Fluid.getItem() + .getDamage(aDisplayStack)); return new FluidStack( - tFluid, - (int) aDisplayStack.getTagCompound() - .getLong("mFluidDisplayAmount")); + tFluid, + (int) aDisplayStack.getTagCompound() + .getLong("mFluidDisplayAmount")); } public static boolean containsFluid(ItemStack aStack, FluidStack aFluid, boolean aCheckIFluidContainerItems) { if (isStackInvalid(aStack) || aFluid == null) return false; if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem - && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) - return aFluid.isFluidEqual( - ((IFluidContainerItem) aStack.getItem()).getFluid(aStack = copyAmount(1, aStack))); + && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) + return aFluid + .isFluidEqual(((IFluidContainerItem) aStack.getItem()).getFluid(aStack = copyAmount(1, aStack))); FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack)); return tData != null && tData.fluid.isFluidEqual(aFluid); } @@ -1920,7 +1897,7 @@ public class GT_Utility { public static FluidStack getFluidForFilledItem(ItemStack aStack, boolean aCheckIFluidContainerItems) { if (isStackInvalid(aStack)) return null; if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem - && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) + && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) return ((IFluidContainerItem) aStack.getItem()).drain(copyAmount(1, aStack), Integer.MAX_VALUE, true); FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack)); return tData == null ? null : tData.fluid.copy(); @@ -1934,7 +1911,7 @@ public class GT_Utility { FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack)); if (tData != null) return copyAmount(1, tData.emptyContainer); if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem - && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) { + && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) { ((IFluidContainerItem) aStack.getItem()).drain(aStack = copyAmount(1, aStack), Integer.MAX_VALUE, true); return aStack; } @@ -1948,20 +1925,19 @@ public class GT_Utility { public static ItemStack getContainerItem(ItemStack aStack, boolean aCheckIFluidContainerItems) { if (isStackInvalid(aStack)) return null; if (aStack.getItem() - .hasContainerItem(aStack)) + .hasContainerItem(aStack)) return aStack.getItem() - .getContainerItem(aStack); + .getContainerItem(aStack); /** * These are all special Cases, in which it is intended to have only GT Blocks outputting those Container Items */ if (ItemList.Cell_Empty.isStackEqual(aStack, false, true)) return null; if (aStack.getItem() == Items.potionitem || aStack.getItem() == Items.experience_bottle - || ItemList.TF_Vial_FieryBlood.isStackEqual(aStack) - || ItemList.TF_Vial_FieryTears.isStackEqual(aStack)) - return ItemList.Bottle_Empty.get(1); + || ItemList.TF_Vial_FieryBlood.isStackEqual(aStack) + || ItemList.TF_Vial_FieryTears.isStackEqual(aStack)) return ItemList.Bottle_Empty.get(1); if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem - && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) { + && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) { ItemStack tStack = copyAmount(1, aStack); ((IFluidContainerItem) aStack.getItem()).drain(tStack, Integer.MAX_VALUE, true); if (!areStacksEqual(aStack, tStack)) return tStack; @@ -1985,17 +1961,18 @@ public class GT_Utility { } public static synchronized boolean removeIC2BottleRecipe(ItemStack aContainer, ItemStack aInput, - Map<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput> aRecipeList, ItemStack aOutput) { + Map<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput> aRecipeList, ItemStack aOutput) { if ((isStackInvalid(aInput) && isStackInvalid(aOutput) && isStackInvalid(aContainer)) || aRecipeList == null) return false; boolean rReturn = false; - Iterator<Map.Entry<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput>> tIterator = aRecipeList.entrySet() - .iterator(); + Iterator<Map.Entry<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput>> tIterator = aRecipeList + .entrySet() + .iterator(); aOutput = GT_OreDictUnificator.get(aOutput); while (tIterator.hasNext()) { Map.Entry<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput> tEntry = tIterator.next(); if (aInput == null || tEntry.getKey() - .matches(aContainer, aInput)) { + .matches(aContainer, aInput)) { List<ItemStack> tList = tEntry.getValue().items; if (tList != null) for (ItemStack tOutput : tList) if (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)) { @@ -2009,16 +1986,16 @@ public class GT_Utility { } public static synchronized boolean removeSimpleIC2MachineRecipe(ItemStack aInput, - Map<IRecipeInput, RecipeOutput> aRecipeList, ItemStack aOutput) { + Map<IRecipeInput, RecipeOutput> aRecipeList, ItemStack aOutput) { if ((isStackInvalid(aInput) && isStackInvalid(aOutput)) || aRecipeList == null) return false; boolean rReturn = false; Iterator<Map.Entry<IRecipeInput, RecipeOutput>> tIterator = aRecipeList.entrySet() - .iterator(); + .iterator(); aOutput = GT_OreDictUnificator.get(aOutput); while (tIterator.hasNext()) { Map.Entry<IRecipeInput, RecipeOutput> tEntry = tIterator.next(); if (aInput == null || tEntry.getKey() - .matches(aInput)) { + .matches(aInput)) { List<ItemStack> tList = tEntry.getValue().items; if (tList != null) for (ItemStack tOutput : tList) if (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)) { @@ -2032,38 +2009,34 @@ public class GT_Utility { } public static synchronized void bulkRemoveSimpleIC2MachineRecipe(Map<ItemStack, ItemStack> toRemove, - Map<IRecipeInput, RecipeOutput> aRecipeList) { + Map<IRecipeInput, RecipeOutput> aRecipeList) { if (aRecipeList == null || aRecipeList.isEmpty()) return; toRemove.entrySet() - .removeIf(aEntry -> (isStackInvalid(aEntry.getKey()) && isStackInvalid(aEntry.getValue()))); - final Map<ItemStack, ItemStack> finalToRemove = Maps.transformValues( - toRemove, - GT_OreDictUnificator::get_nocopy); + .removeIf(aEntry -> (isStackInvalid(aEntry.getKey()) && isStackInvalid(aEntry.getValue()))); + final Map<ItemStack, ItemStack> finalToRemove = Maps + .transformValues(toRemove, GT_OreDictUnificator::get_nocopy); aRecipeList.entrySet() - .removeIf( - tEntry -> finalToRemove.entrySet() - .stream() - .anyMatch(aEntry -> { - final ItemStack aInput = aEntry.getKey(), - aOutput = aEntry.getValue(); - final List<ItemStack> tList = tEntry.getValue().items; - - if (tList == null) return false; - if (aInput != null && !tEntry.getKey() - .matches(aInput)) - return false; - - return tList.stream() - .anyMatch( - tOutput -> (aOutput == null || areStacksEqual( - GT_OreDictUnificator.get(tOutput), - aOutput))); - })); + .removeIf( + tEntry -> finalToRemove.entrySet() + .stream() + .anyMatch(aEntry -> { + final ItemStack aInput = aEntry.getKey(), aOutput = aEntry.getValue(); + final List<ItemStack> tList = tEntry.getValue().items; + + if (tList == null) return false; + if (aInput != null && !tEntry.getKey() + .matches(aInput)) return false; + + return tList.stream() + .anyMatch( + tOutput -> (aOutput == null + || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput))); + })); } public static boolean addSimpleIC2MachineRecipe(ItemStack aInput, Map<IRecipeInput, RecipeOutput> aRecipeList, - NBTTagCompound aNBT, Object... aOutput) { + NBTTagCompound aNBT, Object... aOutput) { if (isStackInvalid(aInput) || aOutput.length == 0 || aRecipeList == null) return false; ItemData tOreName = GT_OreDictUnificator.getAssociation(aInput); for (Object o : aOutput) { @@ -2076,17 +2049,15 @@ public class GT_Utility { if (tStack.length > 0 && areStacksEqual(aInput, tStack[0])) return false; if (tOreName != null) { if (tOreName.toString() - .equals("dustAsh") - && tStack[0].getUnlocalizedName() - .equals("tile.volcanicAsh")) + .equals("dustAsh") + && tStack[0].getUnlocalizedName() + .equals("tile.volcanicAsh")) return false; - aRecipeList.put( - new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), - new RecipeOutput(aNBT, tStack)); + aRecipeList + .put(new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), new RecipeOutput(aNBT, tStack)); } else { - aRecipeList.put( - new RecipeInputItemStack(copyOrNull(aInput), aInput.stackSize), - new RecipeOutput(aNBT, tStack)); + aRecipeList + .put(new RecipeInputItemStack(copyOrNull(aInput), aInput.stackSize), new RecipeOutput(aNBT, tStack)); } return true; } @@ -2114,9 +2085,8 @@ public class GT_Utility { tNBT.setString("author", aAuthor); NBTTagList tNBTList = new NBTTagList(); for (byte i = 0; i < aPages.length; i++) { - aPages[i] = GT_LanguageManager.addStringLocalization( - "Book." + aTitle + ".Page" + ((i < 10) ? "0" + i : i), - aPages[i]); + aPages[i] = GT_LanguageManager + .addStringLocalization("Book." + aTitle + ".Page" + ((i < 10) ? "0" + i : i), aPages[i]); if (i < 48) { if (aPages[i].length() < 256) tNBTList.appendTag(new NBTTagString(aPages[i])); else GT_Log.err.println("WARNING: String for written Book too long! -> " + aPages[i]); @@ -2126,20 +2096,20 @@ public class GT_Utility { } } tNBTList.appendTag( - new NBTTagString( - "Credits to " + aAuthor - + " for writing this Book. This was Book Nr. " - + sBookCount - + " at its creation. Gotta get 'em all!")); + new NBTTagString( + "Credits to " + aAuthor + + " for writing this Book. This was Book Nr. " + + sBookCount + + " at its creation. Gotta get 'em all!")); tNBT.setTag("pages", tNBTList); rStack.setTagCompound(tNBT); GT_Log.out.println( - "GT_Mod: Added Book to Book List - Mapping: '" + aMapping - + "' - Name: '" - + aTitle - + "' - Author: '" - + aAuthor - + "'"); + "GT_Mod: Added Book to Book List - Mapping: '" + aMapping + + "' - Name: '" + + aTitle + + "' - Author: '" + + aAuthor + + "'"); GregTech_API.sBookList.put(aMapping, rStack); return copyOrNull(rStack); } @@ -2154,36 +2124,36 @@ public class GT_Utility { } public static boolean doSoundAtClient(ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound, - float aSoundStrength) { + float aSoundStrength) { return doSoundAtClient(aSoundResourceLocation, aTimeUntilNextSound, aSoundStrength, GT.getThePlayer()); } public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, - Entity aEntity) { + Entity aEntity) { if (aEntity == null || aSoundName == null) return false; return doSoundAtClient( - aSoundName, - aTimeUntilNextSound, - aSoundStrength, - aEntity.posX, - aEntity.posY, - aEntity.posZ); + aSoundName, + aTimeUntilNextSound, + aSoundStrength, + aEntity.posX, + aEntity.posY, + aEntity.posZ); } public static boolean doSoundAtClient(ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound, - float aSoundStrength, Entity aEntity) { + float aSoundStrength, Entity aEntity) { if (aEntity == null) return false; return doSoundAtClient( - aSoundResourceLocation.toString(), - aTimeUntilNextSound, - aSoundStrength, - aEntity.posX, - aEntity.posY, - aEntity.posZ); + aSoundResourceLocation.toString(), + aTimeUntilNextSound, + aSoundStrength, + aEntity.posX, + aEntity.posY, + aEntity.posZ); } public static boolean doSoundAtClient(ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound, - float aSoundStrength, double aX, double aY, double aZ) { + float aSoundStrength, double aX, double aY, double aZ) { return doSoundAtClient(aSoundResourceLocation, aTimeUntilNextSound, aSoundStrength, 1.01818028F, aX, aY, aZ); } @@ -2193,55 +2163,42 @@ public class GT_Utility { */ @Deprecated public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, double aX, - double aY, double aZ) { + double aY, double aZ) { if (aSoundName == null) return false; return doSoundAtClient( - new ResourceLocation(aSoundName), - aTimeUntilNextSound, - aSoundStrength, - 1.01818028F, - aX, - aY, - aZ); + new ResourceLocation(aSoundName), + aTimeUntilNextSound, + aSoundStrength, + 1.01818028F, + aX, + aY, + aZ); } public static boolean doSoundAtClient(SoundResource aSound, int aTimeUntilNextSound, float aSoundStrength, - double aX, double aY, double aZ) { + double aX, double aY, double aZ) { return doSoundAtClient(aSound.resourceLocation, aTimeUntilNextSound, aSoundStrength, aX, aY, aZ); } public static boolean doSoundAtClient(SoundResource aSound, int aTimeUntilNextSound, float aSoundStrength, - float aSoundModulation, double aX, double aY, double aZ) { + float aSoundModulation, double aX, double aY, double aZ) { return doSoundAtClient( - aSound.resourceLocation, - aTimeUntilNextSound, - aSoundStrength, - aSoundModulation, - aX, - aY, - aZ); + aSound.resourceLocation, + aTimeUntilNextSound, + aSoundStrength, + aSoundModulation, + aX, + aY, + aZ); } public static boolean doSoundAtClient(ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound, - float aSoundStrength, float aSoundModulation, double aX, double aY, double aZ) { + float aSoundStrength, float aSoundModulation, double aX, double aY, double aZ) { if (!FMLCommonHandler.instance() - .getEffectiveSide() - .isClient() - || GT.getThePlayer() == null - || !GT.getThePlayer().worldObj.isRemote) - return false; + .getEffectiveSide() + .isClient() || GT.getThePlayer() == null || !GT.getThePlayer().worldObj.isRemote) return false; if (GregTech_API.sMultiThreadedSounds) new Thread( - new GT_Runnable_Sound( - GT.getThePlayer().worldObj, - aX, - aY, - aZ, - aTimeUntilNextSound, - aSoundResourceLocation, - aSoundStrength, - aSoundModulation), - "Sound Effect").start(); - else new GT_Runnable_Sound( + new GT_Runnable_Sound( GT.getThePlayer().worldObj, aX, aY, @@ -2249,7 +2206,17 @@ public class GT_Utility { aTimeUntilNextSound, aSoundResourceLocation, aSoundStrength, - aSoundModulation).run(); + aSoundModulation), + "Sound Effect").start(); + else new GT_Runnable_Sound( + GT.getThePlayer().worldObj, + aX, + aY, + aZ, + aTimeUntilNextSound, + aSoundResourceLocation, + aSoundStrength, + aSoundModulation).run(); return true; } @@ -2259,43 +2226,43 @@ public class GT_Utility { */ @Deprecated public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, - float aSoundModulation, double aX, double aY, double aZ) { + float aSoundModulation, double aX, double aY, double aZ) { if (isStringInvalid(aSoundName)) return false; return doSoundAtClient( - new ResourceLocation(aSoundName), - aTimeUntilNextSound, - aSoundStrength, - aSoundModulation, - aX, - aY, - aZ); + new ResourceLocation(aSoundName), + aTimeUntilNextSound, + aSoundStrength, + aSoundModulation, + aX, + aY, + aZ); } public static boolean sendSoundToPlayers(World aWorld, String aSoundName, float aSoundStrength, - float aSoundModulation, int aX, int aY, int aZ) { + float aSoundModulation, int aX, int aY, int aZ) { if (isStringInvalid(aSoundName) || aWorld == null || aWorld.isRemote) return false; NW.sendPacketToAllPlayersInRange( - aWorld, - new GT_Packet_Sound(aSoundName, aSoundStrength, aSoundModulation, aX, (short) aY, aZ), - aX, - aZ); + aWorld, + new GT_Packet_Sound(aSoundName, aSoundStrength, aSoundModulation, aX, (short) aY, aZ), + aX, + aZ); return true; } public static boolean sendSoundToPlayers(World aWorld, SoundResource sound, float aSoundStrength, - float aSoundModulation, int aX, int aY, int aZ) { + float aSoundModulation, int aX, int aY, int aZ) { if (aWorld == null || aWorld.isRemote) return false; NW.sendPacketToAllPlayersInRange( - aWorld, - new GT_Packet_Sound( - sound.resourceLocation.toString(), - aSoundStrength, - aSoundModulation, - aX, - (short) aY, - aZ), + aWorld, + new GT_Packet_Sound( + sound.resourceLocation.toString(), + aSoundStrength, + aSoundModulation, aX, - aZ); + (short) aY, + aZ), + aX, + aZ); return true; } @@ -2399,30 +2366,30 @@ public class GT_Utility { public static boolean isStringValid(Object aString) { return aString != null && !aString.toString() - .isEmpty(); + .isEmpty(); } public static boolean isStringInvalid(Object aString) { return aString == null || aString.toString() - .isEmpty(); + .isEmpty(); } public static boolean isStackValid(Object aStack) { return (aStack instanceof ItemStack) && ((ItemStack) aStack).getItem() != null - && ((ItemStack) aStack).stackSize >= 0; + && ((ItemStack) aStack).stackSize >= 0; } public static boolean isStackInvalid(Object aStack) { return aStack == null || !(aStack instanceof ItemStack) - || ((ItemStack) aStack).getItem() == null - || ((ItemStack) aStack).stackSize < 0; + || ((ItemStack) aStack).getItem() == null + || ((ItemStack) aStack).stackSize < 0; } public static boolean isDebugItem(ItemStack aStack) { return /* ItemList.Armor_Cheat.isStackEqual(aStack, T, T) || */ areStacksEqual( - GT_ModHandler.getIC2Item("debug", 1), - aStack, - true); + GT_ModHandler.getIC2Item("debug", 1), + aStack, + true); } public static ItemStack updateItemStack(ItemStack aStack) { @@ -2433,48 +2400,39 @@ public class GT_Utility { public static boolean isOpaqueBlock(World aWorld, int aX, int aY, int aZ) { return aWorld.getBlock(aX, aY, aZ) - .isOpaqueCube(); + .isOpaqueCube(); } public static boolean isBlockAir(World aWorld, int aX, int aY, int aZ) { return aWorld.getBlock(aX, aY, aZ) - .isAir(aWorld, aX, aY, aZ); + .isAir(aWorld, aX, aY, aZ); } public static boolean hasBlockHitBox(World aWorld, int aX, int aY, int aZ) { return aWorld.getBlock(aX, aY, aZ) - .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) - != null; + .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) != null; } public static void setCoordsOnFire(World aWorld, int aX, int aY, int aZ, boolean aReplaceCenter) { if (aReplaceCenter) if (aWorld.getBlock(aX, aY, aZ) - .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) - == null) - aWorld.setBlock(aX, aY, aZ, Blocks.fire); + .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) == null) aWorld.setBlock(aX, aY, aZ, Blocks.fire); if (aWorld.getBlock(aX + 1, aY, aZ) - .getCollisionBoundingBoxFromPool(aWorld, aX + 1, aY, aZ) - == null) + .getCollisionBoundingBoxFromPool(aWorld, aX + 1, aY, aZ) == null) aWorld.setBlock(aX + 1, aY, aZ, Blocks.fire); if (aWorld.getBlock(aX - 1, aY, aZ) - .getCollisionBoundingBoxFromPool(aWorld, aX - 1, aY, aZ) - == null) + .getCollisionBoundingBoxFromPool(aWorld, aX - 1, aY, aZ) == null) aWorld.setBlock(aX - 1, aY, aZ, Blocks.fire); if (aWorld.getBlock(aX, aY + 1, aZ) - .getCollisionBoundingBoxFromPool(aWorld, aX, aY + 1, aZ) - == null) + .getCollisionBoundingBoxFromPool(aWorld, aX, aY + 1, aZ) == null) aWorld.setBlock(aX, aY + 1, aZ, Blocks.fire); if (aWorld.getBlock(aX, aY - 1, aZ) - .getCollisionBoundingBoxFromPool(aWorld, aX, aY - 1, aZ) - == null) + .getCollisionBoundingBoxFromPool(aWorld, aX, aY - 1, aZ) == null) aWorld.setBlock(aX, aY - 1, aZ, Blocks.fire); if (aWorld.getBlock(aX, aY, aZ + 1) - .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ + 1) - == null) + .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ + 1) == null) aWorld.setBlock(aX, aY, aZ + 1, Blocks.fire); if (aWorld.getBlock(aX, aY, aZ - 1) - .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ - 1) - == null) + .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ - 1) == null) aWorld.setBlock(aX, aY, aZ - 1, Blocks.fire); } @@ -2482,7 +2440,7 @@ public class GT_Utility { if (aInventory != null) for (int i = 0, j = aInventory.getSizeInventory(); i < j; i++) { ItemStack rStack = aInventory.getStackInSlot(i); if (isStackValid(rStack) && rStack.getItem() instanceof IProjectileItem - && ((IProjectileItem) rStack.getItem()).hasProjectile(aProjectileType, rStack)) + && ((IProjectileItem) rStack.getItem()).hasProjectile(aProjectileType, rStack)) return updateItemStack(rStack); } return null; @@ -2542,14 +2500,14 @@ public class GT_Utility { return (page << 7) + (startIndex + blockMeta); } throw new RuntimeException( - "Index out of range: [" + page - + "][" - + startIndex - + "+" - + blockMeta - + "=" - + (startIndex + blockMeta) - + "]"); + "Index out of range: [" + page + + "][" + + startIndex + + "+" + + blockMeta + + "=" + + (startIndex + blockMeta) + + "]"); } /** @@ -2584,9 +2542,9 @@ public class GT_Utility { } } throw new RuntimeException( - "Probably missing mapping or different texture class used for: " + blockFromBlock.getUnlocalizedName() - + " meta:" - + metaFromBlock); + "Probably missing mapping or different texture class used for: " + blockFromBlock.getUnlocalizedName() + + " meta:" + + metaFromBlock); } /** @@ -2741,8 +2699,8 @@ public class GT_Utility { public static float getHeatDamageFromItem(ItemStack aStack) { ItemData tData = GT_OreDictUnificator.getItemData(aStack); return tData == null ? 0 - : (tData.mPrefix == null ? 0 : tData.mPrefix.mHeatDamage) - + (tData.hasValidMaterialData() ? tData.mMaterial.mMaterial.mHeatDamage : 0); + : (tData.mPrefix == null ? 0 : tData.mPrefix.mHeatDamage) + + (tData.hasValidMaterialData() ? tData.mMaterial.mMaterial.mHeatDamage : 0); } public static int getRadioactivityLevel(ItemStack aStack) { @@ -2770,8 +2728,8 @@ public class GT_Utility { private static boolean applyHeatDamage(EntityLivingBase aEntity, float aDamage, DamageSource source) { if (aDamage > 0 && aEntity != null - && aEntity.getActivePotionEffect(Potion.fireResistance) == null - && !isWearingFullHeatHazmat(aEntity)) { + && aEntity.getActivePotionEffect(Potion.fireResistance) == null + && !isWearingFullHeatHazmat(aEntity)) { aEntity.attackEntityFrom(source, aDamage); return true; } @@ -2797,58 +2755,57 @@ public class GT_Utility { public static boolean applyRadioactivity(EntityLivingBase aEntity, int aLevel, int aAmountOfItems) { if (aLevel > 0 && aEntity != null - && aEntity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD - && aEntity.getCreatureAttribute() != EnumCreatureAttribute.ARTHROPOD - && !isWearingFullRadioHazmat(aEntity)) { + && aEntity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD + && aEntity.getCreatureAttribute() != EnumCreatureAttribute.ARTHROPOD + && !isWearingFullRadioHazmat(aEntity)) { PotionEffect tEffect = null; aEntity.addPotionEffect( - new PotionEffect( - Potion.moveSlowdown.id, - aLevel * 140 * aAmountOfItems + Math.max( - 0, - ((tEffect = aEntity.getActivePotionEffect(Potion.moveSlowdown)) == null ? 0 - : tEffect.getDuration())), - Math.max(0, (5 * aLevel) / 7))); + new PotionEffect( + Potion.moveSlowdown.id, + aLevel * 140 * aAmountOfItems + Math.max( + 0, + ((tEffect = aEntity.getActivePotionEffect(Potion.moveSlowdown)) == null ? 0 + : tEffect.getDuration())), + Math.max(0, (5 * aLevel) / 7))); aEntity.addPotionEffect( - new PotionEffect( - Potion.digSlowdown.id, - aLevel * 150 * aAmountOfItems + Math.max( - 0, - ((tEffect = aEntity.getActivePotionEffect(Potion.digSlowdown)) == null ? 0 - : tEffect.getDuration())), - Math.max(0, (5 * aLevel) / 7))); + new PotionEffect( + Potion.digSlowdown.id, + aLevel * 150 * aAmountOfItems + Math.max( + 0, + ((tEffect = aEntity.getActivePotionEffect(Potion.digSlowdown)) == null ? 0 + : tEffect.getDuration())), + Math.max(0, (5 * aLevel) / 7))); aEntity.addPotionEffect( - new PotionEffect( - Potion.confusion.id, - aLevel * 130 * aAmountOfItems + Math.max( - 0, - ((tEffect = aEntity.getActivePotionEffect(Potion.confusion)) == null ? 0 - : tEffect.getDuration())), - Math.max(0, (5 * aLevel) / 7))); + new PotionEffect( + Potion.confusion.id, + aLevel * 130 * aAmountOfItems + Math.max( + 0, + ((tEffect = aEntity.getActivePotionEffect(Potion.confusion)) == null ? 0 + : tEffect.getDuration())), + Math.max(0, (5 * aLevel) / 7))); aEntity.addPotionEffect( - new PotionEffect( - Potion.weakness.id, - aLevel * 150 * aAmountOfItems + Math.max( - 0, - ((tEffect = aEntity.getActivePotionEffect(Potion.weakness)) == null ? 0 - : tEffect.getDuration())), - Math.max(0, (5 * aLevel) / 7))); + new PotionEffect( + Potion.weakness.id, + aLevel * 150 * aAmountOfItems + Math.max( + 0, + ((tEffect = aEntity.getActivePotionEffect(Potion.weakness)) == null ? 0 + : tEffect.getDuration())), + Math.max(0, (5 * aLevel) / 7))); aEntity.addPotionEffect( - new PotionEffect( - Potion.hunger.id, - aLevel * 130 * aAmountOfItems + Math.max( - 0, - ((tEffect = aEntity.getActivePotionEffect(Potion.hunger)) == null ? 0 - : tEffect.getDuration())), - Math.max(0, (5 * aLevel) / 7))); + new PotionEffect( + Potion.hunger.id, + aLevel * 130 * aAmountOfItems + Math.max( + 0, + ((tEffect = aEntity.getActivePotionEffect(Potion.hunger)) == null ? 0 : tEffect.getDuration())), + Math.max(0, (5 * aLevel) / 7))); aEntity.addPotionEffect( - new PotionEffect( - 24 /* IC2 Radiation */, - aLevel * 180 * aAmountOfItems + Math.max( - 0, - ((tEffect = aEntity.getActivePotionEffect(Potion.potionTypes[24])) == null ? 0 - : tEffect.getDuration())), - Math.max(0, (5 * aLevel) / 7))); + new PotionEffect( + 24 /* IC2 Radiation */, + aLevel * 180 * aAmountOfItems + Math.max( + 0, + ((tEffect = aEntity.getActivePotionEffect(Potion.potionTypes[24])) == null ? 0 + : tEffect.getDuration())), + Math.max(0, (5 * aLevel) / 7))); return true; } return false; @@ -3027,12 +2984,12 @@ public class GT_Utility { public static boolean isStackInList(GT_ItemStack aStack, Collection<GT_ItemStack> aList) { return aStack != null - && (aList.contains(aStack) || aList.contains(new GT_ItemStack(aStack.mItem, aStack.mStackSize, W))); + && (aList.contains(aStack) || aList.contains(new GT_ItemStack(aStack.mItem, aStack.mStackSize, W))); } public static boolean isStackInList(GT_ItemStack2 aStack, Set<GT_ItemStack2> aList) { return aStack != null - && (aList.contains(aStack) || aList.contains(new GT_ItemStack2(aStack.mItem, aStack.mStackSize, W))); + && (aList.contains(aStack) || aList.contains(new GT_ItemStack2(aStack.mItem, aStack.mStackSize, W))); } /** @@ -3047,9 +3004,9 @@ public class GT_Utility { public static <X, Y extends Comparable<Y>> LinkedHashMap<X, Y> sortMapByValuesAcending(Map<X, Y> map) { return map.entrySet() - .stream() - .sorted(Entry.comparingByValue()) - .collect(CollectorUtils.entriesToMap(LinkedHashMap::new)); + .stream() + .sorted(Entry.comparingByValue()) + .collect(CollectorUtils.entriesToMap(LinkedHashMap::new)); } /** @@ -3059,7 +3016,7 @@ public class GT_Utility { List<Map.Entry<X, Y>> tEntrySet = new LinkedList<>(aMap.entrySet()); tEntrySet.sort((aValue1, aValue2) -> { return aValue2.getValue() - .compareTo(aValue1.getValue()); // FB: RV - RV_NEGATING_RESULT_OF_COMPARETO + .compareTo(aValue1.getValue()); // FB: RV - RV_NEGATING_RESULT_OF_COMPARETO }); LinkedHashMap<X, Y> rMap = new LinkedHashMap<>(); for (Map.Entry<X, Y> tEntry : tEntrySet) rMap.put(tEntry.getKey(), tEntry.getValue()); @@ -3079,9 +3036,9 @@ public class GT_Utility { */ public static long translateMaterialToAmount(long aMaterialAmount, long aAmountPerUnit, boolean aRoundUp) { return Math.max( - 0, - ((aMaterialAmount * aAmountPerUnit) / M) - + (aRoundUp && (aMaterialAmount * aAmountPerUnit) % M > 0 ? 1 : 0)); + 0, + ((aMaterialAmount * aAmountPerUnit) / M) + + (aRoundUp && (aMaterialAmount * aAmountPerUnit) % M > 0 ? 1 : 0)); } /** @@ -3091,11 +3048,11 @@ public class GT_Utility { if (aDimensionID <= 1 && aDimensionID >= -1 && !GregTech_API.sDimensionalList.contains(aDimensionID)) return true; return !GregTech_API.sDimensionalList.contains(aDimensionID) - && DimensionManager.isDimensionRegistered(aDimensionID); + && DimensionManager.isDimensionRegistered(aDimensionID); } public static boolean moveEntityToDimensionAtCoords(Entity entity, int aDimension, double aX, double aY, - double aZ) { + double aZ) { // Credit goes to BrandonCore Author :!: if (entity == null || entity.worldObj.isRemote) return false; @@ -3104,8 +3061,8 @@ public class GT_Utility { World startWorld = entity.worldObj; WorldServer destinationWorld = FMLCommonHandler.instance() - .getMinecraftServerInstance() - .worldServerForDimension(aDimension); + .getMinecraftServerInstance() + .worldServerForDimension(aDimension); if (destinationWorld == null) { return false; @@ -3120,23 +3077,23 @@ public class GT_Utility { player.closeScreen(); // added player.dimension = aDimension; player.playerNetServerHandler.sendPacket( - new S07PacketRespawn( - player.dimension, - player.worldObj.difficultySetting, - destinationWorld.getWorldInfo() - .getTerrainType(), - player.theItemInWorldManager.getGameType())); + new S07PacketRespawn( + player.dimension, + player.worldObj.difficultySetting, + destinationWorld.getWorldInfo() + .getTerrainType(), + player.theItemInWorldManager.getGameType())); ((WorldServer) startWorld).getPlayerManager() - .removePlayer(player); + .removePlayer(player); startWorld.playerEntities.remove(player); startWorld.updateAllPlayersSleepingFlag(); int i = entity.chunkCoordX; int j = entity.chunkCoordZ; if ((entity.addedToChunk) && (startWorld.getChunkProvider() - .chunkExists(i, j))) { + .chunkExists(i, j))) { startWorld.getChunkFromChunkCoords(i, j) - .removeEntity(entity); + .removeEntity(entity); startWorld.getChunkFromChunkCoords(i, j).isModified = true; } startWorld.loadedEntityList.remove(entity); @@ -3173,7 +3130,7 @@ public class GT_Utility { EntityPlayerMP player = (EntityPlayerMP) entity; if (interDimensional) { player.mcServer.getConfigurationManager() - .func_72375_a(player, destinationWorld); + .func_72375_a(player, destinationWorld); } player.playerNetServerHandler.setPlayerLocation(aX, aY, aZ, player.rotationYaw, player.rotationPitch); } @@ -3184,21 +3141,21 @@ public class GT_Utility { EntityPlayerMP player = (EntityPlayerMP) entity; player.theItemInWorldManager.setWorld(destinationWorld); player.mcServer.getConfigurationManager() - .updateTimeAndWeatherForPlayer(player, destinationWorld); + .updateTimeAndWeatherForPlayer(player, destinationWorld); player.mcServer.getConfigurationManager() - .syncPlayerInventory(player); + .syncPlayerInventory(player); for (PotionEffect potionEffect : player.getActivePotionEffects()) { player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potionEffect)); } player.playerNetServerHandler.sendPacket( - new S1FPacketSetExperience(player.experience, player.experienceTotal, player.experienceLevel)); + new S1FPacketSetExperience(player.experience, player.experienceTotal, player.experienceLevel)); FMLCommonHandler.instance() - .firePlayerChangedDimensionEvent( - player, - startWorld.provider.dimensionId, - destinationWorld.provider.dimensionId); + .firePlayerChangedDimensionEvent( + player, + startWorld.provider.dimensionId, + destinationWorld.provider.dimensionId); } entity.setLocationAndAngles(aX, aY, aZ, entity.rotationYaw, entity.rotationPitch); @@ -3212,7 +3169,7 @@ public class GT_Utility { } public static int getCoordinateScan(ArrayList<String> aList, EntityPlayer aPlayer, World aWorld, int aScanLevel, - int aX, int aY, int aZ, int aSide, float aClickX, float aClickY, float aClickZ) { + int aX, int aY, int aZ, int aSide, float aClickX, float aClickY, float aClickZ) { if (aList == null) return 0; ArrayList<String> tList = new ArrayList<>(); @@ -3223,59 +3180,52 @@ public class GT_Utility { final Block tBlock = aWorld.getBlock(aX, aY, aZ); tList.add( - "----- X: " + EnumChatFormatting.AQUA - + formatNumbers(aX) - + EnumChatFormatting.RESET - + " Y: " - + EnumChatFormatting.AQUA - + formatNumbers(aY) - + EnumChatFormatting.RESET - + " Z: " - + EnumChatFormatting.AQUA - + formatNumbers(aZ) - + EnumChatFormatting.RESET - + " D: " - + EnumChatFormatting.AQUA - + aWorld.provider.dimensionId - + EnumChatFormatting.RESET - + " -----"); + "----- X: " + EnumChatFormatting.AQUA + + formatNumbers(aX) + + EnumChatFormatting.RESET + + " Y: " + + EnumChatFormatting.AQUA + + formatNumbers(aY) + + EnumChatFormatting.RESET + + " Z: " + + EnumChatFormatting.AQUA + + formatNumbers(aZ) + + EnumChatFormatting.RESET + + " D: " + + EnumChatFormatting.AQUA + + aWorld.provider.dimensionId + + EnumChatFormatting.RESET + + " -----"); try { if (tTileEntity instanceof IInventory) tList.add( - GT_Utility.trans("162", "Name: ") + EnumChatFormatting.BLUE - + ((IInventory) tTileEntity).getInventoryName() - + EnumChatFormatting.RESET - + GT_Utility.trans("163", " MetaData: ") - + EnumChatFormatting.AQUA - + aWorld.getBlockMetadata(aX, aY, aZ) - + EnumChatFormatting.RESET); + GT_Utility.trans("162", "Name: ") + EnumChatFormatting.BLUE + + ((IInventory) tTileEntity).getInventoryName() + + EnumChatFormatting.RESET + + GT_Utility.trans("163", " MetaData: ") + + EnumChatFormatting.AQUA + + aWorld.getBlockMetadata(aX, aY, aZ) + + EnumChatFormatting.RESET); else tList.add( - GT_Utility.trans("162", "Name: ") + EnumChatFormatting.BLUE - + tBlock.getUnlocalizedName() - + EnumChatFormatting.RESET - + GT_Utility.trans("163", " MetaData: ") - + EnumChatFormatting.AQUA - + aWorld.getBlockMetadata(aX, aY, aZ) - + EnumChatFormatting.RESET); + GT_Utility.trans("162", "Name: ") + EnumChatFormatting.BLUE + + tBlock.getUnlocalizedName() + + EnumChatFormatting.RESET + + GT_Utility.trans("163", " MetaData: ") + + EnumChatFormatting.AQUA + + aWorld.getBlockMetadata(aX, aY, aZ) + + EnumChatFormatting.RESET); tList.add( - GT_Utility.trans("164", "Hardness: ") + EnumChatFormatting.YELLOW - + tBlock.getBlockHardness(aWorld, aX, aY, aZ) - + EnumChatFormatting.RESET - + GT_Utility.trans("165", " Blast Resistance: ") - + EnumChatFormatting.YELLOW - + tBlock.getExplosionResistance( - aPlayer, - aWorld, - aX, - aY, - aZ, - aPlayer.posX, - aPlayer.posY, - aPlayer.posZ) - + EnumChatFormatting.RESET); + GT_Utility.trans("164", "Hardness: ") + EnumChatFormatting.YELLOW + + tBlock.getBlockHardness(aWorld, aX, aY, aZ) + + EnumChatFormatting.RESET + + GT_Utility.trans("165", " Blast Resistance: ") + + EnumChatFormatting.YELLOW + + tBlock + .getExplosionResistance(aPlayer, aWorld, aX, aY, aZ, aPlayer.posX, aPlayer.posY, aPlayer.posZ) + + EnumChatFormatting.RESET); if (tBlock.isBeaconBase(aWorld, aX, aY, aZ, aX, aY + 1, aZ)) tList.add( - EnumChatFormatting.GOLD + GT_Utility.trans("166", "Is valid Beacon Pyramid Material") - + EnumChatFormatting.RESET); + EnumChatFormatting.GOLD + GT_Utility.trans("166", "Is valid Beacon Pyramid Material") + + EnumChatFormatting.RESET); } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); } @@ -3283,23 +3233,23 @@ public class GT_Utility { try { if (tTileEntity instanceof IFluidHandler) { rEUAmount += 500; - final FluidTankInfo[] tTanks = ((IFluidHandler) tTileEntity).getTankInfo( - ForgeDirection.getOrientation(aSide)); + final FluidTankInfo[] tTanks = ((IFluidHandler) tTileEntity) + .getTankInfo(ForgeDirection.getOrientation(aSide)); if (tTanks != null) for (byte i = 0; i < tTanks.length; i++) { tList.add( - GT_Utility.trans("167", "Tank ") + i - + ": " - + EnumChatFormatting.GREEN - + formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount)) - + EnumChatFormatting.RESET - + " L / " - + EnumChatFormatting.YELLOW - + formatNumbers(tTanks[i].capacity) - + EnumChatFormatting.RESET - + " L " - + EnumChatFormatting.GOLD - + getFluidName(tTanks[i].fluid, true) - + EnumChatFormatting.RESET); + GT_Utility.trans("167", "Tank ") + i + + ": " + + EnumChatFormatting.GREEN + + formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount)) + + EnumChatFormatting.RESET + + " L / " + + EnumChatFormatting.YELLOW + + formatNumbers(tTanks[i].capacity) + + EnumChatFormatting.RESET + + " L " + + EnumChatFormatting.GOLD + + getFluidName(tTanks[i].fluid, true) + + EnumChatFormatting.RESET); } } } catch (Throwable e) { @@ -3317,17 +3267,17 @@ public class GT_Utility { if (tTileEntity instanceof ic2.api.reactor.IReactor) { rEUAmount += 500; tList.add( - GT_Utility.trans("168", "Heat: ") + EnumChatFormatting.GREEN - + formatNumbers(((ic2.api.reactor.IReactor) tTileEntity).getHeat()) - + EnumChatFormatting.RESET - + " / " - + EnumChatFormatting.YELLOW - + formatNumbers(((ic2.api.reactor.IReactor) tTileEntity).getMaxHeat()) - + EnumChatFormatting.RESET); + GT_Utility.trans("168", "Heat: ") + EnumChatFormatting.GREEN + + formatNumbers(((ic2.api.reactor.IReactor) tTileEntity).getHeat()) + + EnumChatFormatting.RESET + + " / " + + EnumChatFormatting.YELLOW + + formatNumbers(((ic2.api.reactor.IReactor) tTileEntity).getMaxHeat()) + + EnumChatFormatting.RESET); tList.add( - GT_Utility.trans("169", "HEM: ") + EnumChatFormatting.YELLOW - + ((ic2.api.reactor.IReactor) tTileEntity).getHeatEffectModifier() - + EnumChatFormatting.RESET + GT_Utility.trans("169", "HEM: ") + EnumChatFormatting.YELLOW + + ((ic2.api.reactor.IReactor) tTileEntity).getHeatEffectModifier() + + EnumChatFormatting.RESET /* * + GT_Utility.trans("170"," Base EU Output: ")/* + * ((ic2.api.reactor.IReactor)tTileEntity).getOutput() @@ -3342,9 +3292,9 @@ public class GT_Utility { if (tAlignment != null) { rEUAmount += 100; tList.add( - GT_Utility.trans("219", "Extended Facing: ") + EnumChatFormatting.GREEN - + tAlignment.getExtendedFacing() - + EnumChatFormatting.RESET); + GT_Utility.trans("219", "Extended Facing: ") + EnumChatFormatting.GREEN + + tAlignment.getExtendedFacing() + + EnumChatFormatting.RESET); } } } catch (Throwable e) { @@ -3354,22 +3304,20 @@ public class GT_Utility { if (tTileEntity instanceof ic2.api.tile.IWrenchable) { rEUAmount += 100; tList.add( - GT_Utility.trans("171", "Facing: ") + EnumChatFormatting.GREEN - + ((ic2.api.tile.IWrenchable) tTileEntity).getFacing() - + EnumChatFormatting.RESET - + GT_Utility.trans("172", " / Chance: ") - + EnumChatFormatting.YELLOW - + (((ic2.api.tile.IWrenchable) tTileEntity).getWrenchDropRate() * 100) - + EnumChatFormatting.RESET - + "%"); + GT_Utility.trans("171", "Facing: ") + EnumChatFormatting.GREEN + + ((ic2.api.tile.IWrenchable) tTileEntity).getFacing() + + EnumChatFormatting.RESET + + GT_Utility.trans("172", " / Chance: ") + + EnumChatFormatting.YELLOW + + (((ic2.api.tile.IWrenchable) tTileEntity).getWrenchDropRate() * 100) + + EnumChatFormatting.RESET + + "%"); tList.add( - ((ic2.api.tile.IWrenchable) tTileEntity).wrenchCanRemove(aPlayer) - ? EnumChatFormatting.GREEN - + GT_Utility.trans("173", "You can remove this with a Wrench") - + EnumChatFormatting.RESET - : EnumChatFormatting.RED - + GT_Utility.trans("174", "You can NOT remove this with a Wrench") - + EnumChatFormatting.RESET); + ((ic2.api.tile.IWrenchable) tTileEntity).wrenchCanRemove(aPlayer) + ? EnumChatFormatting.GREEN + GT_Utility.trans("173", "You can remove this with a Wrench") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + GT_Utility.trans("174", "You can NOT remove this with a Wrench") + + EnumChatFormatting.RESET); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -3378,9 +3326,9 @@ public class GT_Utility { if (tTileEntity instanceof ic2.api.energy.tile.IEnergyConductor) { rEUAmount += 200; tList.add( - GT_Utility.trans("175", "Conduction Loss: ") + EnumChatFormatting.YELLOW - + ((ic2.api.energy.tile.IEnergyConductor) tTileEntity).getConductionLoss() - + EnumChatFormatting.RESET); + GT_Utility.trans("175", "Conduction Loss: ") + EnumChatFormatting.YELLOW + + ((ic2.api.energy.tile.IEnergyConductor) tTileEntity).getConductionLoss() + + EnumChatFormatting.RESET); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -3389,14 +3337,14 @@ public class GT_Utility { if (tTileEntity instanceof ic2.api.tile.IEnergyStorage) { rEUAmount += 200; tList.add( - GT_Utility.trans("176", "Contained Energy: ") + EnumChatFormatting.YELLOW - + formatNumbers(((ic2.api.tile.IEnergyStorage) tTileEntity).getStored()) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + formatNumbers(((ic2.api.tile.IEnergyStorage) tTileEntity).getCapacity()) - + EnumChatFormatting.RESET - + " EU"); + GT_Utility.trans("176", "Contained Energy: ") + EnumChatFormatting.YELLOW + + formatNumbers(((ic2.api.tile.IEnergyStorage) tTileEntity).getStored()) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + formatNumbers(((ic2.api.tile.IEnergyStorage) tTileEntity).getCapacity()) + + EnumChatFormatting.RESET + + " EU"); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -3405,8 +3353,8 @@ public class GT_Utility { if (tTileEntity instanceof IUpgradableMachine) { rEUAmount += 500; if (((IUpgradableMachine) tTileEntity).hasMufflerUpgrade()) tList.add( - EnumChatFormatting.GREEN + GT_Utility.trans("177", "Has Muffler Upgrade") - + EnumChatFormatting.RESET); + EnumChatFormatting.GREEN + GT_Utility.trans("177", "Has Muffler Upgrade") + + EnumChatFormatting.RESET); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -3422,13 +3370,13 @@ public class GT_Utility { rEUAmount += 400; int tValue = 0; if (0 < (tValue = ((IMachineProgress) tTileEntity).getMaxProgress())) tList.add( - GT_Utility.trans("178", "Progress/Load: ") + EnumChatFormatting.GREEN - + formatNumbers(((IMachineProgress) tTileEntity).getProgress()) - + EnumChatFormatting.RESET - + " / " - + EnumChatFormatting.YELLOW - + formatNumbers(tValue) - + EnumChatFormatting.RESET); + GT_Utility.trans("178", "Progress/Load: ") + EnumChatFormatting.GREEN + + formatNumbers(((IMachineProgress) tTileEntity).getProgress()) + + EnumChatFormatting.RESET + + " / " + + EnumChatFormatting.YELLOW + + formatNumbers(tValue) + + EnumChatFormatting.RESET); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -3437,7 +3385,7 @@ public class GT_Utility { if (tTileEntity instanceof ICoverable) { rEUAmount += 300; final String tString = ((ICoverable) tTileEntity).getCoverInfoAtSide((byte) aSide) - .getBehaviorDescription(); + .getBehaviorDescription(); if (tString != null && !tString.equals(E)) tList.add(tString); } } catch (Throwable e) { @@ -3445,40 +3393,40 @@ public class GT_Utility { } try { if (tTileEntity instanceof IBasicEnergyContainer - && ((IBasicEnergyContainer) tTileEntity).getEUCapacity() > 0) { + && ((IBasicEnergyContainer) tTileEntity).getEUCapacity() > 0) { tList.add( - GT_Utility.trans("179", "Max IN: ") + EnumChatFormatting.RED - + formatNumbers(((IBasicEnergyContainer) tTileEntity).getInputVoltage()) - + " (" - + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getInputVoltage())] - + ") " - + EnumChatFormatting.RESET - + GT_Utility.trans("182", " EU at ") - + EnumChatFormatting.RED - + formatNumbers(((IBasicEnergyContainer) tTileEntity).getInputAmperage()) - + EnumChatFormatting.RESET - + GT_Utility.trans("183", " A")); + GT_Utility.trans("179", "Max IN: ") + EnumChatFormatting.RED + + formatNumbers(((IBasicEnergyContainer) tTileEntity).getInputVoltage()) + + " (" + + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getInputVoltage())] + + ") " + + EnumChatFormatting.RESET + + GT_Utility.trans("182", " EU at ") + + EnumChatFormatting.RED + + formatNumbers(((IBasicEnergyContainer) tTileEntity).getInputAmperage()) + + EnumChatFormatting.RESET + + GT_Utility.trans("183", " A")); tList.add( - GT_Utility.trans("181", "Max OUT: ") + EnumChatFormatting.RED - + formatNumbers(((IBasicEnergyContainer) tTileEntity).getOutputVoltage()) - + " (" - + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getOutputVoltage())] - + ") " - + EnumChatFormatting.RESET - + GT_Utility.trans("182", " EU at ") - + EnumChatFormatting.RED - + formatNumbers(((IBasicEnergyContainer) tTileEntity).getOutputAmperage()) - + EnumChatFormatting.RESET - + GT_Utility.trans("183", " A")); + GT_Utility.trans("181", "Max OUT: ") + EnumChatFormatting.RED + + formatNumbers(((IBasicEnergyContainer) tTileEntity).getOutputVoltage()) + + " (" + + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getOutputVoltage())] + + ") " + + EnumChatFormatting.RESET + + GT_Utility.trans("182", " EU at ") + + EnumChatFormatting.RED + + formatNumbers(((IBasicEnergyContainer) tTileEntity).getOutputAmperage()) + + EnumChatFormatting.RESET + + GT_Utility.trans("183", " A")); tList.add( - GT_Utility.trans("184", "Energy: ") + EnumChatFormatting.GREEN - + formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU()) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity()) - + EnumChatFormatting.RESET - + " EU"); + GT_Utility.trans("184", "Energy: ") + EnumChatFormatting.GREEN + + formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU()) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity()) + + EnumChatFormatting.RESET + + " EU"); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -3486,16 +3434,16 @@ public class GT_Utility { try { if (tTileEntity instanceof IGregTechTileEntity) { tList.add( - GT_Utility.trans("186", "Owned by: ") + EnumChatFormatting.BLUE - + ((IGregTechTileEntity) tTileEntity).getOwnerName() - + EnumChatFormatting.RESET); + GT_Utility.trans("186", "Owned by: ") + EnumChatFormatting.BLUE + + ((IGregTechTileEntity) tTileEntity).getOwnerName() + + EnumChatFormatting.RESET); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); } try { if (tTileEntity instanceof IGregTechDeviceInformation - && ((IGregTechDeviceInformation) tTileEntity).isGivingInformation()) { + && ((IGregTechDeviceInformation) tTileEntity).isGivingInformation()) { tList.addAll(Arrays.asList(((IGregTechDeviceInformation) tTileEntity).getInfoData())); } } catch (Throwable e) { @@ -3507,41 +3455,41 @@ public class GT_Utility { if (crop.getScanLevel() < 4) crop.setScanLevel((byte) 4); if (crop.getCrop() != null) { tList.add( - GT_Utility.trans("187", "Type -- Crop-Name: ") + crop.getCrop() - .name() - + GT_Utility.trans("188", " Growth: ") - + crop.getGrowth() - + GT_Utility.trans("189", " Gain: ") - + crop.getGain() - + GT_Utility.trans("190", " Resistance: ") - + crop.getResistance()); + GT_Utility.trans("187", "Type -- Crop-Name: ") + crop.getCrop() + .name() + + GT_Utility.trans("188", " Growth: ") + + crop.getGrowth() + + GT_Utility.trans("189", " Gain: ") + + crop.getGain() + + GT_Utility.trans("190", " Resistance: ") + + crop.getResistance()); } tList.add( - GT_Utility.trans("191", "Plant -- Fertilizer: ") + crop.getNutrientStorage() - + GT_Utility.trans("192", " Water: ") - + crop.getHydrationStorage() - + GT_Utility.trans("193", " Weed-Ex: ") - + crop.getWeedExStorage() - + GT_Utility.trans("194", " Scan-Level: ") - + crop.getScanLevel()); + GT_Utility.trans("191", "Plant -- Fertilizer: ") + crop.getNutrientStorage() + + GT_Utility.trans("192", " Water: ") + + crop.getHydrationStorage() + + GT_Utility.trans("193", " Weed-Ex: ") + + crop.getWeedExStorage() + + GT_Utility.trans("194", " Scan-Level: ") + + crop.getScanLevel()); tList.add( - GT_Utility.trans("195", "Environment -- Nutrients: ") + crop.getNutrients() - + GT_Utility.trans("196", " Humidity: ") - + crop.getHumidity() - + GT_Utility.trans("197", " Air-Quality: ") - + crop.getAirQuality()); + GT_Utility.trans("195", "Environment -- Nutrients: ") + crop.getNutrients() + + GT_Utility.trans("196", " Humidity: ") + + crop.getHumidity() + + GT_Utility.trans("197", " Air-Quality: ") + + crop.getAirQuality()); if (crop.getCrop() != null) { final StringBuilder tStringB = new StringBuilder(); for (String tAttribute : crop.getCrop() - .attributes()) { + .attributes()) { tStringB.append(", ") - .append(tAttribute); + .append(tAttribute); } final String tString = tStringB.toString(); tList.add(GT_Utility.trans("198", "Attributes:") + tString.replaceFirst(",", E)); tList.add( - GT_Utility.trans("199", "Discovered by: ") + crop.getCrop() - .discoveredBy()); + GT_Utility.trans("199", "Discovered by: ") + crop.getCrop() + .discoveredBy()); } } } catch (Throwable e) { @@ -3566,33 +3514,33 @@ public class GT_Utility { if (aPlayer.capabilities.isCreativeMode) { final FluidStack tFluid = undergroundOilReadInformation(currentChunk); // -# to only read if (tFluid != null) tList.add( - EnumChatFormatting.GOLD + tFluid.getLocalizedName() - + EnumChatFormatting.RESET - + ": " - + EnumChatFormatting.YELLOW - + formatNumbers(tFluid.amount) - + EnumChatFormatting.RESET - + " L"); + EnumChatFormatting.GOLD + tFluid.getLocalizedName() + + EnumChatFormatting.RESET + + ": " + + EnumChatFormatting.YELLOW + + formatNumbers(tFluid.amount) + + EnumChatFormatting.RESET + + " L"); else tList.add( - EnumChatFormatting.GOLD + GT_Utility.trans("201", "Nothing") - + EnumChatFormatting.RESET - + ": " - + EnumChatFormatting.YELLOW - + '0' - + EnumChatFormatting.RESET - + " L"); + EnumChatFormatting.GOLD + GT_Utility.trans("201", "Nothing") + + EnumChatFormatting.RESET + + ": " + + EnumChatFormatting.YELLOW + + '0' + + EnumChatFormatting.RESET + + " L"); } // if(aPlayer.capabilities.isCreativeMode){ if (GT_Pollution.hasPollution(currentChunk)) { tList.add( - GT_Utility.trans("202", "Pollution in Chunk: ") + EnumChatFormatting.RED - + formatNumbers(GT_Pollution.getPollution(currentChunk)) - + EnumChatFormatting.RESET - + GT_Utility.trans("203", " gibbl")); + GT_Utility.trans("202", "Pollution in Chunk: ") + EnumChatFormatting.RED + + formatNumbers(GT_Pollution.getPollution(currentChunk)) + + EnumChatFormatting.RESET + + GT_Utility.trans("203", " gibbl")); } else { tList.add( - EnumChatFormatting.GREEN + GT_Utility.trans("204", "No Pollution in Chunk! HAYO!") - + EnumChatFormatting.RESET); + EnumChatFormatting.GREEN + GT_Utility.trans("204", "No Pollution in Chunk! HAYO!") + + EnumChatFormatting.RESET); } try { @@ -3606,19 +3554,19 @@ public class GT_Utility { } final BlockScanningEvent tEvent = new BlockScanningEvent( - aWorld, - aPlayer, - aX, - aY, - aZ, - (byte) aSide, - aScanLevel, - tBlock, - tTileEntity, - tList, - aClickX, - aClickY, - aClickZ); + aWorld, + aPlayer, + aX, + aY, + aZ, + (byte) aSide, + aScanLevel, + tBlock, + tTileEntity, + tList, + aClickX, + aClickY, + aClickZ); tEvent.mEUCost = rEUAmount; MinecraftForge.EVENT_BUS.post(tEvent); if (!tEvent.isCanceled()) aList.addAll(tList); @@ -3746,9 +3694,9 @@ public class GT_Utility { * there's no creative or 111 stack. */ public static boolean consumeItems(EntityPlayer player, ItemStack stack, gregtech.api.enums.Materials mat, - int count) { + int count) { if (stack != null && GT_OreDictUnificator.getItemData(stack).mMaterial.mMaterial == mat - && stack.stackSize >= count) { + && stack.stackSize >= count) { if ((!player.capabilities.isCreativeMode) && (stack.stackSize != 111)) stack.stackSize -= count; return true; } @@ -3776,14 +3724,14 @@ public class GT_Utility { public static float getBlockHardnessAt(World aWorld, int aX, int aY, int aZ) { return aWorld.getBlock(aX, aY, aZ) - .getBlockHardness(aWorld, aX, aY, aZ); + .getBlockHardness(aWorld, aX, aY, aZ); } public static FakePlayer getFakePlayer(IGregTechTileEntity aBaseMetaTileEntity) { if (aBaseMetaTileEntity.getWorld() instanceof WorldServer) { return FakePlayerFactory.get( - (WorldServer) aBaseMetaTileEntity.getWorld(), - new GameProfile(aBaseMetaTileEntity.getOwnerUuid(), aBaseMetaTileEntity.getOwnerName())); + (WorldServer) aBaseMetaTileEntity.getWorld(), + new GameProfile(aBaseMetaTileEntity.getOwnerUuid(), aBaseMetaTileEntity.getOwnerName())); } return null; } @@ -3792,13 +3740,13 @@ public class GT_Utility { if (aPlayer == null) return false; World aWorld = aPlayer.worldObj; BlockEvent.BreakEvent event = new BlockEvent.BreakEvent( - aX, - aY, - aZ, - aWorld, - aWorld.getBlock(aX, aY, aZ), - aWorld.getBlockMetadata(aX, aY, aZ), - aPlayer); + aX, + aY, + aZ, + aWorld, + aWorld.getBlock(aX, aY, aZ), + aWorld.getBlockMetadata(aX, aY, aZ), + aPlayer); MinecraftForge.EVENT_BUS.post(event); if (!event.isCanceled()) { if (!isSimulate) return aWorld.setBlockToAir(aX, aY, aZ); @@ -3808,13 +3756,11 @@ public class GT_Utility { } public static boolean setBlockByFakePlayer(FakePlayer aPlayer, int aX, int aY, int aZ, Block aBlock, int aMeta, - boolean isSimulate) { + boolean isSimulate) { if (aPlayer == null) return false; World aWorld = aPlayer.worldObj; - BlockEvent.PlaceEvent event = ForgeEventFactory.onPlayerBlockPlace( - aPlayer, - new BlockSnapshot(aWorld, aX, aY, aZ, aBlock, aMeta), - ForgeDirection.UNKNOWN); + BlockEvent.PlaceEvent event = ForgeEventFactory + .onPlayerBlockPlace(aPlayer, new BlockSnapshot(aWorld, aX, aY, aZ, aBlock, aMeta), ForgeDirection.UNKNOWN); if (!event.isCanceled()) { if (!isSimulate) return aWorld.setBlock(aX, aY, aZ, aBlock, aMeta, 3); return true; @@ -3842,8 +3788,7 @@ public class GT_Utility { for (String tKey : aNBT.func_150296_c()) { NBTBase tValue = aNBT.getTag(tKey); if (tValue == null || (tValue instanceof NBTPrimitive && ((NBTPrimitive) tValue).func_150291_c() == 0) - || (tValue instanceof NBTTagString - && isStringInvalid(((NBTTagString) tValue).func_150285_a_()))) + || (tValue instanceof NBTTagString && isStringInvalid(((NBTTagString) tValue).func_150285_a_()))) tTagsToRemove.add(tKey); } for (String tKey : tTagsToRemove) aNBT.removeTag(tKey); @@ -3912,31 +3857,31 @@ public class GT_Utility { } public static void setProspectionData(ItemStack aStack, int aX, int aY, int aZ, int aDim, FluidStack aFluid, - String... aOres) { + String... aOres) { NBTTagCompound tNBT = getNBT(aStack); StringBuilder tData = new StringBuilder(aX + "," + aY + "," + aZ + "," + aDim + ","); if (aFluid != null) tData.append(aFluid.amount) - .append(",") - .append(aFluid.getLocalizedName()) - .append(","); // TODO - // CHECK - // IF - // THAT - // /5000 - // is - // needed - // (Not - // needed) + .append(",") + .append(aFluid.getLocalizedName()) + .append(","); // TODO + // CHECK + // IF + // THAT + // /5000 + // is + // needed + // (Not + // needed) for (String tString : aOres) { tData.append(tString) - .append(","); + .append(","); } tNBT.setString("prospection", tData.toString()); setNBT(aStack, tNBT); } public static void setAdvancedProspectionData(byte aTier, ItemStack aStack, int aX, short aY, int aZ, int aDim, - ArrayList<String> aOils, ArrayList<String> aOres, int aRadius) { + ArrayList<String> aOils, ArrayList<String> aOres, int aRadius) { setBookTitle(aStack, "Raw Prospection Data"); @@ -3959,9 +3904,9 @@ public class GT_Utility { tNBT.setString("prospection_oils", joinListToString(tOilsTransformed)); String tOilsPosStr = "X: " + Math.floorDiv(aX, 16 * 8) * 16 * 8 - + " Z: " - + Math.floorDiv(aZ, 16 * 8) * 16 * 8 - + "\n"; + + " Z: " + + Math.floorDiv(aZ, 16 * 8) * 16 * 8 + + "\n"; int xOff = aX - Math.floorDiv(aX, 16 * 8) * 16 * 8; xOff = xOff / 16; int xOffRemain = 7 - xOff; @@ -3987,9 +3932,9 @@ public class GT_Utility { tOilsPosStr = tOilsPosStr.concat("--------\n"); } tOilsPosStr = tOilsPosStr.concat( - " X: " + (Math.floorDiv(aX, 16 * 8) + 1) * 16 * 8 - + " Z: " - + (Math.floorDiv(aZ, 16 * 8) + 1) * 16 * 8); // +1 oilfied to find bottomright of [5] + " X: " + (Math.floorDiv(aX, 16 * 8) + 1) * 16 * 8 + + " Z: " + + (Math.floorDiv(aZ, 16 * 8) + 1) * 16 * 8); // +1 oilfied to find bottomright of [5] tNBT.setString("prospection_oils_pos", tOilsPosStr); @@ -4007,35 +3952,35 @@ public class GT_Utility { String[] tDataArray = tData.split(","); if (tDataArray.length > 6) { tNBT.setString( - "author", - " Dim: " + tDataArray[3] - + "X: " - + tDataArray[0] - + " Y: " - + tDataArray[1] - + " Z: " - + tDataArray[2]); + "author", + " Dim: " + tDataArray[3] + + "X: " + + tDataArray[0] + + " Y: " + + tDataArray[1] + + " Z: " + + tDataArray[2]); NBTTagList tNBTList = new NBTTagList(); StringBuilder tOres = new StringBuilder(" Prospected Ores: "); for (int i = 6; tDataArray.length > i; i++) { tOres.append(tDataArray[i]) - .append(" "); + .append(" "); } tNBTList.appendTag( - new NBTTagString( - "Tier " + tTier - + " Prospecting Data From: X" - + tDataArray[0] - + " Z:" - + tDataArray[2] - + " Dim:" - + tDataArray[3] - + " Produces " - + tDataArray[4] - + "L " - + tDataArray[5] - + " " - + tOres)); + new NBTTagString( + "Tier " + tTier + + " Prospecting Data From: X" + + tDataArray[0] + + " Z:" + + tDataArray[2] + + " Dim:" + + tDataArray[3] + + " Produces " + + tDataArray[4] + + "L " + + tDataArray[5] + + " " + + tOres)); tNBT.setTag("pages", tNBTList); } } else { // advanced prospection data @@ -4052,15 +3997,15 @@ public class GT_Utility { NBTTagList tNBTList = new NBTTagList(); String tPageText = "Prospector report\n" + tPos - + "\n\n" - + "Oils: " - + (tOils != null ? tOils.length : 0) - + "\n\n" - + "Ores within " - + tRadius - + " blocks\n\n" - + "Location is center of orevein\n\n" - + "Check NEI to confirm orevein type"; + + "\n\n" + + "Oils: " + + (tOils != null ? tOils.length : 0) + + "\n\n" + + "Ores within " + + tRadius + + " blocks\n\n" + + "Location is center of orevein\n\n" + + "Check NEI to confirm orevein type"; tNBTList.appendTag(new NBTTagString(tPageText)); if (tOres != null) fillBookWithList(tNBTList, "Ores Found %s\n\n", "\n", 7, tOres); @@ -4068,16 +4013,16 @@ public class GT_Utility { if (tOils != null) fillBookWithList(tNBTList, "Oils%s\n\n", "\n", 9, tOils); tPageText = """ - Oil notes + Oil notes - Prospects from NW to SE 576 chunks(9 8x8 oilfields) - around and gives min-max amount + Prospects from NW to SE 576 chunks(9 8x8 oilfields) + around and gives min-max amount - [1][2][3] - [4][5][6] - [7][8][9] + [1][2][3] + [4][5][6] + [7][8][9] - [5] - Prospector in this 8x8 area"""; + [5] - Prospector in this 8x8 area"""; tNBTList.appendTag(new NBTTagString(tPageText)); tPageText = "Corners of [5] are \n" + tOilsPosStr + "\n" + "P - Prospector in 8x8 field"; @@ -4090,7 +4035,7 @@ public class GT_Utility { } public static void fillBookWithList(NBTTagList aBook, String aPageHeader, String aListDelimiter, - int aItemsPerPage, String[] list) { + int aItemsPerPage, String[] list) { String aPageFormatter = " %d/%d"; int tTotalPages = list.length / aItemsPerPage + (list.length % aItemsPerPage > 0 ? 1 : 0); int tPage = 0; @@ -4099,7 +4044,7 @@ public class GT_Utility { tPageText = new StringBuilder(); for (int i = tPage * aItemsPerPage; i < (tPage + 1) * aItemsPerPage && i < list.length; i += 1) tPageText.append((tPageText.length() == 0) ? "" : aListDelimiter) - .append(list[i]); + .append(list[i]); if (tPageText.length() > 0) { String tPageCounter = tTotalPages > 1 ? String.format(aPageFormatter, tPage + 1, tTotalPages) : ""; @@ -4153,9 +4098,9 @@ public class GT_Utility { try { for (int i = 0; i < nbttaglist.tagCount(); ++i) { short short1 = nbttaglist.getCompoundTagAt(i) - .getShort("id"); + .getShort("id"); short short2 = nbttaglist.getCompoundTagAt(i) - .getShort("lvl"); + .getShort("lvl"); if (Enchantment.enchantmentsList[short1] != null) aBullshitModifier.calculateModifier(Enchantment.enchantmentsList[short1], short2); } @@ -4223,7 +4168,7 @@ public class GT_Utility { public static String toSubscript(long no) { char[] chars = Long.toString(no) - .toCharArray(); + .toCharArray(); for (int i = 0; i < chars.length; i++) { chars[i] += 8272; } @@ -4232,24 +4177,24 @@ public class GT_Utility { public static boolean isPartOfMaterials(ItemStack aStack, Materials aMaterials) { return GT_OreDictUnificator.getAssociation(aStack) != null - && GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial.equals(aMaterials); + && GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial.equals(aMaterials); } public static boolean isPartOfOrePrefix(ItemStack aStack, OrePrefixes aPrefix) { return GT_OreDictUnificator.getAssociation(aStack) != null - && GT_OreDictUnificator.getAssociation(aStack).mPrefix.equals(aPrefix); + && GT_OreDictUnificator.getAssociation(aStack).mPrefix.equals(aPrefix); } public static final ImmutableSet<String> ORE_BLOCK_CLASSES = ImmutableSet.of( - "com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores", - "com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres", - "gtPlusPlus.core.block.base.BlockBaseOre"); + "com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores", + "com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres", + "gtPlusPlus.core.block.base.BlockBaseOre"); public static boolean isOre(Block aBlock, int aMeta) { return (aBlock instanceof GT_Block_Ores_Abstract) || isOre(new ItemStack(aBlock, 1, aMeta)) - || ORE_BLOCK_CLASSES.contains( - aBlock.getClass() - .getName()); + || ORE_BLOCK_CLASSES.contains( + aBlock.getClass() + .getName()); } public static boolean isOre(ItemStack aStack) { @@ -4259,7 +4204,7 @@ public class GT_Utility { } for (int id : OreDictionary.getOreIDs(aStack)) { if (OreDictionary.getOreName(id) - .startsWith("ore")) { + .startsWith("ore")) { sOreTable.put(tItem, true); return true; } @@ -4277,8 +4222,8 @@ public class GT_Utility { // We take the modulus of the metadata by 16000 because that is the magic number to convert small ores to // regular ores. // See: GT_TileEntity_Ores.java - ItemData association = GT_OreDictUnificator.getAssociation( - new ItemStack(Item.getItemFromBlock(ore), 1, metaData % 16000)); + ItemData association = GT_OreDictUnificator + .getAssociation(new ItemStack(Item.getItemFromBlock(ore), 1, metaData % 16000)); if (association != null) { Supplier<ItemStack> supplier = sOreToCobble.get(association.mPrefix); if (supplier != null) { @@ -4303,11 +4248,11 @@ public class GT_Utility { ItemStack stack = GT_OreDictUnificator.get(o, 1); if (stack == null) { Optional<ItemStack> oStack = OreDictionary.getOres((String) o) - .stream() - .findAny(); + .stream() + .findAny(); if (oStack.isPresent()) { ItemStack copy = oStack.get() - .copy(); + .copy(); inputs.add(copy); } } else { @@ -4322,17 +4267,17 @@ public class GT_Utility { inputs.removeIf(x -> x.getItem() instanceof GT_MetaGenerated_Tool); return Optional.of( - new GT_Recipe( - false, - new ItemStack[] { output }, - inputs.toArray(new ItemStack[0]), - null, - null, - null, - null, - 300, - 30, - 0)); + new GT_Recipe( + false, + new ItemStack[] { output }, + inputs.toArray(new ItemStack[0]), + null, + null, + null, + null, + 300, + 30, + 0)); } public static Optional<GT_Recipe> reverseShapedRecipe(ItemStack output, Object... aRecipe) { @@ -4372,11 +4317,11 @@ public class GT_Utility { ItemStack stack = GT_OreDictUnificator.get(dictName, null, amount, false, true); if (stack == null) { Optional<ItemStack> oStack = OreDictionary.getOres(dictName) - .stream() - .findAny(); + .stream() + .findAny(); if (oStack.isPresent()) { ItemStack copy = oStack.get() - .copy(); + .copy(); copy.stackSize = amount; inputs.add(copy); } @@ -4394,17 +4339,17 @@ public class GT_Utility { inputs.removeIf(x -> x.getItem() instanceof GT_MetaGenerated_Tool); return Optional.of( - new GT_Recipe( - false, - new ItemStack[] { output }, - inputs.toArray(new ItemStack[0]), - null, - null, - null, - null, - 300, - 30, - 0)); + new GT_Recipe( + false, + new ItemStack[] { output }, + inputs.toArray(new ItemStack[0]), + null, + null, + null, + null, + 300, + 30, + 0)); } /** @@ -4421,8 +4366,8 @@ public class GT_Utility { public static long getNonnullElementCount(Object[] tArray) { return Arrays.stream(tArray) - .filter(Objects::nonNull) - .count(); + .filter(Objects::nonNull) + .count(); } public static int clamp(int val, int lo, int hi) { @@ -4456,8 +4401,8 @@ public class GT_Utility { public static int persistentHash(FluidStack aStack, boolean aUseStackSize, boolean aUseNBT) { if (aStack == null) return 0; int base = Objects.hashCode( - aStack.getFluid() - .getName()); + aStack.getFluid() + .getName()); if (aUseStackSize) base = base * 31 + aStack.amount; if (aUseNBT) base = base * 31 + Objects.hashCode(aStack.tag); @@ -4503,7 +4448,7 @@ public class GT_Utility { public static boolean isAnyIntegratedCircuit(ItemStack itemStack) { if (itemStack == null) return false; return itemStack.getItem() == ItemList.Circuit_Integrated.getItem() && 0 <= itemStack.getItemDamage() - && itemStack.getItemDamage() < 25; + && itemStack.getItemDamage() < 25; } public static byte convertRatioToRedstone(long used, long max, int threshold, boolean inverted) { @@ -4539,7 +4484,7 @@ public class GT_Utility { public static Stream<NBTTagCompound> streamCompounds(NBTTagList list) { if (list == null) return Stream.empty(); return IntStream.range(0, list.tagCount()) - .mapToObj(list::getCompoundTagAt); + .mapToObj(list::getCompoundTagAt); } public static boolean equals(ItemStack[] a, ItemStack[] b) { @@ -4557,13 +4502,13 @@ public class GT_Utility { * Guava ImmutableMap variant of Collectors.toMap. Optimized for serial streams. */ public static <T, K, U> Collector<T, ?, ImmutableMap<K, U>> toImmutableMapSerial( - Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends U> valueMapper) { + Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends U> valueMapper) { // petty type inference cannot work out the correct type parameter return Collector.<T, ImmutableMap.Builder<K, U>, ImmutableMap<K, U>>of( - ImmutableMap::builder, - (b, t) -> b.put(keyMapper.apply(t), valueMapper.apply(t)), - (b1, b2) -> b1.putAll(b2.build()), - ImmutableMap.Builder::build); + ImmutableMap::builder, + (b, t) -> b.put(keyMapper.apply(t), valueMapper.apply(t)), + (b1, b2) -> b1.putAll(b2.build()), + ImmutableMap.Builder::build); } public static boolean isArrayEmptyOrNull(Object[] arr) { @@ -4593,8 +4538,8 @@ public class GT_Utility { for (Collection<E> list : lists) { if (list == null || list.isEmpty()) { colls1 = lists.stream() - .filter(c -> c != null && !c.isEmpty()) - .collect(Collectors.toList()); + .filter(c -> c != null && !c.isEmpty()) + .collect(Collectors.toList()); break; } } @@ -4610,8 +4555,8 @@ public class GT_Utility { @Override public Iterator<E> iterator() { return colls.stream() - .flatMap(Collection::stream) - .iterator(); + .flatMap(Collection::stream) + .iterator(); } @Override @@ -4625,9 +4570,9 @@ public class GT_Utility { public static AutoValue_GT_Utility_ItemId create(NBTTagCompound tag) { return new AutoValue_GT_Utility_ItemId( - Item.getItemById(tag.getShort("item")), - tag.getShort("meta"), - tag.hasKey("tag", Constants.NBT.TAG_COMPOUND) ? tag.getCompoundTag("tag") : null); + Item.getItemById(tag.getShort("item")), + tag.getShort("meta"), + tag.hasKey("tag", Constants.NBT.TAG_COMPOUND) ? tag.getCompoundTag("tag") : null); } /** This method copies NBT, as it is mutable. */ @@ -4643,9 +4588,9 @@ public class GT_Utility { /** This method does not copy NBT in order to save time. Make sure not to mutate it! */ public static ItemId createNoCopy(ItemStack itemStack) { return new AutoValue_GT_Utility_ItemId( - itemStack.getItem(), - itemStack.getItemDamage(), - itemStack.getTagCompound()); + itemStack.getItem(), + itemStack.getItemDamage(), + itemStack.getTagCompound()); } protected abstract Item item(); diff --git a/src/main/java/gregtech/api/util/GT_UtilityClient.java b/src/main/java/gregtech/api/util/GT_UtilityClient.java index 2b4039a4c2..cf8ff6df86 100644 --- a/src/main/java/gregtech/api/util/GT_UtilityClient.java +++ b/src/main/java/gregtech/api/util/GT_UtilityClient.java @@ -14,10 +14,8 @@ import cpw.mods.fml.relauncher.ReflectionHelper; public class GT_UtilityClient { - private static final Field isDrawingField = ReflectionHelper.findField( - Tessellator.class, - "isDrawing", - "field_78415_z"); + private static final Field isDrawingField = ReflectionHelper + .findField(Tessellator.class, "isDrawing", "field_78415_z"); public static boolean isDrawing(Tessellator tess) { try { @@ -32,13 +30,12 @@ public class GT_UtilityClient { public static List<String> getTooltip(ItemStack aStack, boolean aGuiStyle) { try { List<String> tooltip = aStack.getTooltip( - Minecraft.getMinecraft().thePlayer, - Minecraft.getMinecraft().gameSettings.advancedItemTooltips); + Minecraft.getMinecraft().thePlayer, + Minecraft.getMinecraft().gameSettings.advancedItemTooltips); if (aGuiStyle) { tooltip.set( - 0, - (aStack.getRarity() == null ? EnumRarity.common : aStack.getRarity()).rarityColor - + tooltip.get(0)); + 0, + (aStack.getRarity() == null ? EnumRarity.common : aStack.getRarity()).rarityColor + tooltip.get(0)); for (int i = 1; i < tooltip.size(); i++) { tooltip.set(i, EnumChatFormatting.GRAY + tooltip.get(i)); } @@ -47,8 +44,8 @@ public class GT_UtilityClient { } catch (RuntimeException e) { // Collections.singletonList() can not be added to. we don't want that if (aGuiStyle) return Lists.newArrayList( - (aStack.getRarity() == null ? EnumRarity.common : aStack.getRarity()).rarityColor - + aStack.getDisplayName()); + (aStack.getRarity() == null ? EnumRarity.common : aStack.getRarity()).rarityColor + + aStack.getDisplayName()); return Lists.newArrayList(aStack.getDisplayName()); } } diff --git a/src/main/java/gregtech/api/util/IGT_HatchAdder.java b/src/main/java/gregtech/api/util/IGT_HatchAdder.java index dee0ac36ad..21796f172e 100644 --- a/src/main/java/gregtech/api/util/IGT_HatchAdder.java +++ b/src/main/java/gregtech/api/util/IGT_HatchAdder.java @@ -23,6 +23,6 @@ public interface IGT_HatchAdder<T> { default IGT_HatchAdder<T> orElse(IGT_HatchAdder<? super T> fallback) { return (t, iGregTechTileEntity, aShort) -> IGT_HatchAdder.this.apply(t, iGregTechTileEntity, aShort) - || fallback.apply(t, iGregTechTileEntity, aShort); + || fallback.apply(t, iGregTechTileEntity, aShort); } } diff --git a/src/main/java/gregtech/api/util/LightingHelper.java b/src/main/java/gregtech/api/util/LightingHelper.java index 986ac9d3aa..ad4e00fb7a 100644 --- a/src/main/java/gregtech/api/util/LightingHelper.java +++ b/src/main/java/gregtech/api/util/LightingHelper.java @@ -228,11 +228,11 @@ public class LightingHelper { } else { renderBlocks.colorRedTopLeft = renderBlocks.colorRedBottomLeft = renderBlocks.colorRedBottomRight = renderBlocks.colorRedTopRight = rgb[0] - * lightness; + * lightness; renderBlocks.colorGreenTopLeft = renderBlocks.colorGreenBottomLeft = renderBlocks.colorGreenBottomRight = renderBlocks.colorGreenTopRight = rgb[1] - * lightness; + * lightness; renderBlocks.colorBlueTopLeft = renderBlocks.colorBlueBottomLeft = renderBlocks.colorBlueBottomRight = renderBlocks.colorBlueTopRight = rgb[2] - * lightness; + * lightness; renderBlocks.colorRedTopLeft *= aoTopLeft; renderBlocks.colorGreenTopLeft *= aoTopLeft; @@ -345,184 +345,160 @@ public class LightingHelper { float ratio = (float) (1.0F - renderBlocks.renderMinX); float aoLightValue = renderBlocks.blockAccess.getBlock(x - 1, y, z) - .getAmbientOcclusionLightValue(); - - renderBlocks.aoBrightnessXYNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y - 1, - z); - renderBlocks.aoBrightnessXZNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y, - z - 1); - renderBlocks.aoBrightnessXZNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y, - z + 1); - renderBlocks.aoBrightnessXYNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y + 1, - z); - renderBlocks.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y - 1, - z - 1); - renderBlocks.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y - 1, - z + 1); - renderBlocks.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y + 1, - z - 1); - renderBlocks.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y + 1, - z + 1); + .getAmbientOcclusionLightValue(); + + renderBlocks.aoBrightnessXYNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z); + renderBlocks.aoBrightnessXZNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z - 1); + renderBlocks.aoBrightnessXZNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z + 1); + renderBlocks.aoBrightnessXYNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z); + renderBlocks.aoBrightnessXYZNNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z - 1); + renderBlocks.aoBrightnessXYZNNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z + 1); + renderBlocks.aoBrightnessXYZNPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z - 1); + renderBlocks.aoBrightnessXYZNPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z + 1); renderBlocks.aoLightValueScratchXYNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXZNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z - 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z - 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXZNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z + 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z + 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + ratio); int brightnessMixedXYZNPN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXZNN, - renderBlocks.aoBrightnessXYZNPN, - renderBlocks.aoBrightnessXYNP, - mixedBrightness); + renderBlocks.aoBrightnessXZNN, + renderBlocks.aoBrightnessXYZNPN, + renderBlocks.aoBrightnessXYNP, + mixedBrightness); int brightnessMixedXYZNNN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYZNNN, - renderBlocks.aoBrightnessXYNN, - renderBlocks.aoBrightnessXZNN, - mixedBrightness); + renderBlocks.aoBrightnessXYZNNN, + renderBlocks.aoBrightnessXYNN, + renderBlocks.aoBrightnessXZNN, + mixedBrightness); int brightnessMixedXYZNNP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYNN, - renderBlocks.aoBrightnessXYZNNP, - renderBlocks.aoBrightnessXZNP, - mixedBrightness); + renderBlocks.aoBrightnessXYNN, + renderBlocks.aoBrightnessXYZNNP, + renderBlocks.aoBrightnessXZNP, + mixedBrightness); int brightnessMixedXYZNPP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXZNP, - renderBlocks.aoBrightnessXYNP, - renderBlocks.aoBrightnessXYZNPP, - mixedBrightness); + renderBlocks.aoBrightnessXZNP, + renderBlocks.aoBrightnessXYNP, + renderBlocks.aoBrightnessXYZNPP, + mixedBrightness); float aoMixedXYZNPN = (renderBlocks.aoLightValueScratchXZNN + aoLightValue - + renderBlocks.aoLightValueScratchXYZNPN - + renderBlocks.aoLightValueScratchXYNP) / 4.0F; + + renderBlocks.aoLightValueScratchXYZNPN + + renderBlocks.aoLightValueScratchXYNP) / 4.0F; float aoMixedXYZNNN = (renderBlocks.aoLightValueScratchXYZNNN + renderBlocks.aoLightValueScratchXYNN - + renderBlocks.aoLightValueScratchXZNN - + aoLightValue) / 4.0F; + + renderBlocks.aoLightValueScratchXZNN + + aoLightValue) / 4.0F; float aoMixedXYZNNP = (renderBlocks.aoLightValueScratchXYNN + renderBlocks.aoLightValueScratchXYZNNP - + aoLightValue - + renderBlocks.aoLightValueScratchXZNP) / 4.0F; + + aoLightValue + + renderBlocks.aoLightValueScratchXZNP) / 4.0F; float aoMixedXYZNPP = (aoLightValue + renderBlocks.aoLightValueScratchXZNP - + renderBlocks.aoLightValueScratchXYNP - + renderBlocks.aoLightValueScratchXYZNPP) / 4.0F; + + renderBlocks.aoLightValueScratchXYNP + + renderBlocks.aoLightValueScratchXYZNPP) / 4.0F; aoTopLeft = (float) (aoMixedXYZNPP * renderBlocks.renderMaxY * renderBlocks.renderMaxZ - + aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ); + + aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ); aoBottomLeft = (float) (aoMixedXYZNPP * renderBlocks.renderMaxY * renderBlocks.renderMinZ - + aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ); + + aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ); aoBottomRight = (float) (aoMixedXYZNPP * renderBlocks.renderMinY * renderBlocks.renderMinZ - + aoMixedXYZNPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ); + + aoMixedXYZNPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ); aoTopRight = (float) (aoMixedXYZNPP * renderBlocks.renderMinY * renderBlocks.renderMaxZ - + aoMixedXYZNPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ); + + aoMixedXYZNPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ); renderBlocks.brightnessTopLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNPN, - brightnessMixedXYZNNN, - brightnessMixedXYZNNP, - renderBlocks.renderMaxY * renderBlocks.renderMaxZ, - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ), - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ), - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ); + brightnessMixedXYZNPP, + brightnessMixedXYZNPN, + brightnessMixedXYZNNN, + brightnessMixedXYZNNP, + renderBlocks.renderMaxY * renderBlocks.renderMaxZ, + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ), + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ), + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ); renderBlocks.brightnessBottomLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNPN, - brightnessMixedXYZNNN, - brightnessMixedXYZNNP, - renderBlocks.renderMaxY * renderBlocks.renderMinZ, - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ), - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ), - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ); + brightnessMixedXYZNPP, + brightnessMixedXYZNPN, + brightnessMixedXYZNNN, + brightnessMixedXYZNNP, + renderBlocks.renderMaxY * renderBlocks.renderMinZ, + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ), + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ), + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ); renderBlocks.brightnessBottomRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNPN, - brightnessMixedXYZNNN, - brightnessMixedXYZNNP, - renderBlocks.renderMinY * renderBlocks.renderMinZ, - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ), - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ), - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ); + brightnessMixedXYZNPP, + brightnessMixedXYZNPN, + brightnessMixedXYZNNN, + brightnessMixedXYZNNP, + renderBlocks.renderMinY * renderBlocks.renderMinZ, + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ), + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ), + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ); renderBlocks.brightnessTopRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNPN, - brightnessMixedXYZNNN, - brightnessMixedXYZNNP, - renderBlocks.renderMinY * renderBlocks.renderMaxZ, - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ), - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ), - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ); + brightnessMixedXYZNPP, + brightnessMixedXYZNPN, + brightnessMixedXYZNNN, + brightnessMixedXYZNNP, + renderBlocks.renderMinY * renderBlocks.renderMaxZ, + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ), + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ), + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ); } return this; @@ -554,184 +530,160 @@ public class LightingHelper { brightness = mixedBrightness; float aoLightValue = renderBlocks.blockAccess.getBlock(x + 1, y, z) - .getAmbientOcclusionLightValue(); - - renderBlocks.aoBrightnessXYPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y - 1, - z); - renderBlocks.aoBrightnessXZPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y, - z - 1); - renderBlocks.aoBrightnessXZPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y, - z + 1); - renderBlocks.aoBrightnessXYPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y + 1, - z); - renderBlocks.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y - 1, - z - 1); - renderBlocks.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y - 1, - z + 1); - renderBlocks.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y + 1, - z - 1); - renderBlocks.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y + 1, - z + 1); + .getAmbientOcclusionLightValue(); + + renderBlocks.aoBrightnessXYPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z); + renderBlocks.aoBrightnessXZPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z - 1); + renderBlocks.aoBrightnessXZPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z + 1); + renderBlocks.aoBrightnessXYPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z); + renderBlocks.aoBrightnessXYZPNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z - 1); + renderBlocks.aoBrightnessXYZPNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z + 1); + renderBlocks.aoBrightnessXYZPPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z - 1); + renderBlocks.aoBrightnessXYZPPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z + 1); renderBlocks.aoLightValueScratchXYPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXZPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXZPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXYPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXYZPNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXYZPNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXYZPPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXYZPPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); int brightnessMixedXYZPPP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXZPP, - renderBlocks.aoBrightnessXYPP, - renderBlocks.aoBrightnessXYZPPP, - mixedBrightness); + renderBlocks.aoBrightnessXZPP, + renderBlocks.aoBrightnessXYPP, + renderBlocks.aoBrightnessXYZPPP, + mixedBrightness); int brightnessMixedXYZPNP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYPN, - renderBlocks.aoBrightnessXYZPNP, - renderBlocks.aoBrightnessXZPP, - mixedBrightness); + renderBlocks.aoBrightnessXYPN, + renderBlocks.aoBrightnessXYZPNP, + renderBlocks.aoBrightnessXZPP, + mixedBrightness); int brightnessMixedXYZPNN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYZPNN, - renderBlocks.aoBrightnessXYPN, - renderBlocks.aoBrightnessXZPN, - mixedBrightness); + renderBlocks.aoBrightnessXYZPNN, + renderBlocks.aoBrightnessXYPN, + renderBlocks.aoBrightnessXZPN, + mixedBrightness); int brightnessMixedXYZPPN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXZPN, - renderBlocks.aoBrightnessXYZPPN, - renderBlocks.aoBrightnessXYPP, - mixedBrightness); + renderBlocks.aoBrightnessXZPN, + renderBlocks.aoBrightnessXYZPPN, + renderBlocks.aoBrightnessXYPP, + mixedBrightness); float aoMixedXYZPPP = (aoLightValue + renderBlocks.aoLightValueScratchXZPP - + renderBlocks.aoLightValueScratchXYPP - + renderBlocks.aoLightValueScratchXYZPPP) / 4.0F; + + renderBlocks.aoLightValueScratchXYPP + + renderBlocks.aoLightValueScratchXYZPPP) / 4.0F; float aoMixedXYZPNP = (renderBlocks.aoLightValueScratchXYPN + renderBlocks.aoLightValueScratchXYZPNP - + aoLightValue - + renderBlocks.aoLightValueScratchXZPP) / 4.0F; + + aoLightValue + + renderBlocks.aoLightValueScratchXZPP) / 4.0F; float aoMixedXYZPNN = (renderBlocks.aoLightValueScratchXYZPNN + renderBlocks.aoLightValueScratchXYPN - + renderBlocks.aoLightValueScratchXZPN - + aoLightValue) / 4.0F; + + renderBlocks.aoLightValueScratchXZPN + + aoLightValue) / 4.0F; float aoMixedXYZPPN = (renderBlocks.aoLightValueScratchXZPN + aoLightValue - + renderBlocks.aoLightValueScratchXYZPPN - + renderBlocks.aoLightValueScratchXYPP) / 4.0F; + + renderBlocks.aoLightValueScratchXYZPPN + + renderBlocks.aoLightValueScratchXYPP) / 4.0F; aoTopLeft = (float) (aoMixedXYZPNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZPPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMaxZ); + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZPPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMaxZ); aoBottomLeft = (float) (aoMixedXYZPNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZPPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMinZ); + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZPPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMinZ); aoBottomRight = (float) (aoMixedXYZPNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZPPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMinZ); + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZPPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMinZ); aoTopRight = (float) (aoMixedXYZPNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZPPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMaxZ); + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZPPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMaxZ); renderBlocks.brightnessTopLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZPPN, - brightnessMixedXYZPPP, - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ, - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ), - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ), - renderBlocks.renderMinY * renderBlocks.renderMaxZ); + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZPPN, + brightnessMixedXYZPPP, + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ, + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ), + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ), + renderBlocks.renderMinY * renderBlocks.renderMaxZ); renderBlocks.brightnessBottomLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZPPN, - brightnessMixedXYZPPP, - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ, - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ), - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ), - renderBlocks.renderMinY * renderBlocks.renderMinZ); + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZPPN, + brightnessMixedXYZPPP, + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ, + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ), + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ), + renderBlocks.renderMinY * renderBlocks.renderMinZ); renderBlocks.brightnessBottomRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZPPN, - brightnessMixedXYZPPP, - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ, - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ), - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ), - renderBlocks.renderMaxY * renderBlocks.renderMinZ); + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZPPN, + brightnessMixedXYZPPP, + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ, + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ), + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ), + renderBlocks.renderMaxY * renderBlocks.renderMinZ); renderBlocks.brightnessTopRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZPPN, - brightnessMixedXYZPPP, - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ, - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ), - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ), - renderBlocks.renderMaxY * renderBlocks.renderMaxZ); + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZPPN, + brightnessMixedXYZPPP, + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ, + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ), + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ), + renderBlocks.renderMaxY * renderBlocks.renderMaxZ); } return this; @@ -764,184 +716,160 @@ public class LightingHelper { float ratio = (float) (1.0F - renderBlocks.renderMinY); float aoLightValue = renderBlocks.blockAccess.getBlock(x, y - 1, z) - .getAmbientOcclusionLightValue(); - - renderBlocks.aoBrightnessXYNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - yOffset, - z); - renderBlocks.aoBrightnessYZNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - yOffset, - z - 1); - renderBlocks.aoBrightnessYZNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - yOffset, - z + 1); - renderBlocks.aoBrightnessXYPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - yOffset, - z); - renderBlocks.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - yOffset, - z - 1); - renderBlocks.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - yOffset, - z + 1); - renderBlocks.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - yOffset, - z - 1); - renderBlocks.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - yOffset, - z + 1); + .getAmbientOcclusionLightValue(); + + renderBlocks.aoBrightnessXYNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z); + renderBlocks.aoBrightnessYZNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z - 1); + renderBlocks.aoBrightnessYZNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z + 1); + renderBlocks.aoBrightnessXYPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z); + renderBlocks.aoBrightnessXYZNNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z - 1); + renderBlocks.aoBrightnessXYZNNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z + 1); + renderBlocks.aoBrightnessXYZPNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z - 1); + renderBlocks.aoBrightnessXYZPNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z + 1); renderBlocks.aoLightValueScratchXYNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchYZNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z - 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z - 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchYZNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z + 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z + 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZPNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZPNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) + .getAmbientOcclusionLightValue(), + ratio); int brightnessMixedXYZPNP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZNP, - renderBlocks.aoBrightnessXYZPNP, - renderBlocks.aoBrightnessXYPN, - mixedBrightness); + renderBlocks.aoBrightnessYZNP, + renderBlocks.aoBrightnessXYZPNP, + renderBlocks.aoBrightnessXYPN, + mixedBrightness); int brightnessMixedXYZPNN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZNN, - renderBlocks.aoBrightnessXYPN, - renderBlocks.aoBrightnessXYZPNN, - mixedBrightness); + renderBlocks.aoBrightnessYZNN, + renderBlocks.aoBrightnessXYPN, + renderBlocks.aoBrightnessXYZPNN, + mixedBrightness); int brightnessMixedXYZNNN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYNN, - renderBlocks.aoBrightnessXYZNNN, - renderBlocks.aoBrightnessYZNN, - mixedBrightness); + renderBlocks.aoBrightnessXYNN, + renderBlocks.aoBrightnessXYZNNN, + renderBlocks.aoBrightnessYZNN, + mixedBrightness); int brightnessMixedXYZNNP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYZNNP, - renderBlocks.aoBrightnessXYNN, - renderBlocks.aoBrightnessYZNP, - mixedBrightness); + renderBlocks.aoBrightnessXYZNNP, + renderBlocks.aoBrightnessXYNN, + renderBlocks.aoBrightnessYZNP, + mixedBrightness); float aoMixedXYZPNP = (renderBlocks.aoLightValueScratchYZNP + aoLightValue - + renderBlocks.aoLightValueScratchXYZPNP - + renderBlocks.aoLightValueScratchXYPN) / 4.0F; + + renderBlocks.aoLightValueScratchXYZPNP + + renderBlocks.aoLightValueScratchXYPN) / 4.0F; float aoMixedXYZPNN = (aoLightValue + renderBlocks.aoLightValueScratchYZNN - + renderBlocks.aoLightValueScratchXYPN - + renderBlocks.aoLightValueScratchXYZPNN) / 4.0F; + + renderBlocks.aoLightValueScratchXYPN + + renderBlocks.aoLightValueScratchXYZPNN) / 4.0F; float aoMixedXYZNNN = (renderBlocks.aoLightValueScratchXYNN + renderBlocks.aoLightValueScratchXYZNNN - + aoLightValue - + renderBlocks.aoLightValueScratchYZNN) / 4.0F; + + aoLightValue + + renderBlocks.aoLightValueScratchYZNN) / 4.0F; float aoMixedXYZNNP = (renderBlocks.aoLightValueScratchXYZNNP + renderBlocks.aoLightValueScratchXYNN - + renderBlocks.aoLightValueScratchYZNP - + aoLightValue) / 4.0F; + + renderBlocks.aoLightValueScratchYZNP + + aoLightValue) / 4.0F; aoTopLeft = (float) (aoMixedXYZNNP * renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPNP * renderBlocks.renderMaxZ * renderBlocks.renderMinX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPNP * renderBlocks.renderMaxZ * renderBlocks.renderMinX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); aoBottomLeft = (float) (aoMixedXYZNNP * renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPNP * renderBlocks.renderMinZ * renderBlocks.renderMinX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPNP * renderBlocks.renderMinZ * renderBlocks.renderMinX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); aoBottomRight = (float) (aoMixedXYZNNP * renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPNP * renderBlocks.renderMinZ * renderBlocks.renderMaxX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPNP * renderBlocks.renderMinZ * renderBlocks.renderMaxX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); aoTopRight = (float) (aoMixedXYZNNP * renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPNP * renderBlocks.renderMaxZ * renderBlocks.renderMaxX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPNP * renderBlocks.renderMaxZ * renderBlocks.renderMaxX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessTopLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX), - renderBlocks.renderMaxZ * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX), + renderBlocks.renderMaxZ * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); renderBlocks.brightnessBottomLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX), - renderBlocks.renderMinZ * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX), + renderBlocks.renderMinZ * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); renderBlocks.brightnessBottomRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX), - renderBlocks.renderMinZ * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX), + renderBlocks.renderMinZ * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessTopRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX), - renderBlocks.renderMaxZ * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX), + renderBlocks.renderMaxZ * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); } return this; @@ -973,184 +901,160 @@ public class LightingHelper { brightness = mixedBrightness; float aoLightValue = renderBlocks.blockAccess.getBlock(x, y + 1, z) - .getAmbientOcclusionLightValue(); - - renderBlocks.aoBrightnessXYNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - yOffset, - z); - renderBlocks.aoBrightnessXYPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - yOffset, - z); - renderBlocks.aoBrightnessYZPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - yOffset, - z - 1); - renderBlocks.aoBrightnessYZPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - yOffset, - z + 1); - renderBlocks.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - yOffset, - z - 1); - renderBlocks.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - yOffset, - z - 1); - renderBlocks.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - yOffset, - z + 1); - renderBlocks.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - yOffset, - z + 1); + .getAmbientOcclusionLightValue(); + + renderBlocks.aoBrightnessXYNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z); + renderBlocks.aoBrightnessXYPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z); + renderBlocks.aoBrightnessYZPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z - 1); + renderBlocks.aoBrightnessYZPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z + 1); + renderBlocks.aoBrightnessXYZNPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z - 1); + renderBlocks.aoBrightnessXYZPPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z - 1); + renderBlocks.aoBrightnessXYZNPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z + 1); + renderBlocks.aoBrightnessXYZPPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z + 1); renderBlocks.aoLightValueScratchXYNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchXYPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchYZPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchYZPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchXYZNPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchXYZPPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchXYZNPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchXYZPPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); int brightnessMixedXYZPPP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZPP, - renderBlocks.aoBrightnessXYZPPP, - renderBlocks.aoBrightnessXYPP, - mixedBrightness); + renderBlocks.aoBrightnessYZPP, + renderBlocks.aoBrightnessXYZPPP, + renderBlocks.aoBrightnessXYPP, + mixedBrightness); int brightnessMixedXYZPPN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZPN, - renderBlocks.aoBrightnessXYPP, - renderBlocks.aoBrightnessXYZPPN, - mixedBrightness); + renderBlocks.aoBrightnessYZPN, + renderBlocks.aoBrightnessXYPP, + renderBlocks.aoBrightnessXYZPPN, + mixedBrightness); int brightnessMixedXYZNPN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYNP, - renderBlocks.aoBrightnessXYZNPN, - renderBlocks.aoBrightnessYZPN, - mixedBrightness); + renderBlocks.aoBrightnessXYNP, + renderBlocks.aoBrightnessXYZNPN, + renderBlocks.aoBrightnessYZPN, + mixedBrightness); int brightnessMixedXYZNPP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYZNPP, - renderBlocks.aoBrightnessXYNP, - renderBlocks.aoBrightnessYZPP, - mixedBrightness); + renderBlocks.aoBrightnessXYZNPP, + renderBlocks.aoBrightnessXYNP, + renderBlocks.aoBrightnessYZPP, + mixedBrightness); float aoMixedXYZPPP = (renderBlocks.aoLightValueScratchYZPP + aoLightValue - + renderBlocks.aoLightValueScratchXYZPPP - + renderBlocks.aoLightValueScratchXYPP) / 4.0F; + + renderBlocks.aoLightValueScratchXYZPPP + + renderBlocks.aoLightValueScratchXYPP) / 4.0F; float aoMixedXYZPPN = (aoLightValue + renderBlocks.aoLightValueScratchYZPN - + renderBlocks.aoLightValueScratchXYPP - + renderBlocks.aoLightValueScratchXYZPPN) / 4.0F; + + renderBlocks.aoLightValueScratchXYPP + + renderBlocks.aoLightValueScratchXYZPPN) / 4.0F; float aoMixedXYZNPN = (renderBlocks.aoLightValueScratchXYNP + renderBlocks.aoLightValueScratchXYZNPN - + aoLightValue - + renderBlocks.aoLightValueScratchYZPN) / 4.0F; + + aoLightValue + + renderBlocks.aoLightValueScratchYZPN) / 4.0F; float aoMixedXYZNPP = (renderBlocks.aoLightValueScratchXYZNPP + renderBlocks.aoLightValueScratchXYNP - + renderBlocks.aoLightValueScratchYZPP - + aoLightValue) / 4.0F; + + renderBlocks.aoLightValueScratchYZPP + + aoLightValue) / 4.0F; aoTopLeft /* SE */ = (float) (aoMixedXYZNPP * renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPPP * renderBlocks.renderMaxZ * renderBlocks.renderMaxX - + aoMixedXYZPPN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX - + aoMixedXYZNPN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPPP * renderBlocks.renderMaxZ * renderBlocks.renderMaxX + + aoMixedXYZPPN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX + + aoMixedXYZNPN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); aoBottomLeft /* NE */ = (float) (aoMixedXYZNPP * renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPPP * renderBlocks.renderMinZ * renderBlocks.renderMaxX - + aoMixedXYZPPN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX - + aoMixedXYZNPN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPPP * renderBlocks.renderMinZ * renderBlocks.renderMaxX + + aoMixedXYZPPN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX + + aoMixedXYZNPN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); aoBottomRight /* NW */ = (float) (aoMixedXYZNPP * renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPPP * renderBlocks.renderMinZ * renderBlocks.renderMinX - + aoMixedXYZPPN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX - + aoMixedXYZNPN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPPP * renderBlocks.renderMinZ * renderBlocks.renderMinX + + aoMixedXYZPPN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX + + aoMixedXYZNPN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); aoTopRight /* SW */ = (float) (aoMixedXYZNPP * renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPPP * renderBlocks.renderMaxZ * renderBlocks.renderMinX - + aoMixedXYZPPN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX - + aoMixedXYZNPN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPPP * renderBlocks.renderMaxZ * renderBlocks.renderMinX + + aoMixedXYZPPN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX + + aoMixedXYZNPN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); renderBlocks.brightnessTopLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZPPP, - brightnessMixedXYZPPN, - brightnessMixedXYZNPN, - renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX), - renderBlocks.renderMaxZ * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); + brightnessMixedXYZNPP, + brightnessMixedXYZPPP, + brightnessMixedXYZPPN, + brightnessMixedXYZNPN, + renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX), + renderBlocks.renderMaxZ * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessBottomLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZPPP, - brightnessMixedXYZPPN, - brightnessMixedXYZNPN, - renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX), - renderBlocks.renderMinZ * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); + brightnessMixedXYZNPP, + brightnessMixedXYZPPP, + brightnessMixedXYZPPN, + brightnessMixedXYZNPN, + renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX), + renderBlocks.renderMinZ * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessBottomRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZPPP, - brightnessMixedXYZPPN, - brightnessMixedXYZNPN, - renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX), - renderBlocks.renderMinZ * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); + brightnessMixedXYZNPP, + brightnessMixedXYZPPP, + brightnessMixedXYZPPN, + brightnessMixedXYZNPN, + renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX), + renderBlocks.renderMinZ * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); renderBlocks.brightnessTopRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZPPP, - brightnessMixedXYZPPN, - brightnessMixedXYZNPN, - renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX), - renderBlocks.renderMaxZ * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); + brightnessMixedXYZNPP, + brightnessMixedXYZPPP, + brightnessMixedXYZPPN, + brightnessMixedXYZNPN, + renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX), + renderBlocks.renderMaxZ * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); } return this; @@ -1183,184 +1087,160 @@ public class LightingHelper { float ratio = (float) (1.0F - renderBlocks.renderMinZ); float aoLightValue = renderBlocks.blockAccess.getBlock(x, y, z - 1) - .getAmbientOcclusionLightValue(); - - renderBlocks.aoBrightnessXZNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - y, - zOffset); - renderBlocks.aoBrightnessYZNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - y - 1, - zOffset); - renderBlocks.aoBrightnessYZPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - y + 1, - zOffset); - renderBlocks.aoBrightnessXZPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - y, - zOffset); - renderBlocks.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - y - 1, - zOffset); - renderBlocks.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - y + 1, - zOffset); - renderBlocks.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - y - 1, - zOffset); - renderBlocks.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - y + 1, - zOffset); + .getAmbientOcclusionLightValue(); + + renderBlocks.aoBrightnessXZNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y, zOffset); + renderBlocks.aoBrightnessYZNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y - 1, zOffset); + renderBlocks.aoBrightnessYZPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y + 1, zOffset); + renderBlocks.aoBrightnessXZPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y, zOffset); + renderBlocks.aoBrightnessXYZNNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y - 1, zOffset); + renderBlocks.aoBrightnessXYZNPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y + 1, zOffset); + renderBlocks.aoBrightnessXYZPNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y - 1, zOffset); + renderBlocks.aoBrightnessXYZPPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y + 1, zOffset); renderBlocks.aoLightValueScratchXZNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchYZNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchYZPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXZPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZPNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZPPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) + .getAmbientOcclusionLightValue(), + ratio); int brightnessMixedXYZPPN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZPN, - renderBlocks.aoBrightnessXZPN, - renderBlocks.aoBrightnessXYZPPN, - mixedBrightness); + renderBlocks.aoBrightnessYZPN, + renderBlocks.aoBrightnessXZPN, + renderBlocks.aoBrightnessXYZPPN, + mixedBrightness); int brightnessMixedXYZPNN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZNN, - renderBlocks.aoBrightnessXYZPNN, - renderBlocks.aoBrightnessXZPN, - mixedBrightness); + renderBlocks.aoBrightnessYZNN, + renderBlocks.aoBrightnessXYZPNN, + renderBlocks.aoBrightnessXZPN, + mixedBrightness); int brightnessMixedXYZNNN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYZNNN, - renderBlocks.aoBrightnessXZNN, - renderBlocks.aoBrightnessYZNN, - mixedBrightness); + renderBlocks.aoBrightnessXYZNNN, + renderBlocks.aoBrightnessXZNN, + renderBlocks.aoBrightnessYZNN, + mixedBrightness); int brightnessMixedXYZNPN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXZNN, - renderBlocks.aoBrightnessXYZNPN, - renderBlocks.aoBrightnessYZPN, - mixedBrightness); + renderBlocks.aoBrightnessXZNN, + renderBlocks.aoBrightnessXYZNPN, + renderBlocks.aoBrightnessYZPN, + mixedBrightness); float aoMixedXYZPPN = (aoLightValue + renderBlocks.aoLightValueScratchYZPN - + renderBlocks.aoLightValueScratchXZPN - + renderBlocks.aoLightValueScratchXYZPPN) / 4.0F; + + renderBlocks.aoLightValueScratchXZPN + + renderBlocks.aoLightValueScratchXYZPPN) / 4.0F; float aoMixedXYZPNN = (renderBlocks.aoLightValueScratchYZNN + aoLightValue - + renderBlocks.aoLightValueScratchXYZPNN - + renderBlocks.aoLightValueScratchXZPN) / 4.0F; + + renderBlocks.aoLightValueScratchXYZPNN + + renderBlocks.aoLightValueScratchXZPN) / 4.0F; float aoMixedXYZNNN = (renderBlocks.aoLightValueScratchXYZNNN + renderBlocks.aoLightValueScratchXZNN - + renderBlocks.aoLightValueScratchYZNN - + aoLightValue) / 4.0F; + + renderBlocks.aoLightValueScratchYZNN + + aoLightValue) / 4.0F; float aoMixedXYZNPN = (renderBlocks.aoLightValueScratchXZNN + renderBlocks.aoLightValueScratchXYZNPN - + aoLightValue - + renderBlocks.aoLightValueScratchYZPN) / 4.0F; + + aoLightValue + + renderBlocks.aoLightValueScratchYZPN) / 4.0F; aoTopLeft = (float) (aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPPN * renderBlocks.renderMaxY * renderBlocks.renderMinX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPPN * renderBlocks.renderMaxY * renderBlocks.renderMinX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX)); aoBottomLeft = (float) (aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPPN * renderBlocks.renderMaxY * renderBlocks.renderMaxX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPPN * renderBlocks.renderMaxY * renderBlocks.renderMaxX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX)); aoBottomRight = (float) (aoMixedXYZNPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPPN * renderBlocks.renderMinY * renderBlocks.renderMaxX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPPN * renderBlocks.renderMinY * renderBlocks.renderMaxX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX)); aoTopRight = (float) (aoMixedXYZNPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPPN * renderBlocks.renderMinY * renderBlocks.renderMinX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPPN * renderBlocks.renderMinY * renderBlocks.renderMinX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX)); renderBlocks.brightnessTopLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPN, - brightnessMixedXYZPPN, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX), - renderBlocks.renderMaxY * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX)); + brightnessMixedXYZNPN, + brightnessMixedXYZPPN, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX), + renderBlocks.renderMaxY * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX)); renderBlocks.brightnessBottomLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPN, - brightnessMixedXYZPPN, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxX), - renderBlocks.renderMaxY * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX)); + brightnessMixedXYZNPN, + brightnessMixedXYZPPN, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxX), + renderBlocks.renderMaxY * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessBottomRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPN, - brightnessMixedXYZPPN, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxX), - renderBlocks.renderMinY * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX)); + brightnessMixedXYZNPN, + brightnessMixedXYZPPN, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxX), + renderBlocks.renderMinY * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessTopRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPN, - brightnessMixedXYZPPN, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinX), - renderBlocks.renderMinY * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX)); + brightnessMixedXYZNPN, + brightnessMixedXYZPPN, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinX), + renderBlocks.renderMinY * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX)); } return this; @@ -1392,184 +1272,160 @@ public class LightingHelper { brightness = mixedBrightness; float aoLightValue = renderBlocks.blockAccess.getBlock(x, y, z + 1) - .getAmbientOcclusionLightValue(); - - renderBlocks.aoBrightnessXZNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - y, - zOffset); - renderBlocks.aoBrightnessXZPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - y, - zOffset); - renderBlocks.aoBrightnessYZNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - y - 1, - zOffset); - renderBlocks.aoBrightnessYZPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - y + 1, - zOffset); - renderBlocks.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - y - 1, - zOffset); - renderBlocks.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - y + 1, - zOffset); - renderBlocks.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - y - 1, - zOffset); - renderBlocks.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - y + 1, - zOffset); + .getAmbientOcclusionLightValue(); + + renderBlocks.aoBrightnessXZNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y, zOffset); + renderBlocks.aoBrightnessXZPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y, zOffset); + renderBlocks.aoBrightnessYZNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y - 1, zOffset); + renderBlocks.aoBrightnessYZPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y + 1, zOffset); + renderBlocks.aoBrightnessXYZNNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y - 1, zOffset); + renderBlocks.aoBrightnessXYZNPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y + 1, zOffset); + renderBlocks.aoBrightnessXYZPNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y - 1, zOffset); + renderBlocks.aoBrightnessXYZPPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y + 1, zOffset); renderBlocks.aoLightValueScratchXZNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchXZPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchYZNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchYZPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchXYZNNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchXYZNPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchXYZPNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchXYZPPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); int brightnessMixedXYZNPP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXZNP, - renderBlocks.aoBrightnessXYZNPP, - renderBlocks.aoBrightnessYZPP, - mixedBrightness); + renderBlocks.aoBrightnessXZNP, + renderBlocks.aoBrightnessXYZNPP, + renderBlocks.aoBrightnessYZPP, + mixedBrightness); int brightnessMixedXYZNNP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYZNNP, - renderBlocks.aoBrightnessXZNP, - renderBlocks.aoBrightnessYZNP, - mixedBrightness); + renderBlocks.aoBrightnessXYZNNP, + renderBlocks.aoBrightnessXZNP, + renderBlocks.aoBrightnessYZNP, + mixedBrightness); int brightnessMixedXYZPNP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZNP, - renderBlocks.aoBrightnessXYZPNP, - renderBlocks.aoBrightnessXZPP, - mixedBrightness); + renderBlocks.aoBrightnessYZNP, + renderBlocks.aoBrightnessXYZPNP, + renderBlocks.aoBrightnessXZPP, + mixedBrightness); int brightnessMixedXYZPPP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZPP, - renderBlocks.aoBrightnessXZPP, - renderBlocks.aoBrightnessXYZPPP, - mixedBrightness); + renderBlocks.aoBrightnessYZPP, + renderBlocks.aoBrightnessXZPP, + renderBlocks.aoBrightnessXYZPPP, + mixedBrightness); float aoMixedXYZNPP = (renderBlocks.aoLightValueScratchXZNP + renderBlocks.aoLightValueScratchXYZNPP - + aoLightValue - + renderBlocks.aoLightValueScratchYZPP) / 4.0F; + + aoLightValue + + renderBlocks.aoLightValueScratchYZPP) / 4.0F; float aoMixedXYZNNP = (renderBlocks.aoLightValueScratchXYZNNP + renderBlocks.aoLightValueScratchXZNP - + renderBlocks.aoLightValueScratchYZNP - + aoLightValue) / 4.0F; + + renderBlocks.aoLightValueScratchYZNP + + aoLightValue) / 4.0F; float aoMixedXYZPNP = (renderBlocks.aoLightValueScratchYZNP + aoLightValue - + renderBlocks.aoLightValueScratchXYZPNP - + renderBlocks.aoLightValueScratchXZPP) / 4.0F; + + renderBlocks.aoLightValueScratchXYZPNP + + renderBlocks.aoLightValueScratchXZPP) / 4.0F; float aoMixedXYZPPP = (aoLightValue + renderBlocks.aoLightValueScratchYZPP - + renderBlocks.aoLightValueScratchXZPP - + renderBlocks.aoLightValueScratchXYZPPP) / 4.0F; + + renderBlocks.aoLightValueScratchXZPP + + renderBlocks.aoLightValueScratchXYZPPP) / 4.0F; aoTopLeft = (float) (aoMixedXYZNPP * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMinX - + aoMixedXYZPNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMinX + + aoMixedXYZPNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX)); aoBottomLeft = (float) (aoMixedXYZNPP * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMinX - + aoMixedXYZPNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMinX + + aoMixedXYZPNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX)); aoBottomRight = (float) (aoMixedXYZNPP * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMaxX - + aoMixedXYZPNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMaxX + + aoMixedXYZPNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX)); aoTopRight = (float) (aoMixedXYZNPP * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMaxX - + aoMixedXYZPNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMaxX + + aoMixedXYZPNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessTopLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPPP, - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX), - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX), - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX, - renderBlocks.renderMaxY * renderBlocks.renderMinX); + brightnessMixedXYZNPP, + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPPP, + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX), + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX), + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX, + renderBlocks.renderMaxY * renderBlocks.renderMinX); renderBlocks.brightnessBottomLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPPP, - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinX), - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX), - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX, - renderBlocks.renderMinY * renderBlocks.renderMinX); + brightnessMixedXYZNPP, + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPPP, + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinX), + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX), + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX, + renderBlocks.renderMinY * renderBlocks.renderMinX); renderBlocks.brightnessBottomRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPPP, - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxX), - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX), - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX, - renderBlocks.renderMinY * renderBlocks.renderMaxX); + brightnessMixedXYZNPP, + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPPP, + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxX), + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX), + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX, + renderBlocks.renderMinY * renderBlocks.renderMaxX); renderBlocks.brightnessTopRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPPP, - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxX), - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX), - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX, - renderBlocks.renderMaxY * renderBlocks.renderMaxX); + brightnessMixedXYZNPP, + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPPP, + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxX), + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX), + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX, + renderBlocks.renderMaxY * renderBlocks.renderMaxX); } return this; diff --git a/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java b/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java index 112fcd93cb..f2bcce2bf8 100644 --- a/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java +++ b/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java @@ -94,7 +94,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { /* Abstract Classes */ private abstract static class EntityWorldSpawnedEventBuilder extends WorldSpawnedEventBuilder - implements IEntityWorldSpawnedEvent { + implements IEntityWorldSpawnedEvent { private Entity entity; @@ -111,7 +111,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { } private abstract static class PositionedEntityWorldSpawnedEventBuilder extends EntityWorldSpawnedEventBuilder - implements IPositionedWorldSpawnedEvent { + implements IPositionedWorldSpawnedEvent { private Vec3 position; @@ -134,7 +134,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { } private abstract static class PositionedWorldSpawnedEventBuilder extends WorldSpawnedEventBuilder - implements IPositionedWorldSpawnedEvent { + implements IPositionedWorldSpawnedEvent { private Vec3 position; @@ -157,7 +157,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { } private abstract static class StringIdentifierPositionedWorldSpawnedEventBuilder - extends PositionedWorldSpawnedEventBuilder implements IStringIdentifierWorldSpawnedEvent { + extends PositionedWorldSpawnedEventBuilder implements IStringIdentifierWorldSpawnedEvent { private String identifier; @@ -180,7 +180,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { } private abstract static class SoundStringIdentifierPositionedWorldSpawnedEventBuilder - extends StringIdentifierPositionedWorldSpawnedEventBuilder implements ISoundWorldSpawnedEvent { + extends StringIdentifierPositionedWorldSpawnedEventBuilder implements ISoundWorldSpawnedEvent { private float pitch; private float volume; @@ -259,13 +259,13 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { throw new IllegalStateException("Position, identifier, motion and world must be set"); getWorld().spawnParticle( - getIdentifier(), - getPosition().xCoord, - getPosition().yCoord, - getPosition().zCoord, - getMotion().xCoord, - getMotion().yCoord, - getMotion().zCoord); + getIdentifier(), + getPosition().xCoord, + getPosition().yCoord, + getPosition().zCoord, + getMotion().xCoord, + getMotion().yCoord, + getMotion().zCoord); } } @@ -312,12 +312,12 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { throw new IllegalStateException(ILLEGAL_STATE_STR1); getWorld().playSoundEffect( - getPosition().xCoord, - getPosition().yCoord, - getPosition().zCoord, - getIdentifier(), - getPitch(), - getVolume()); + getPosition().xCoord, + getPosition().yCoord, + getPosition().zCoord, + getIdentifier(), + getPitch(), + getVolume()); } } @@ -370,13 +370,13 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { throw new IllegalStateException(ILLEGAL_STATE_STR1); getWorld().playSound( - getPosition().xCoord, - getPosition().yCoord, - getPosition().zCoord, - getIdentifier(), - getPitch(), - getVolume(), - isProximity()); + getPosition().xCoord, + getPosition().yCoord, + getPosition().zCoord, + getIdentifier(), + getPitch(), + getVolume(), + isProximity()); } } @@ -411,10 +411,10 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { throw new IllegalStateException(ILLEGAL_STATE_STR1); getWorld().playRecord( - getIdentifier(), - (int) getPosition().xCoord, - (int) getPosition().yCoord, - (int) getPosition().zCoord); + getIdentifier(), + (int) getPosition().xCoord, + (int) getPosition().yCoord, + (int) getPosition().zCoord); } } @@ -471,13 +471,13 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { throw new IllegalStateException("Position and world must be set"); getWorld().newExplosion( - getEntity(), - getPosition().xCoord, - getPosition().yCoord, - getPosition().zCoord, - strength, - isFlaming, - isSmoking); + getEntity(), + getPosition().xCoord, + getPosition().yCoord, + getPosition().zCoord, + strength, + isFlaming, + isSmoking); } } @@ -485,7 +485,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { * Positional Data is rounded down due to this targeting a block. */ public static final class ExtinguishFireEffectEventBuilder extends PositionedWorldSpawnedEventBuilder - implements IEntityPlayerWorldSpawnedEvent { + implements IEntityPlayerWorldSpawnedEvent { private int side; private EntityPlayer entityPlayer; @@ -531,16 +531,16 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { throw new IllegalStateException("EntityPlayer, position and world must be set"); getWorld().extinguishFire( - getEntityPlayer(), - (int) getPosition().xCoord, - (int) getPosition().yCoord, - (int) getPosition().zCoord, - side); + getEntityPlayer(), + (int) getPosition().xCoord, + (int) getPosition().yCoord, + (int) getPosition().zCoord, + side); } } public static final class SoundAtEntityEventBuilder extends EntityWorldSpawnedEventBuilder - implements ISoundWorldSpawnedEvent, IStringIdentifierWorldSpawnedEvent { + implements ISoundWorldSpawnedEvent, IStringIdentifierWorldSpawnedEvent { private float pitch; private float volume; @@ -605,7 +605,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { } public static final class SoundToNearExceptEventBuilder extends WorldSpawnedEventBuilder - implements ISoundWorldSpawnedEvent, IStringIdentifierWorldSpawnedEvent, IEntityPlayerWorldSpawnedEvent { + implements ISoundWorldSpawnedEvent, IStringIdentifierWorldSpawnedEvent, IEntityPlayerWorldSpawnedEvent { private float pitch; private float volume; |