Corrected ItemStack[] conversion
This commit is contained in:
parent
db62a19cc5
commit
5e557f95c0
1 changed files with 5 additions and 6 deletions
|
@ -15,7 +15,6 @@ import net.minecraft.world.level.ItemLike;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class AbstractAdvancementRecipe {
|
public class AbstractAdvancementRecipe {
|
||||||
|
@ -41,12 +40,12 @@ public class AbstractAdvancementRecipe {
|
||||||
private int nameCounter = 0;
|
private int nameCounter = 0;
|
||||||
|
|
||||||
public void unlockedBy(ItemStack... stacks) {
|
public void unlockedBy(ItemStack... stacks) {
|
||||||
List<ItemLike> items = Arrays.stream(stacks)
|
ItemLike[] items = Arrays.stream(stacks)
|
||||||
.filter(stack -> stack.getCount() > 0)
|
.filter(stack -> stack.getCount() > 0)
|
||||||
.map(stack -> (ItemLike) stack.getItem())
|
.map(stack -> (ItemLike) stack.getItem())
|
||||||
.toList();
|
.toArray(ItemLike[]::new);
|
||||||
|
|
||||||
unlockedBy((ItemLike[]) items.toArray());
|
unlockedBy(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unlockedBy(ItemLike... items) {
|
public void unlockedBy(ItemLike... items) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue