From a9d95ccb80cd2d93b31788b85c30bfbc3e6205d1 Mon Sep 17 00:00:00 2001 From: Spoilers <33331567+ace10102@users.noreply.github.com> Date: Thu, 13 Jul 2023 12:50:15 -0400 Subject: [PATCH 1/3] Rollback jfrog.buildinfo Rollback jfrog.buildinfo to v4.33.1 due to breaking changes in v5.0.0 reference: https://github.com/jfrog/build-info/issues/745 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index fad79cbf454..d68f6532ce1 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { classpath('com.anatawa12.forge:ForgeGradle:1.2-1.0.+') { changing = true } - classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release" + classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.33.1" } } From 87c86ad06d8f1e8deee08a89c015c228fbed4365 Mon Sep 17 00:00:00 2001 From: Spoilers <33331567+ace10102@users.noreply.github.com> Date: Thu, 20 Jul 2023 12:06:25 -0400 Subject: [PATCH 2/3] Reformat GasRegistry reformat GasRegistry.class --- .../java/mekanism/api/gas/GasRegistry.java | 191 ++++++++---------- 1 file changed, 85 insertions(+), 106 deletions(-) diff --git a/src/main/java/mekanism/api/gas/GasRegistry.java b/src/main/java/mekanism/api/gas/GasRegistry.java index ef11b86657d..9852e677c26 100644 --- a/src/main/java/mekanism/api/gas/GasRegistry.java +++ b/src/main/java/mekanism/api/gas/GasRegistry.java @@ -5,109 +5,88 @@ import java.util.ArrayList; import java.util.List; -public class GasRegistry -{ - private static ArrayList registeredGasses = new ArrayList(); - - /** - * Register a new gas into GasRegistry. - * @param gas - Gas to register - * @return the gas that has been registered, pulled right out of GasRegistry - */ - public static Gas register(Gas gas) - { - if(gas == null) - { - return null; - } - - registeredGasses.add(gas); - - return getGas(gas.getName()); - } - - /** - * Gets the gas associated with the defined ID. - * @param id - ID to check - * @return gas associated with defined ID - */ - public static Gas getGas(int id) - { - if(id == -1) - { - return null; - } - - return registeredGasses.get(id); - } - - /** - * Gets the gas associated with the defined fluid. - * @param f - fluid to check - * @return the gas associated with the fluid - */ - public static Gas getGas(Fluid f) - { - for(Gas gas : getRegisteredGasses()) - { - if(gas.hasFluid() && gas.getFluid() == f) - { - return gas; - } - } - - return null; - } - - /** - * Whether or not GasRegistry contains a gas with the specified name - * @param name - name to check - * @return if GasRegistry contains a gas with the defined name - */ - public static boolean containsGas(String name) - { - return getGas(name) != null; - } - - /** - * Gets the list of all gasses registered in GasRegistry. - * @return a cloned list of all registered gasses - */ - public static List getRegisteredGasses() - { - return (List)registeredGasses.clone(); - } - - /** - * Gets the gas associated with the specified name. - * @param name - name of the gas to get - * @return gas associated with the name - */ - public static Gas getGas(String name) - { - for(Gas gas : registeredGasses) - { - if(gas.getName().toLowerCase().equals(name.toLowerCase())) - { - return gas; - } - } - - return null; - } - - /** - * Gets the gas ID of a specified gas. - * @param gas - gas to get the ID from - * @return gas ID - */ - public static int getGasID(Gas gas) - { - if(gas == null || !containsGas(gas.getName())) - { - return -1; - } - - return registeredGasses.indexOf(gas); - } -} +public class GasRegistry { + private static ArrayList registeredGasses = new ArrayList(); + + /** + * Register a new gas into GasRegistry. + * @param gas - Gas to register + * @return the gas that has been registered, pulled right out of GasRegistry + */ + public static Gas register(Gas gas) { + if (gas == null) { + return null; + } + registeredGasses.add(gas); + return getGas(gas.getName()); + } + + /** + * Gets the gas associated with the defined ID. + * @param id - ID to check + * @return gas associated with defined ID + */ + public static Gas getGas(int id) { + if (id == -1) { + return null; + } + return registeredGasses.get(id); + } + + /** + * Gets the gas associated with the defined fluid. + * @param f - fluid to check + * @return the gas associated with the fluid + */ + public static Gas getGas(Fluid f) { + for (Gas gas : getRegisteredGasses()) { + if (gas.hasFluid() && gas.getFluid() == f) { + return gas; + } + } + return null; + } + + /** + * Whether or not GasRegistry contains a gas with the specified name + * @param name - name to check + * @return if GasRegistry contains a gas with the defined name + */ + public static boolean containsGas(String name) { + return getGas(name) != null; + } + + /** + * Gets the list of all gasses registered in GasRegistry. + * @return a cloned list of all registered gasses + */ + public static List getRegisteredGasses() { + return (List)registeredGasses.clone(); + } + + /** + * Gets the gas associated with the specified name. + * @param name - name of the gas to get + * @return gas associated with the name + */ + public static Gas getGas(String name) { + for (Gas gas : registeredGasses) { + if (gas.getName().toLowerCase().equals(name.toLowerCase())) { + return gas; + } + } + return null; + } + + /** + * Gets the gas ID of a specified gas. + * @param gas - gas to get the ID from + * @return gas ID + */ + public static int getGasID(Gas gas) { + if (gas == null || !containsGas(gas.getName())) { + return -1; + } + return registeredGasses.indexOf(gas); + } +} \ No newline at end of file From d0d66c57d75db250d3f45f80afffd70b4616db3b Mon Sep 17 00:00:00 2001 From: Spoilers <33331567+ace10102@users.noreply.github.com> Date: Thu, 20 Jul 2023 12:35:23 -0400 Subject: [PATCH 3/3] Revert "Reformat GasRegistry" This reverts commit 87c86ad06d8f1e8deee08a89c015c228fbed4365. --- .../java/mekanism/api/gas/GasRegistry.java | 191 ++++++++++-------- 1 file changed, 106 insertions(+), 85 deletions(-) diff --git a/src/main/java/mekanism/api/gas/GasRegistry.java b/src/main/java/mekanism/api/gas/GasRegistry.java index 9852e677c26..ef11b86657d 100644 --- a/src/main/java/mekanism/api/gas/GasRegistry.java +++ b/src/main/java/mekanism/api/gas/GasRegistry.java @@ -5,88 +5,109 @@ import java.util.ArrayList; import java.util.List; -public class GasRegistry { - private static ArrayList registeredGasses = new ArrayList(); - - /** - * Register a new gas into GasRegistry. - * @param gas - Gas to register - * @return the gas that has been registered, pulled right out of GasRegistry - */ - public static Gas register(Gas gas) { - if (gas == null) { - return null; - } - registeredGasses.add(gas); - return getGas(gas.getName()); - } - - /** - * Gets the gas associated with the defined ID. - * @param id - ID to check - * @return gas associated with defined ID - */ - public static Gas getGas(int id) { - if (id == -1) { - return null; - } - return registeredGasses.get(id); - } - - /** - * Gets the gas associated with the defined fluid. - * @param f - fluid to check - * @return the gas associated with the fluid - */ - public static Gas getGas(Fluid f) { - for (Gas gas : getRegisteredGasses()) { - if (gas.hasFluid() && gas.getFluid() == f) { - return gas; - } - } - return null; - } - - /** - * Whether or not GasRegistry contains a gas with the specified name - * @param name - name to check - * @return if GasRegistry contains a gas with the defined name - */ - public static boolean containsGas(String name) { - return getGas(name) != null; - } - - /** - * Gets the list of all gasses registered in GasRegistry. - * @return a cloned list of all registered gasses - */ - public static List getRegisteredGasses() { - return (List)registeredGasses.clone(); - } - - /** - * Gets the gas associated with the specified name. - * @param name - name of the gas to get - * @return gas associated with the name - */ - public static Gas getGas(String name) { - for (Gas gas : registeredGasses) { - if (gas.getName().toLowerCase().equals(name.toLowerCase())) { - return gas; - } - } - return null; - } - - /** - * Gets the gas ID of a specified gas. - * @param gas - gas to get the ID from - * @return gas ID - */ - public static int getGasID(Gas gas) { - if (gas == null || !containsGas(gas.getName())) { - return -1; - } - return registeredGasses.indexOf(gas); - } -} \ No newline at end of file +public class GasRegistry +{ + private static ArrayList registeredGasses = new ArrayList(); + + /** + * Register a new gas into GasRegistry. + * @param gas - Gas to register + * @return the gas that has been registered, pulled right out of GasRegistry + */ + public static Gas register(Gas gas) + { + if(gas == null) + { + return null; + } + + registeredGasses.add(gas); + + return getGas(gas.getName()); + } + + /** + * Gets the gas associated with the defined ID. + * @param id - ID to check + * @return gas associated with defined ID + */ + public static Gas getGas(int id) + { + if(id == -1) + { + return null; + } + + return registeredGasses.get(id); + } + + /** + * Gets the gas associated with the defined fluid. + * @param f - fluid to check + * @return the gas associated with the fluid + */ + public static Gas getGas(Fluid f) + { + for(Gas gas : getRegisteredGasses()) + { + if(gas.hasFluid() && gas.getFluid() == f) + { + return gas; + } + } + + return null; + } + + /** + * Whether or not GasRegistry contains a gas with the specified name + * @param name - name to check + * @return if GasRegistry contains a gas with the defined name + */ + public static boolean containsGas(String name) + { + return getGas(name) != null; + } + + /** + * Gets the list of all gasses registered in GasRegistry. + * @return a cloned list of all registered gasses + */ + public static List getRegisteredGasses() + { + return (List)registeredGasses.clone(); + } + + /** + * Gets the gas associated with the specified name. + * @param name - name of the gas to get + * @return gas associated with the name + */ + public static Gas getGas(String name) + { + for(Gas gas : registeredGasses) + { + if(gas.getName().toLowerCase().equals(name.toLowerCase())) + { + return gas; + } + } + + return null; + } + + /** + * Gets the gas ID of a specified gas. + * @param gas - gas to get the ID from + * @return gas ID + */ + public static int getGasID(Gas gas) + { + if(gas == null || !containsGas(gas.getName())) + { + return -1; + } + + return registeredGasses.indexOf(gas); + } +}