Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Sep 27, 2024
1 parent b813c1f commit 79b994a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 25 deletions.
4 changes: 2 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion dependencies.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
neoforge=21.0.146
neoforge=21.1.62
25 changes: 6 additions & 19 deletions src/main/java/org/violetmoon/zeta/recipe/FlagIngredient.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -19,7 +21,7 @@
* @author WireSegal
* Created at 3:44 PM on 10/20/19.
*/
public class FlagIngredient extends Ingredient implements IZetaIngredient<FlagIngredient> { //AccessWidener? Idk I think this is cooked.
public class FlagIngredient implements ICustomIngredient, IZetaIngredient<FlagIngredient> { //AccessWidener? Idk I think this is cooked.

private final Ingredient parent;

Expand All @@ -28,27 +30,17 @@ public class FlagIngredient extends Ingredient implements IZetaIngredient<FlagIn
private final IZetaIngredientSerializer<FlagIngredient> serializer;

public FlagIngredient(Ingredient parent, String flag, ConfigFlagManager cfm, IZetaIngredientSerializer<FlagIngredient> serializer) {
super(Stream.of());
this.parent = parent;
this.cfm = cfm;
this.flag = flag;
this.serializer = serializer;
}

@Override
@NotNull
public ItemStack[] getItems() {
public Stream<ItemStack> 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
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/violetmoon/zeta/recipe/IZetaIngredient.java
Original file line number Diff line number Diff line change
@@ -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<T extends Ingredient> {
public interface IZetaIngredient<T extends ICustomIngredient> {
IZetaIngredientSerializer<T> zetaGetSerializer();
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -9,7 +10,7 @@
import net.minecraft.world.item.crafting.Ingredient;

// Copy of Forge IIngredientSerializer
public interface IZetaIngredientSerializer<T extends Ingredient> {
public interface IZetaIngredientSerializer<T extends ICustomIngredient> {
T parse(FriendlyByteBuf buffer);

T parse(JsonObject json);
Expand Down

0 comments on commit 79b994a

Please sign in to comment.