diff --git a/dependencies.gradle b/dependencies.gradle index 8a30ba1..0d7a5a7 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,3 +1,4 @@ dependencies { compileOnly 'curse.maven:cofh-lib-220333:2388748' + api("com.github.GTNewHorizons:GTNHLib:0.9.6:dev") } diff --git a/gradle.properties b/gradle.properties index 211588e..381c157 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,7 +14,7 @@ modId = BrandonsCore modGroup = com.brandon3055.brandonscore # Whether to use modGroup as the maven publishing group. -# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods. +# When false, com.github.GTNewHorizons is used. useModGroupForPublishing = false # Updates your build.gradle and settings.gradle automatically whenever an update is available. @@ -85,13 +85,20 @@ accessTransformersFile = # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! usesMixins = false +# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main. +# This can speed up compile times thanks to not running the mixin annotation processor on all input sources. +# Mixin classes will have access to "main" classes, but not the other way around. +separateMixinSourceSet = + # Adds some debug arguments like verbose output and class export. usesMixinDebug = false # Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. mixinPlugin = -# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! +# Specify the package that contains all of your Mixins. The package must exist or +# the build will fail. If you have a package property defined in your mixins..json, +# it must match with this or the build will fail. mixinsPackage = # Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! @@ -117,9 +124,15 @@ minimizeShadowedDependencies = true # If disabled, won't rename the shadowed classes. relocateShadowedDependencies = true -# Adds the GTNH maven, CurseMaven, Modrinth, and some more well-known 1.7.10 repositories. +# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories. includeWellKnownRepositories = true +# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated +# list of strings, with the acceptable keys being(case does not matter): +# cursemaven +# modrinth +excludeWellKnownRepositories = + # Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven. # Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables. # If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle. @@ -140,7 +153,7 @@ modrinthProjectId = # type can be one of [project, version], # and the name is the Modrinth project or version slug/id of the other mod. # Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech -# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true +# Note: UniMixins is automatically set as a required dependency if usesMixins = true. modrinthRelations = # Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens. @@ -161,6 +174,12 @@ curseForgeRelations = # projects. New projects should not use this parameter. # customArchiveBaseName = +# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory. +# runClientWorkingDirectory = run/client + +# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory. +# runServerWorkingDirectory = run/server + # Optional parameter to have the build automatically fail if an illegal version is used. # This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'. # The check is ONLY performed if the version is a git tag. diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e644113..1b33c55 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..d4081da 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index b740cf1..23d15a9 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -203,7 +205,7 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. @@ -211,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 25da30d..db3a6ac 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -68,11 +70,11 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/settings.gradle b/settings.gradle index 6fe010c..b4bf855 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.23' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.49' } diff --git a/src/main/java/com/brandon3055/brandonscore/BrandonsCore.java b/src/main/java/com/brandon3055/brandonscore/BrandonsCore.java index b532585..e4d507b 100644 --- a/src/main/java/com/brandon3055/brandonscore/BrandonsCore.java +++ b/src/main/java/com/brandon3055/brandonscore/BrandonsCore.java @@ -16,6 +16,7 @@ import cpw.mods.fml.relauncher.Side; @Mod(modid = BrandonsCore.MODID, version = BrandonsCore.VERSION, name = BrandonsCore.MODNAME) +@SuppressWarnings("unused") public class BrandonsCore { public static final String MODNAME = "Brandon's Core"; diff --git a/src/main/java/com/brandon3055/brandonscore/client/utills/ClientUtills.java b/src/main/java/com/brandon3055/brandonscore/client/utills/ClientUtills.java index 7214b42..621e884 100644 --- a/src/main/java/com/brandon3055/brandonscore/client/utills/ClientUtills.java +++ b/src/main/java/com/brandon3055/brandonscore/client/utills/ClientUtills.java @@ -7,6 +7,7 @@ /** * Created by brandon3055 on 11/11/2015. */ +@SuppressWarnings("unused") public class ClientUtills { public static void openLink(String url) { diff --git a/src/main/java/com/brandon3055/brandonscore/client/utills/GuiHelper.java b/src/main/java/com/brandon3055/brandonscore/client/utills/GuiHelper.java index ac9b7aa..354288a 100644 --- a/src/main/java/com/brandon3055/brandonscore/client/utills/GuiHelper.java +++ b/src/main/java/com/brandon3055/brandonscore/client/utills/GuiHelper.java @@ -13,6 +13,7 @@ /** * Created by Brandon on 28/06/2014. */ +@SuppressWarnings("unused") public class GuiHelper { public static final double PXL128 = 0.0078125; diff --git a/src/main/java/com/brandon3055/brandonscore/common/CommonProxy.java b/src/main/java/com/brandon3055/brandonscore/common/CommonProxy.java index 3ffdbf7..d03b214 100644 --- a/src/main/java/com/brandon3055/brandonscore/common/CommonProxy.java +++ b/src/main/java/com/brandon3055/brandonscore/common/CommonProxy.java @@ -9,6 +9,7 @@ /** * Created by Brandon on 14/5/2015. */ +@SuppressWarnings("unused") public class CommonProxy { public boolean isDedicatedServer() { diff --git a/src/main/java/com/brandon3055/brandonscore/common/handlers/IProcess.java b/src/main/java/com/brandon3055/brandonscore/common/handlers/IProcess.java index f2b9791..fb28da5 100644 --- a/src/main/java/com/brandon3055/brandonscore/common/handlers/IProcess.java +++ b/src/main/java/com/brandon3055/brandonscore/common/handlers/IProcess.java @@ -5,7 +5,7 @@ */ public interface IProcess { - public void updateProcess(); + void updateProcess(); - public boolean isDead(); + boolean isDead(); } diff --git a/src/main/java/com/brandon3055/brandonscore/common/handlers/ProcessHandler.java b/src/main/java/com/brandon3055/brandonscore/common/handlers/ProcessHandler.java index 0586758..2461616 100644 --- a/src/main/java/com/brandon3055/brandonscore/common/handlers/ProcessHandler.java +++ b/src/main/java/com/brandon3055/brandonscore/common/handlers/ProcessHandler.java @@ -28,6 +28,7 @@ public static void init() { } @SubscribeEvent + @SuppressWarnings("unused") public void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { @@ -47,11 +48,13 @@ public void onServerTick(TickEvent.ServerTickEvent event) { } @SubscribeEvent + @SuppressWarnings("unused") public void onWorldClose(WorldEvent.Unload event) { processes.clear(); newProcesses.clear(); } + @SuppressWarnings("unused") public static void addProcess(IProcess process) { newProcesses.add(process); } diff --git a/src/main/java/com/brandon3055/brandonscore/common/handlers/ZipHelper.java b/src/main/java/com/brandon3055/brandonscore/common/handlers/ZipHelper.java deleted file mode 100644 index 60153a8..0000000 --- a/src/main/java/com/brandon3055/brandonscore/common/handlers/ZipHelper.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.brandon3055.brandonscore.common.handlers; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Enumeration; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -/** - * Created by brandon3055 on 18/9/2015. - */ -public class ZipHelper { - - public static void unzip(File zipFile, File destination) throws IOException { - ZipFile zip = new ZipFile(zipFile); - - destination.mkdir(); - Enumeration zipFileEntries = zip.entries(); - - while (zipFileEntries.hasMoreElements()) { - ZipEntry entry = (ZipEntry) zipFileEntries.nextElement(); - String currentEntry = entry.getName(); - File destFile = new File(destination, currentEntry); - File destinationParent = destFile.getParentFile(); - destinationParent.mkdirs(); - - if (!entry.isDirectory()) { - BufferedInputStream is = new BufferedInputStream(zip.getInputStream(entry)); - int currentByte; - byte data[] = new byte[2048]; - FileOutputStream fos = new FileOutputStream(destFile); - BufferedOutputStream dest = new BufferedOutputStream(fos, 2048); - while ((currentByte = is.read(data, 0, 2048)) != -1) { - dest.write(data, 0, currentByte); - } - dest.flush(); - dest.close(); - is.close(); - } - } - } -} diff --git a/src/main/java/com/brandon3055/brandonscore/common/utills/DataUtills.java b/src/main/java/com/brandon3055/brandonscore/common/utills/DataUtills.java index 1e63a4d..31d547e 100644 --- a/src/main/java/com/brandon3055/brandonscore/common/utills/DataUtills.java +++ b/src/main/java/com/brandon3055/brandonscore/common/utills/DataUtills.java @@ -13,6 +13,7 @@ /** * Created by Brandon on 31/12/2014. */ +@SuppressWarnings("unused") public class DataUtills { public static DataUtills instance = new DataUtills(); diff --git a/src/main/java/com/brandon3055/brandonscore/common/utills/InfoHelper.java b/src/main/java/com/brandon3055/brandonscore/common/utills/InfoHelper.java index eae4218..d5405a3 100644 --- a/src/main/java/com/brandon3055/brandonscore/common/utills/InfoHelper.java +++ b/src/main/java/com/brandon3055/brandonscore/common/utills/InfoHelper.java @@ -1,5 +1,7 @@ package com.brandon3055.brandonscore.common.utills; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumberCompact; + import java.util.List; import net.minecraft.item.ItemStack; @@ -13,6 +15,7 @@ /** * Created by Brandon on 1/07/2014. */ +@SuppressWarnings("unused") public class InfoHelper { @SuppressWarnings("unchecked") @@ -20,16 +23,13 @@ public static void addEnergyInfo(ItemStack stack, List list) { IEnergyContainerItem item = (IEnergyContainerItem) stack.getItem(); int energy = item.getEnergyStored(stack); int maxEnergy = item.getMaxEnergyStored(stack); - String eS = ""; - String eM = ""; - if (energy < 1000) eS = String.valueOf(energy); - else if (energy < 1000000) eS = String.valueOf(energy); // Math.round((float)energy / 10F)/100F)+"k"; - else eS = String.valueOf(Math.round((float) energy / 1000F) / 1000F) + "m"; - if (maxEnergy < 1000) eM = String.valueOf(maxEnergy); - else if (maxEnergy < 1000000) eM = String.valueOf(Math.round((float) maxEnergy / 100F) / 10F) + "k"; - else eM = String.valueOf(Math.round((float) maxEnergy / 10000F) / 100F) + "m"; - - list.add(StatCollector.translateToLocal("info.de.charge.txt") + ": " + eS + " / " + eM + " RF"); + + list.add( + StatCollector.translateToLocal("info.de.charge.txt") + ": " + + formatNumberCompact(energy) + + " / " + + formatNumberCompact(maxEnergy) + + " RF"); } @SuppressWarnings("unchecked") diff --git a/src/main/java/com/brandon3055/brandonscore/common/utills/Utills.java b/src/main/java/com/brandon3055/brandonscore/common/utills/Utills.java index 3530d44..1cba09f 100644 --- a/src/main/java/com/brandon3055/brandonscore/common/utills/Utills.java +++ b/src/main/java/com/brandon3055/brandonscore/common/utills/Utills.java @@ -14,6 +14,7 @@ /** * Created by Brandon on 25/07/2014. */ +@SuppressWarnings("unused") public class Utills { public static IEntitySelector selectLivingBase = new IEntitySelector() { @@ -32,22 +33,6 @@ public boolean isEntityApplicable(Entity entity) { } }; - public static String formatNumber(double value) { - if (value < 1000D) return String.valueOf(value); - else if (value < 1000000D) return String.valueOf(Math.round(value) / 1000D) + "K"; - else if (value < 1000000000D) return String.valueOf(Math.round(value / 1000D) / 1000D) + "M"; - else if (value < 1000000000000D) return String.valueOf(Math.round(value / 1000000D) / 1000D) + "B"; - else return String.valueOf(Math.round(value / 1000000000D) / 1000D) + "T"; - } - - public static String formatNumber(long value) { - if (value < 1000L) return String.valueOf(value); - else if (value < 1000000L) return String.valueOf(Math.round(value) / 1000D) + "K"; - else if (value < 1000000000L) return String.valueOf(Math.round(value / 1000L) / 1000D) + "M"; - else if (value < 1000000000000L) return String.valueOf(Math.round(value / 1000000L) / 1000D) + "B"; - else return String.valueOf(Math.round(value / 1000000000L) / 1000D) + "T"; - } - /** * Add commas to a number e.g. 161253126 > 161,253,126 */