Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ record EmptyRecipeChoice() implements RecipeChoice {

static final RecipeChoice INSTANCE = new EmptyRecipeChoice();
@Override
@Deprecated(since = "1.13.1")
public ItemStack getItemStack() {
throw new UnsupportedOperationException("This is an empty RecipeChoice");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,17 @@ final class ItemTypeRecipeChoiceImpl extends RecipeChoice.MaterialChoice impleme
}

@Override
@Deprecated(since = "1.13.1")
public ItemStack getItemStack() {
throw new UnsupportedOperationException("ItemTypeChoice does not support this");
final ItemType type = Registry.ITEM.getOrThrow(this.itemTypes.iterator().next());
final ItemStack item = type.createItemStack();

// legacy compat
if (this.itemTypes.size() > 1) {
item.setDurability(Short.MAX_VALUE);
}

return item;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public boolean test(ItemStack t) {
}

@Override
@Deprecated(since = "1.13.1")
public ItemStack getItemStack() {
ItemStack stack = new ItemStack(choices.get(0));

Expand Down Expand Up @@ -247,6 +248,7 @@ public ExactChoice(List<ItemStack> choices) {
}

@Override
@Deprecated(since = "1.13.1")
public ItemStack getItemStack() {
return choices.get(0).clone();
}
Expand Down
Loading