Skip to content

Commit

Permalink
Merge branch 'main' into refactor/test-mod
Browse files Browse the repository at this point in the history
  • Loading branch information
thecatcore authored Nov 28, 2024
2 parents 12c62e3 + e53f6f8 commit 63dba0f
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 31 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,25 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gradle/wrapper-validation-action@v2
- uses: gradle/actions/wrapper-validation@v3
- run: ./gradlew check build publishToMavenLocal --stacktrace -Porg.gradle.parallel.threads=4 --warning-mode=fail
- uses: Juuxel/publish-checkstyle-report@v1
if: ${{ failure() }}
with:
reports: |
**/build/reports/checkstyle/*.xml
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ matrix.java == '21-jdk' }}
with:
name: Artifacts
name: Main Artifacts
path: build/libs/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ matrix.java == '21-jdk' }}
with:
name: Artifacts
name: Modules Artifacts
path: ./**/build/libs/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ matrix.java == '21-jdk' }}
with:
name: Maven Local
path: /root/.m2/repository
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gradle/wrapper-validation-action@v2
- uses: gradle/actions/wrapper-validation@v3
- run: ./gradlew checkVersion build publish publishMods --stacktrace
env:
MAVEN_PUBLISH_CREDENTIALS: ${{ secrets.MAVEN_PUBLISH_CREDENTIALS }}
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ plugins {
id "eclipse"
id "idea"
id "maven-publish"
id "fabric-loom" version "1.6.2" apply false
id "legacy-looming" version "1.6.3" apply false
id "fabric-loom" version "1.8.11" apply false
id "legacy-looming" version "1.8.2" apply false
id "com.diffplug.spotless" version "6.20.0"
id "org.ajoberstar.grgit" version "3.1.1"
id "org.ajoberstar.grgit" version "5.2.2"
id "me.modmuss50.mod-publish-plugin" version "0.4.5"
}

Expand Down Expand Up @@ -158,7 +158,7 @@ def static setupRepositories(RepositoryHandler repositories) {
def ENV = System.getenv()
if (ENV.MAVEN_PUBLISH_CREDENTIALS) {
repositories.maven {
url "https://repo.legacyfabric.net/repository/legacyfabric"
url "https://maven.legacyfabric.net/"
credentials {
username ENV.MAVEN_PUBLISH_CREDENTIALS.split(":")[0]
password ENV.MAVEN_PUBLISH_CREDENTIALS.split(":")[1]
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ repositories {
}

dependencies {
implementation("net.fabricmc:fabric-loader:0.15.6")
implementation("net.fabricmc:fabric-loader:0.16.8")
implementation("commons-codec:commons-codec:1.16.1")
}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.parallel=true

base_version = 1.10.2
loader_version = 0.15.7
base_version = 1.10.3
loader_version = 0.15.11
yarn_mappings_build = 530

## Module versions
Expand All @@ -20,4 +20,4 @@ legacy-fabric-networking-api-v1.version = 2.0.2
legacy-fabric-permissions-api-v1.version = 1.1.0
legacy-fabric-registry-sync-api-v1.version = 2.2.0
legacy-fabric-rendering-api-v1.version = 1.0.0
legacy-fabric-resource-loader-v1.version = 2.2.1
legacy-fabric-resource-loader-v1.version = 2.2.2
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ 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
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##########################################################################
Expand Down Expand Up @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

public class ResourceManagerHelperImpl implements ResourceManagerHelper {
private static final ResourceManagerHelperImpl INSTANCE = new ResourceManagerHelperImpl();
private static final Logger LOGGER = Logger.get(LoggerImpl.API, "ResourceManagerHelperImpl");
public static final Logger LOGGER = Logger.get(LoggerImpl.API, "ResourceManagerHelperImpl");

private final Set<Identifier> addedListenerIds = new HashSet<>();
private final Set<IdentifiableResourceReloadListener> addedListeners = new LinkedHashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import net.minecraft.util.Identifier;

import net.legacyfabric.fabric.api.util.VersionUtils;
import net.legacyfabric.fabric.impl.resource.loader.ResourceManagerHelperImpl;

@Mixin(TranslationStorage.class)
public abstract class TranslationStorageMixin {
Expand Down Expand Up @@ -148,7 +149,13 @@ private void recursiveLoadTranslations(@NotNull String currentKey, JsonObject ob
key = entry.getKey();
}

this.translations.put(key, TOKEN_PATTERN.matcher(entry.getValue().getAsString()).replaceAll("%$1s"));
JsonElement value = entry.getValue();

if (value.isJsonPrimitive()) {
this.translations.put(key, TOKEN_PATTERN.matcher(value.getAsString()).replaceAll("%$1s"));
} else {
ResourceManagerHelperImpl.LOGGER.warn("Skipping translation key \"" + key + "\" with unsupported format " + value);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pluginManagement {
}
maven {
name = "legacy-fabric"
url = "https://repo.legacyfabric.net/repository/legacyfabric/"
url = "https://maven.legacyfabric.net/"
}
gradlePluginPortal()
mavenLocal()
Expand Down

0 comments on commit 63dba0f

Please sign in to comment.