diff options
| author | Rime <81419447+Emirlol@users.noreply.github.com> | 2024-07-02 20:14:50 +0300 |
|---|---|---|
| committer | Rime <81419447+Emirlol@users.noreply.github.com> | 2024-07-02 20:14:50 +0300 |
| commit | 17601f5f72ba2b70eb9f264a2e543a32580b81a3 (patch) | |
| tree | 1cde3da2ba20710fe4544f49a13b6f29d338f066 /src/main/java/de/hysky/skyblocker/utils | |
| parent | 16093809f4d7b04ed37a12978b9e8f735de95f08 (diff) | |
| download | Skyblocker-17601f5f72ba2b70eb9f264a2e543a32580b81a3.tar.gz Skyblocker-17601f5f72ba2b70eb9f264a2e543a32580b81a3.tar.bz2 Skyblocker-17601f5f72ba2b70eb9f264a2e543a32580b81a3.zip | |
Fix PetLevelAdder working incorrectly in the sea creatures guide
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/utils')
| -rw-r--r-- | src/main/java/de/hysky/skyblocker/utils/ItemUtils.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java index de7a0f9e..7deabf2b 100644 --- a/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java +++ b/src/main/java/de/hysky/skyblocker/utils/ItemUtils.java @@ -62,8 +62,12 @@ public class ItemUtils { }); } + /** + * Gets the nbt in the custom data component of the item stack. + * @return The {@link DataComponentTypes#CUSTOM_DATA custom data} of the itemstack, or an empty {@link NbtCompound} if the itemstack is missing + */ @SuppressWarnings("deprecation") - public static NbtCompound getCustomData(@NotNull ComponentHolder stack) { + public static @NotNull NbtCompound getCustomData(@NotNull ComponentHolder stack) { return stack.getOrDefault(DataComponentTypes.CUSTOM_DATA, NbtComponent.DEFAULT).getNbt(); } |
