aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRime <81419447+Emirlol@users.noreply.github.com>2024-07-14 05:57:48 +0300
committerRime <81419447+Emirlol@users.noreply.github.com>2024-07-14 05:57:48 +0300
commit3f1b9d9842018c905b29a763e018916ee3dcabe3 (patch)
treeba1d13f54357caa1b228507b44e3fc3193de284a
parent30b73a0557437c86a20f89b65eb878b850e207f7 (diff)
downloadSkyblocker-3f1b9d9842018c905b29a763e018916ee3dcabe3.tar.gz
Skyblocker-3f1b9d9842018c905b29a763e018916ee3dcabe3.tar.bz2
Skyblocker-3f1b9d9842018c905b29a763e018916ee3dcabe3.zip
Rename all `ItemStack` parameters in `ItemUtils` from `item` into `stack`
-rw-r--r--src/main/java/de/hysky/skyblocker/utils/ItemUtils.java18
1 files changed, 9 insertions, 9 deletions
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<String> predicate) {
- for (Text line : getLore(item)) {
+ public static String getLoreLineIf(ItemStack stack, Predicate<String> 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<Text> getLore(ItemStack item) {
- return item.getOrDefault(DataComponentTypes.LORE, LoreComponent.DEFAULT).styledLines();
+ public static @NotNull List<Text> getLore(ItemStack stack) {
+ return stack.getOrDefault(DataComponentTypes.LORE, LoreComponent.DEFAULT).styledLines();
}
public static @NotNull PropertyMap propertyMapWithTexture(String textureValue) {