Skip to content

Commit

Permalink
Rename to match yarn.
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Oct 10, 2024
1 parent 5eabe0b commit 22667d4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public interface CustomIngredient {
*
* <p>Note: no caching needs to be done by the implementation, this is already handled by the ingredient itself.
*/
List<RegistryEntry<Item>> getMatchingStacks();
List<RegistryEntry<Item>> getMatchingItems();

/**
* Returns whether this ingredient always requires {@linkplain #test direct stack testing}.
Expand All @@ -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()
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public boolean requiresTesting() {
@Override
public List<RegistryEntry<Item>> getMatchingStacks() {
if (this.matchingStacks == null) {
this.matchingStacks = customIngredient.getMatchingStacks();
this.matchingStacks = customIngredient.getMatchingItems();
}

return this.matchingStacks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public boolean test(ItemStack stack) {
}

@Override
public List<RegistryEntry<Item>> getMatchingStacks() {
public List<RegistryEntry<Item>> getMatchingItems() {
// There's always at least one sub ingredient, so accessing ingredients[0] is safe.
List<RegistryEntry<Item>> previewStacks = new ArrayList<>(ingredients.getFirst().getMatchingStacks());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public boolean test(ItemStack stack) {
}

@Override
public List<RegistryEntry<Item>> getMatchingStacks() {
public List<RegistryEntry<Item>> getMatchingItems() {
List<RegistryEntry<Item>> previewStacks = new ArrayList<>();

for (Ingredient ingredient : ingredients) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public boolean test(ItemStack stack) {
}

@Override
public List<RegistryEntry<Item>> getMatchingStacks() {
public List<RegistryEntry<Item>> getMatchingItems() {
return base.getMatchingStacks();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public boolean test(ItemStack stack) {
}

@Override
public List<RegistryEntry<Item>> getMatchingStacks() {
public List<RegistryEntry<Item>> getMatchingItems() {
return base.getMatchingStacks();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public boolean test(ItemStack stack) {
}

@Override
public List<RegistryEntry<Item>> getMatchingStacks() {
public List<RegistryEntry<Item>> getMatchingItems() {
final List<RegistryEntry<Item>> subtractedMatchingStacks = subtracted.getMatchingStacks();
return base.getMatchingStacks().stream()
.filter(registryEntry -> !subtractedMatchingStacks.contains(registryEntry))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ accessWidener v2 named
extendable class net/minecraft/recipe/Ingredient
accessible method net/minecraft/recipe/Ingredient <init> (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;

Expand Down

0 comments on commit 22667d4

Please sign in to comment.