diff --git a/.github/scripts/test-no-error-reports.sh b/.github/scripts/test-no-error-reports.sh deleted file mode 100644 index e387660..0000000 --- a/.github/scripts/test-no-error-reports.sh +++ /dev/null @@ -1,27 +0,0 @@ -if [[ -d "run/crash-reports" ]]; then - echo "Crash reports detected:" - cat $directory/* - exit 1 -fi - -if grep --quiet "Fatal errors were detected" server.log; then - echo "Fatal errors detected:" - cat server.log - exit 1 -fi - -if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" server.log; then - echo "Server force stopped:" - cat server.log - exit 1 -fi - -if grep --quiet 'Done .+ For help, type "help" or "?"' server.log; then - echo "Server didn't finish startup:" - cat server.log - exit 1 -fi - -echo "No crash reports detected" -exit 0 - diff --git a/.gitignore b/.gitignore index 48c525b..5e80e0a 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,13 @@ whitelist.json *.iml *.ipr *.iws -src/main/resources/mixins.*.json +src/main/resources/mixins.*([!.]).json *.bat *.DS_Store !gradlew.bat +.factorypath +addon.local.gradle +addon.local.gradle.kts +addon.late.local.gradle +addon.late.local.gradle.kts +layout.json diff --git a/gradle.properties b/gradle.properties index 05cbf4b..9630a20 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,7 +33,7 @@ channel = stable mappingsVersion = 12 # Defines other MCP mappings for dependency deobfuscation. -remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ +remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ # Select a default username for testing your mod. You can always override this per-run by running # `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE. @@ -50,16 +50,10 @@ enableGenericInjection = false # Generate a class with a String field for the mod version named as defined below. # If generateGradleTokenClass is empty or not missing, no such class will be generated. # If gradleTokenVersion is empty or missing, the field will not be present in the class. -generateGradleTokenClass = +generateGradleTokenClass = alexiil.mods.load.Tags # Name of the token containing the project's current version to generate/replace. -gradleTokenVersion = GRADLETOKEN_VERSION - -# [DEPRECATED] Mod ID replacement token. -gradleTokenModId = - -# [DEPRECATED] Mod name replacement token. -gradleTokenModName = +gradleTokenVersion = VERSION # [DEPRECATED] # Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java @@ -67,7 +61,7 @@ gradleTokenModName = # The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's # version in @Mod([...], version = VERSION, [...]). # Leave these properties empty to skip individual token replacements. -replaceGradleTokenInFile = Lib.java +# replaceGradleTokenInFile = # In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can # leave this property empty. @@ -123,7 +117,7 @@ includeWellKnownRepositories = true usesMavenPublishing = true # Maven repository to publish the mod to. -# mavenPublishUrl = https://nexus.gtnewhorizons.com/repository/releases/ +# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/ # Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token. # @@ -187,5 +181,3 @@ curseForgeRelations = # This is meant to be set in $HOME/.gradle/gradle.properties. # ideaCheckSpotlessOnBuild = true -# Non-GTNH properties -gradleTokenGroupName = diff --git a/settings.gradle b/settings.gradle index e8946ad..b11efb0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.8' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.16' } diff --git a/src/main/java/alexiil/mods/load/BetterLoadingScreen.java b/src/main/java/alexiil/mods/load/BetterLoadingScreen.java index 4d19b78..4d0c13b 100644 --- a/src/main/java/alexiil/mods/load/BetterLoadingScreen.java +++ b/src/main/java/alexiil/mods/load/BetterLoadingScreen.java @@ -35,7 +35,7 @@ @Mod( modid = Lib.Mod.ID, - version = Lib.Mod.VERSION, + version = Tags.VERSION, name = Lib.Mod.NAME, acceptedMinecraftVersions = "[1.7.10]", guiFactory = "alexiil.mods.load.gui.ConfigGuiFactory", diff --git a/src/main/java/alexiil/mods/load/Lib.java b/src/main/java/alexiil/mods/load/Lib.java index c16ba2e..f9d68a6 100644 --- a/src/main/java/alexiil/mods/load/Lib.java +++ b/src/main/java/alexiil/mods/load/Lib.java @@ -6,6 +6,5 @@ public static class Mod { public static final String ID = "betterloadingscreen"; public static final String NAME = "Better Loading Screen GTNH"; - public static final String VERSION = "GRADLETOKEN_VERSION"; } } diff --git a/src/main/java/alexiil/mods/load/Translation.java b/src/main/java/alexiil/mods/load/Translation.java index 5fe59fa..f9dc184 100644 --- a/src/main/java/alexiil/mods/load/Translation.java +++ b/src/main/java/alexiil/mods/load/Translation.java @@ -13,19 +13,23 @@ import java.util.jar.JarEntry; import java.util.jar.JarFile; +import net.minecraft.util.StatCollector; + @Deprecated public class Translation { - private static Map translators = new HashMap(); + private static final Map translators = new HashMap<>(); private static Translation currentTranslation = null; - private Map translations = new HashMap(); + private final Map translations = new HashMap<>(); public static String translate(String toTranslate) { return translate(toTranslate, toTranslate); } public static String translate(String toTranslate, String failure) { - // return I18n.format(toTranslate); + if (StatCollector.canTranslate(toTranslate)) { + return StatCollector.translateToLocal(toTranslate); + } if (currentTranslation != null) return currentTranslation.translateInternal(toTranslate, failure); return failure; }