From 82e52267b85b801d0c31ccc52a1b520c92407c63 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Thu, 13 Jun 2024 20:27:23 +0200 Subject: [PATCH] More deprecation, use the NBT class --- .../main/java/de/tr7zw/changeme/nbtapi/NBTGameProfile.java | 2 ++ .../src/main/java/de/tr7zw/changeme/nbtapi/NBTItem.java | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NBTGameProfile.java b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NBTGameProfile.java index 3fe69c56a..13842b748 100644 --- a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NBTGameProfile.java +++ b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NBTGameProfile.java @@ -15,6 +15,7 @@ public class NBTGameProfile { * @param profile * @return A NBTContainer with all the GameProfile data */ + @Deprecated public static NBTCompound toNBT(GameProfile profile) { if(MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_20_R4)) { return (NBTCompound) GameprofileUtil.writeGameProfile(NBT.createNBTObject(), profile); @@ -29,6 +30,7 @@ public static NBTCompound toNBT(GameProfile profile) { * @param compound Has to contain GameProfile data * @return The reconstructed GameProfile */ + @Deprecated public static GameProfile fromNBT(NBTCompound compound) { if(MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_20_R4)) { return GameprofileUtil.readGameProfile(compound); diff --git a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NBTItem.java b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NBTItem.java index 134acd79e..6e33c7c85 100644 --- a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NBTItem.java +++ b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NBTItem.java @@ -189,6 +189,7 @@ protected void setCompound(Object compound) { * * @param item ItemStack that should get the new NBT data */ + @Deprecated public void applyNBT(ItemStack item) { if (item == null || item.getType() == Material.AIR) { throw new NullPointerException("ItemStack can't be null/Air! This is not a NBTAPI bug!"); @@ -203,6 +204,7 @@ public void applyNBT(ItemStack item) { * * @param item ItemStack that should get the new NBT data */ + @Deprecated public void mergeNBT(ItemStack item) { NBTItem nbti = new NBTItem(item); nbti.mergeCompound(this); @@ -340,6 +342,7 @@ public void modifyMeta(Class type, BiConsumer