From 72376d48343150478da2841e3e90923e340249c7 Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Mon, 9 Sep 2024 15:06:29 -1000 Subject: [PATCH 1/3] Fix JEI plugin failure when no potions are registered to the zeta registry, fix crash from ForgeZGatherHints (#50) --- src/main/java/org/violetmoon/zeta/registry/ZetaRegistry.java | 2 +- .../violetmoon/zetaimplforge/event/load/ForgeZGatherHints.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/violetmoon/zeta/registry/ZetaRegistry.java b/src/main/java/org/violetmoon/zeta/registry/ZetaRegistry.java index 2106b37..a67b0e7 100644 --- a/src/main/java/org/violetmoon/zeta/registry/ZetaRegistry.java +++ b/src/main/java/org/violetmoon/zeta/registry/ZetaRegistry.java @@ -285,6 +285,6 @@ protected void trackRegisteredObject(ResourceKey> keyGeneric, Ho * Gets all the registered objects from this Zeta */ public Collection> getRegisteredObjects(ResourceKey> registry) { - return (Collection>) (Collection) myRegisteredObjects.get((ResourceKey) registry); + return (Collection>) (Collection) myRegisteredObjects.getOrDefault((ResourceKey) registry, List.of()); } } diff --git a/src/main/java/org/violetmoon/zetaimplforge/event/load/ForgeZGatherHints.java b/src/main/java/org/violetmoon/zetaimplforge/event/load/ForgeZGatherHints.java index ae6c311..73487ca 100644 --- a/src/main/java/org/violetmoon/zetaimplforge/event/load/ForgeZGatherHints.java +++ b/src/main/java/org/violetmoon/zetaimplforge/event/load/ForgeZGatherHints.java @@ -4,11 +4,12 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.level.ItemLike; import net.minecraftforge.eventbus.api.Event; +import net.minecraftforge.fml.event.IModBusEvent; import org.violetmoon.zeta.config.ConfigFlagManager; import org.violetmoon.zeta.event.load.ZGatherHints; import org.violetmoon.zeta.module.ZetaModule; -public class ForgeZGatherHints extends Event implements ZGatherHints { +public class ForgeZGatherHints extends Event implements ZGatherHints, IModBusEvent { private final ZGatherHints wrapped; public ForgeZGatherHints(ZGatherHints e) { From e2eef4b29392081064040e1c12bc355ae27ebda4 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Mon, 9 Sep 2024 21:09:45 -0400 Subject: [PATCH 2/3] update workflow --- .github/workflows/gradle.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index f025d2d..4cf1b84 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -6,12 +6,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up JDK - uses: actions/setup-java@v2 - with: - distribution: 'temurin' - java-version: '17' + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Setup Java + run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> "$GITHUB_ENV" - name: Validate gradlew integrity uses: gradle/wrapper-validation-action@v1 - name: Cache From 2685e5dd70ee635b1d2d23c33a3ede3cb136b787 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Mon, 9 Sep 2024 21:11:20 -0400 Subject: [PATCH 3/3] update upload action --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 4cf1b84..45eccb7 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -43,7 +43,7 @@ jobs: gpg --local-user "Violet Moon Signing Key" --armor \ --detach-sign ${{ steps.calculate_artifact_names.outputs.forge }} - name: Archive Forge Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Forge path: |