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(), |
