aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/utils
diff options
context:
space:
mode:
authorKevinthegreat <92656833+kevinthegreat1@users.noreply.github.com>2024-06-07 11:40:30 +0800
committerKevinthegreat <92656833+kevinthegreat1@users.noreply.github.com>2024-06-10 12:21:42 +0800
commitdcbbea4a299e2be7afcb4fb986504d3ef7475405 (patch)
treebb63f977ca87b8edbff2e98aa7d7c87335f9d76b /src/main/java/de/hysky/skyblocker/utils
parentebd5ccd1620c7857c621f9c04b1f87ab11c08cbc (diff)
downloadSkyblocker-dcbbea4a299e2be7afcb4fb986504d3ef7475405.tar.gz
Skyblocker-dcbbea4a299e2be7afcb4fb986504d3ef7475405.tar.bz2
Skyblocker-dcbbea4a299e2be7afcb4fb986504d3ef7475405.zip
Add potion level slot text
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/utils')
-rw-r--r--src/main/java/de/hysky/skyblocker/utils/ItemUtils.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java
index b1708404..46950fc4 100644
--- a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java
+++ b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java
@@ -18,6 +18,7 @@ import it.unimi.dsi.fastutil.ints.IntIntPair;
import it.unimi.dsi.fastutil.longs.LongBooleanPair;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.component.ComponentChanges;
+import net.minecraft.component.ComponentHolder;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.LoreComponent;
import net.minecraft.component.type.NbtComponent;
@@ -62,7 +63,7 @@ public class ItemUtils {
}
@SuppressWarnings("deprecation")
- public static NbtCompound getCustomData(@NotNull ItemStack stack) {
+ public static NbtCompound getCustomData(@NotNull ComponentHolder stack) {
return stack.getOrDefault(DataComponentTypes.CUSTOM_DATA, NbtComponent.DEFAULT).getNbt();
}
@@ -104,7 +105,7 @@ public class ItemUtils {
* @param stack the item stack to get the UUID from
* @return the UUID of the item stack, or an empty string if the item stack is null or does not have a UUID
*/
- public static String getItemUuid(@NotNull ItemStack stack) {
+ public static String getItemUuid(@NotNull ComponentHolder stack) {
return getCustomData(stack).getString(UUID);
}