-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ItemStackFromIngredient always having empty tags
- Loading branch information
1 parent
6b6b4cf
commit ed0106f
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/org/cyclops/cyclopscore/item/IngredientPublicConstructor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.cyclops.cyclopscore.item; | ||
|
||
import net.minecraft.world.item.crafting.Ingredient; | ||
import net.neoforged.neoforge.common.crafting.IngredientType; | ||
|
||
import java.util.function.Supplier; | ||
import java.util.stream.Stream; | ||
|
||
/** | ||
* An {@link Ingredient} with public constructors. | ||
* This is needed for ingredients that are created before tags are initialized, | ||
* and for which we need to skip the isEmpty check in fromValues. | ||
* @author rubensworks | ||
*/ | ||
public class IngredientPublicConstructor extends Ingredient { | ||
public IngredientPublicConstructor(Stream<? extends Value> p_43907_) { | ||
super(p_43907_); | ||
} | ||
|
||
public IngredientPublicConstructor(Stream<? extends Value> p_43907_, Supplier<? extends IngredientType<?>> type) { | ||
super(p_43907_, type); | ||
} | ||
} |