We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f050a41 commit bf2732dCopy full SHA for bf2732d
forge-main/src/main/java/dev/compactmods/crafting/util/CodecExtensions.java
@@ -21,6 +21,10 @@ public class CodecExtensions {
21
bl -> DataResult.success(ForgeRegistries.BLOCKS.getKey(bl)))
22
.stable();
23
24
+ /**
25
+ * Variant of the ItemStack codec that allows for some optional defaults such as a default
26
+ * stack size of 1.
27
+ */
28
public static final Codec<ItemStack> FRIENDLY_ITEMSTACK = RecordCodecBuilder.create(i -> i.group(
29
Registry.ITEM.byNameCodec().fieldOf("id").forGetter(ItemStack::getItem),
30
Codec.INT.optionalFieldOf("Count", 1).forGetter(ItemStack::getCount),
0 commit comments