Allow recipes to default count as 1

This commit is contained in:
Camotoy 2024-06-12 22:47:47 -04:00
parent 52a93ecc18
commit 3528b1d692
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F

View file

@ -136,7 +136,7 @@ public final class RecipeRegistryLoader implements RegistryLoader<String, Map<Re
*/
private static ItemStack toItemStack(NbtMap nbt, MinecraftCodecHelper helper) {
int id = nbt.getInt("id");
int count = nbt.getInt("count");
int count = nbt.getInt("count", 1);
String componentsRaw = nbt.getString("components", null);
if (componentsRaw != null) {
byte[] bytes = Base64.getDecoder().decode(componentsRaw);