SmithingRecipeInput .java

net.minecraft.world.item.crafting.SmithingRecipeInput (record, 26 lines): members: template, base, addition, getItem, isEmpty, size. imports: ItemStack.

net.minecraft.world.item.craftingrecord26 linescommon641 B

Implements

API Surface (3)

ItemStack getItem(final int index)
int size()
boolean isEmpty()

String literals (1)

"Recipe does not contain slot "

Code Graph: Dependencies (2)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

SmithingRecipeInput.java26 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.item.crafting;
2
3
import net.minecraft.world.item.ItemStack;
4
5
public record SmithingRecipeInput(ItemStack template, ItemStack base, ItemStack addition) implements RecipeInput {
6
	@Override
7
	public ItemStack getItem(final int index) {
8
		return switch (index) {
9
			case 0 -> this.template;
10
			case 1 -> this.base;
11
			case 2 -> this.addition;
12
			default -> throw new IllegalArgumentException("Recipe does not contain slot " + index);
13
		};
14
	}
15
16
	@Override
17
	public int size() {
18
		return 3;
19
	}
20
21
	@Override
22
	public boolean isEmpty() {
23
		return this.template.isEmpty() && this.base.isEmpty() && this.addition.isEmpty();
24
	}
25
}
26

Decompiled Minecraft 26.3 source of SmithingRecipeInput (net/minecraft/world/item/crafting/SmithingRecipeInput.java) with Mojang official mappings, stored verbatim on the site.