From 3255ff4bcdd9cbcc36eddd0c69b087c1fe5483f0 Mon Sep 17 00:00:00 2001 From: mezz Date: Sun, 8 Sep 2024 18:32:56 +0900 Subject: [PATCH] Fix JEI plugin failure when no potions are registered to the zeta registry --- src/main/java/org/violetmoon/zeta/registry/ZetaRegistry.java | 2 +- .../event/play/loading/ForgeZGatherAdditionalFlags.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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/play/loading/ForgeZGatherAdditionalFlags.java b/src/main/java/org/violetmoon/zetaimplforge/event/play/loading/ForgeZGatherAdditionalFlags.java index 330bf85..a0fdd66 100644 --- a/src/main/java/org/violetmoon/zetaimplforge/event/play/loading/ForgeZGatherAdditionalFlags.java +++ b/src/main/java/org/violetmoon/zetaimplforge/event/play/loading/ForgeZGatherAdditionalFlags.java @@ -4,6 +4,7 @@ import org.violetmoon.zeta.config.ConfigFlagManager; import org.violetmoon.zeta.event.play.loading.ZGatherAdditionalFlags; +@SuppressWarnings("removal") @Deprecated(forRemoval = true) public class ForgeZGatherAdditionalFlags extends Event implements ZGatherAdditionalFlags {