From 3f1b9d9842018c905b29a763e018916ee3dcabe3 Mon Sep 17 00:00:00 2001 From: Rime <81419447+Emirlol@users.noreply.github.com> Date: Sun, 14 Jul 2024 05:57:48 +0300 Subject: Rename all `ItemStack` parameters in `ItemUtils` from `item` into `stack` --- src/main/java/de/hysky/skyblocker/utils/ItemUtils.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main/java/de/hysky') diff --git a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java index 5dc51089..65807886 100644 --- a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java +++ b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java @@ -205,8 +205,8 @@ public final class ItemUtils { * @return The first line of the lore that matches the predicate, or {@code null} if no line matches. */ @Nullable - public static String getLoreLineIf(ItemStack item, Predicate predicate) { - for (Text line : getLore(item)) { + public static String getLoreLineIf(ItemStack stack, Predicate predicate) { + for (Text line : getLore(stack)) { String string = line.getString(); if (predicate.test(string)) { return string; @@ -221,9 +221,9 @@ public final class ItemUtils { * @return A matcher that contains match results if the pattern was found in the lore, otherwise {@code null}. */ @Nullable - public static Matcher getLoreLineIfMatch(ItemStack item, Pattern pattern) { + public static Matcher getLoreLineIfMatch(ItemStack stack, Pattern pattern) { Matcher matcher = pattern.matcher(""); - for (Text line : getLore(item)) { + for (Text line : getLore(stack)) { if (matcher.reset(line.getString()).matches()) { return matcher; } @@ -234,13 +234,13 @@ public final class ItemUtils { /** * Gets the first line of the lore that matches the specified pattern, using {@link Matcher#find()}. * @param pattern the pattern to search for - * @param item the item to search the lore of + * @param stack the stack to search the lore of * @return A {@link Matcher matcher} that contains match results if the pattern was found in the lore, otherwise {@code null}. */ @Nullable - public static Matcher getLoreLineIfContainsMatch(ItemStack item, Pattern pattern) { + public static Matcher getLoreLineIfContainsMatch(ItemStack stack, Pattern pattern) { Matcher matcher = pattern.matcher(""); - for (Text line : getLore(item)) { + for (Text line : getLore(stack)) { if (matcher.reset(line.getString()).find()) { return matcher; } @@ -248,8 +248,8 @@ public final class ItemUtils { return null; } - public static @NotNull List getLore(ItemStack item) { - return item.getOrDefault(DataComponentTypes.LORE, LoreComponent.DEFAULT).styledLines(); + public static @NotNull List getLore(ItemStack stack) { + return stack.getOrDefault(DataComponentTypes.LORE, LoreComponent.DEFAULT).styledLines(); } public static @NotNull PropertyMap propertyMapWithTexture(String textureValue) { -- cgit