From 79b994a1d81f4877a72dcde466091a742c026395 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Fri, 27 Sep 2024 14:16:08 -0400 Subject: [PATCH] Update dependencies --- build.properties | 4 +-- dependencies.properties | 2 +- .../zeta/recipe/FlagIngredient.java | 25 +++++-------------- .../zeta/recipe/IZetaIngredient.java | 4 +-- .../recipe/IZetaIngredientSerializer.java | 3 ++- 5 files changed, 13 insertions(+), 25 deletions(-) diff --git a/build.properties b/build.properties index 988f2a7..5201dc0 100644 --- a/build.properties +++ b/build.properties @@ -1,8 +1,8 @@ #Tue Jun 11 13:34:58 UTC 2024 -mapping_version=1.20.1 +mapping_version=1.21 version=1.0 mod_name=Zeta -mc_version=1.21 +mc_version=1.21.1 mapping_channel=official mod_id=zeta build_number=20 diff --git a/dependencies.properties b/dependencies.properties index e61e593..14fc439 100644 --- a/dependencies.properties +++ b/dependencies.properties @@ -1 +1 @@ -neoforge=21.0.146 \ No newline at end of file +neoforge=21.1.62 \ No newline at end of file diff --git a/src/main/java/org/violetmoon/zeta/recipe/FlagIngredient.java b/src/main/java/org/violetmoon/zeta/recipe/FlagIngredient.java index 21b3aa3..171a6a2 100644 --- a/src/main/java/org/violetmoon/zeta/recipe/FlagIngredient.java +++ b/src/main/java/org/violetmoon/zeta/recipe/FlagIngredient.java @@ -1,7 +1,9 @@ package org.violetmoon.zeta.recipe; +import java.util.Arrays; import java.util.stream.Stream; +import net.neoforged.neoforge.common.crafting.ICustomIngredient; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.violetmoon.zeta.Zeta; @@ -19,7 +21,7 @@ * @author WireSegal * Created at 3:44 PM on 10/20/19. */ -public class FlagIngredient extends Ingredient implements IZetaIngredient { //AccessWidener? Idk I think this is cooked. +public class FlagIngredient implements ICustomIngredient, IZetaIngredient { //AccessWidener? Idk I think this is cooked. private final Ingredient parent; @@ -28,7 +30,6 @@ public class FlagIngredient extends Ingredient implements IZetaIngredient serializer; public FlagIngredient(Ingredient parent, String flag, ConfigFlagManager cfm, IZetaIngredientSerializer serializer) { - super(Stream.of()); this.parent = parent; this.cfm = cfm; this.flag = flag; @@ -36,19 +37,10 @@ public FlagIngredient(Ingredient parent, String flag, ConfigFlagManager cfm, IZe } @Override - @NotNull - public ItemStack[] getItems() { + public Stream getItems() { if (!cfm.getFlag(flag)) - return new ItemStack[0]; - return parent.getItems(); - } - - @Override - @NotNull - public IntList getStackingIds() { - if (!cfm.getFlag(flag)) - return IntLists.EMPTY_LIST; - return parent.getStackingIds(); + return Stream.empty(); + return Arrays.stream(parent.getItems()); } @Override @@ -59,11 +51,6 @@ public boolean test(@Nullable ItemStack target) { return parent.test(target); } - @Override - protected void invalidate() { - // The invalidate method will collect our parent as well - } - @Override public boolean isSimple() { return parent.isSimple(); diff --git a/src/main/java/org/violetmoon/zeta/recipe/IZetaIngredient.java b/src/main/java/org/violetmoon/zeta/recipe/IZetaIngredient.java index 79b7d1a..da0d42d 100644 --- a/src/main/java/org/violetmoon/zeta/recipe/IZetaIngredient.java +++ b/src/main/java/org/violetmoon/zeta/recipe/IZetaIngredient.java @@ -1,10 +1,10 @@ package org.violetmoon.zeta.recipe; -import net.minecraft.world.item.crafting.Ingredient; +import net.neoforged.neoforge.common.crafting.ICustomIngredient; /** * Forge hacks some custom IIngredientSerializer stuff onto Ingredient */ -public interface IZetaIngredient { +public interface IZetaIngredient { IZetaIngredientSerializer zetaGetSerializer(); } diff --git a/src/main/java/org/violetmoon/zeta/recipe/IZetaIngredientSerializer.java b/src/main/java/org/violetmoon/zeta/recipe/IZetaIngredientSerializer.java index bde77d9..3409480 100644 --- a/src/main/java/org/violetmoon/zeta/recipe/IZetaIngredientSerializer.java +++ b/src/main/java/org/violetmoon/zeta/recipe/IZetaIngredientSerializer.java @@ -1,5 +1,6 @@ package org.violetmoon.zeta.recipe; +import net.neoforged.neoforge.common.crafting.ICustomIngredient; import org.violetmoon.zeta.Zeta; import com.google.gson.JsonObject; @@ -9,7 +10,7 @@ import net.minecraft.world.item.crafting.Ingredient; // Copy of Forge IIngredientSerializer -public interface IZetaIngredientSerializer { +public interface IZetaIngredientSerializer { T parse(FriendlyByteBuf buffer); T parse(JsonObject json);