SingleRecipeInput .java

net.minecraft.world.item.crafting.SingleRecipeInput (record, 20 lines): members: item, getItem, size. strings: "No item for index ". imports: ItemStack.

net.minecraft.world.item.craftingrecord20 linescommon395 B

Implements

API Surface (2)

ItemStack getItem(final int index)
int size()

String literals (1)

"No item for index "

Code Graph: Dependencies (2)

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

Full Source

SingleRecipeInput.java20 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.item.crafting;
2
3
import net.minecraft.world.item.ItemStack;
4
5
public record SingleRecipeInput(ItemStack item) implements RecipeInput {
6
	@Override
7
	public ItemStack getItem(final int index) {
8
		if (index != 0) {
9
			throw new IllegalArgumentException("No item for index " + index);
10
		} else {
11
			return this.item;
12
		}
13
	}
14
15
	@Override
16
	public int size() {
17
		return 1;
18
	}
19
}
20

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