minecraft-src/net/minecraft/world/item/crafting/SmithingRecipeInput.java
2025-07-04 01:41:11 +03:00

25 lines
635 B
Java

package net.minecraft.world.item.crafting;
import net.minecraft.world.item.ItemStack;
public record SmithingRecipeInput(ItemStack template, ItemStack base, ItemStack addition) implements RecipeInput {
@Override
public ItemStack getItem(int index) {
return switch (index) {
case 0 -> this.template;
case 1 -> this.base;
case 2 -> this.addition;
default -> throw new IllegalArgumentException("Recipe does not contain slot " + index);
};
}
@Override
public int size() {
return 3;
}
@Override
public boolean isEmpty() {
return this.template.isEmpty() && this.base.isEmpty() && this.addition.isEmpty();
}
}