From 22667d4fb26333836dd8cb8c4e7107e7d78c85d4 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 10 Oct 2024 22:00:49 +0100 Subject: [PATCH] Rename to match yarn. --- .../fabric/api/recipe/v1/ingredient/CustomIngredient.java | 6 +++--- .../fabric/impl/recipe/ingredient/CustomIngredientImpl.java | 2 +- .../impl/recipe/ingredient/builtin/AllIngredient.java | 2 +- .../impl/recipe/ingredient/builtin/AnyIngredient.java | 2 +- .../recipe/ingredient/builtin/ComponentsIngredient.java | 2 +- .../recipe/ingredient/builtin/CustomDataIngredient.java | 2 +- .../recipe/ingredient/builtin/DifferenceIngredient.java | 2 +- .../src/main/resources/fabric-recipe-api-v1.accesswidener | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredient.java b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredient.java index a9b5457cba..dde5cc2885 100644 --- a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredient.java +++ b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredient.java @@ -73,7 +73,7 @@ public interface CustomIngredient { * *

Note: no caching needs to be done by the implementation, this is already handled by the ingredient itself. */ - List> getMatchingStacks(); + List> getMatchingItems(); /** * Returns whether this ingredient always requires {@linkplain #test direct stack testing}. @@ -97,10 +97,10 @@ public interface CustomIngredient { */ default SlotDisplay toDisplay() { // Matches the vanilla logic in Ingredient.toDisplay() - return RegistryEntryList.of(getMatchingStacks()).getStorage().map( + return RegistryEntryList.of(getMatchingItems()).getStorage().map( SlotDisplay.TagSlotDisplay::new, (itemEntries) -> new SlotDisplay.CompositeSlotDisplay( - itemEntries.stream().map(Ingredient::method_64981).toList() + itemEntries.stream().map(Ingredient::createDisplayWithRemainder).toList() )); } diff --git a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/CustomIngredientImpl.java b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/CustomIngredientImpl.java index e9e5553a02..52c738a07e 100644 --- a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/CustomIngredientImpl.java +++ b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/CustomIngredientImpl.java @@ -95,7 +95,7 @@ public boolean requiresTesting() { @Override public List> getMatchingStacks() { if (this.matchingStacks == null) { - this.matchingStacks = customIngredient.getMatchingStacks(); + this.matchingStacks = customIngredient.getMatchingItems(); } return this.matchingStacks; diff --git a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/AllIngredient.java b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/AllIngredient.java index 20c798fae1..11df3ac197 100644 --- a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/AllIngredient.java +++ b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/AllIngredient.java @@ -54,7 +54,7 @@ public boolean test(ItemStack stack) { } @Override - public List> getMatchingStacks() { + public List> getMatchingItems() { // There's always at least one sub ingredient, so accessing ingredients[0] is safe. List> previewStacks = new ArrayList<>(ingredients.getFirst().getMatchingStacks()); diff --git a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/AnyIngredient.java b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/AnyIngredient.java index e9a1c60812..5103e11636 100644 --- a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/AnyIngredient.java +++ b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/AnyIngredient.java @@ -54,7 +54,7 @@ public boolean test(ItemStack stack) { } @Override - public List> getMatchingStacks() { + public List> getMatchingItems() { List> previewStacks = new ArrayList<>(); for (Ingredient ingredient : ingredients) { diff --git a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/ComponentsIngredient.java b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/ComponentsIngredient.java index 0a40e9e670..b7aa94300c 100644 --- a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/ComponentsIngredient.java +++ b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/ComponentsIngredient.java @@ -84,7 +84,7 @@ public boolean test(ItemStack stack) { } @Override - public List> getMatchingStacks() { + public List> getMatchingItems() { return base.getMatchingStacks(); } diff --git a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/CustomDataIngredient.java b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/CustomDataIngredient.java index 3c5278ddee..bb289a2681 100644 --- a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/CustomDataIngredient.java +++ b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/CustomDataIngredient.java @@ -60,7 +60,7 @@ public boolean test(ItemStack stack) { } @Override - public List> getMatchingStacks() { + public List> getMatchingItems() { return base.getMatchingStacks(); } diff --git a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/DifferenceIngredient.java b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/DifferenceIngredient.java index f9b2de807a..bc3a6c7dc4 100644 --- a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/DifferenceIngredient.java +++ b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/DifferenceIngredient.java @@ -49,7 +49,7 @@ public boolean test(ItemStack stack) { } @Override - public List> getMatchingStacks() { + public List> getMatchingItems() { final List> subtractedMatchingStacks = subtracted.getMatchingStacks(); return base.getMatchingStacks().stream() .filter(registryEntry -> !subtractedMatchingStacks.contains(registryEntry)) diff --git a/fabric-recipe-api-v1/src/main/resources/fabric-recipe-api-v1.accesswidener b/fabric-recipe-api-v1/src/main/resources/fabric-recipe-api-v1.accesswidener index 792657a1bd..742dfe24f9 100644 --- a/fabric-recipe-api-v1/src/main/resources/fabric-recipe-api-v1.accesswidener +++ b/fabric-recipe-api-v1/src/main/resources/fabric-recipe-api-v1.accesswidener @@ -3,7 +3,7 @@ accessWidener v2 named extendable class net/minecraft/recipe/Ingredient accessible method net/minecraft/recipe/Ingredient (Lnet/minecraft/registry/entry/RegistryEntryList;)V accessible field net/minecraft/recipe/Ingredient matchingStacks Ljava/util/List; -accessible method net/minecraft/recipe/Ingredient method_64981 (Lnet/minecraft/registry/entry/RegistryEntry;)Lnet/minecraft/recipe/display/SlotDisplay; +accessible method net/minecraft/recipe/Ingredient createDisplayWithRemainder (Lnet/minecraft/registry/entry/RegistryEntry;)Lnet/minecraft/recipe/display/SlotDisplay; accessible field net/minecraft/network/ClientConnection channel Lio/netty/channel/Channel;