Skip to content

Commit

Permalink
More deprecation, use the NBT class
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Jun 13, 2024
1 parent c16548f commit 82e5226
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
Expand All @@ -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);
Expand Down Expand Up @@ -340,6 +342,7 @@ public <T extends ItemMeta> void modifyMeta(Class<T> type, BiConsumer<ReadableNB
* @param item
* @return Standalone {@link NBTContainer} with the Item's data
*/
@Deprecated
public static NBTContainer convertItemtoNBT(ItemStack item) {
return NBTReflectionUtil.convertNMSItemtoNBTCompound(ReflectionMethod.ITEMSTACK_NMSCOPY.run(null, item));
}
Expand All @@ -352,6 +355,7 @@ public static NBTContainer convertItemtoNBT(ItemStack item) {
* @return ItemStack using the {@link NBTCompound}'s data
*/
@Nullable
@Deprecated
public static ItemStack convertNBTtoItem(NBTCompound comp) {
return (ItemStack) ReflectionMethod.ITEMSTACK_BUKKITMIRROR.run(null,
NBTReflectionUtil.convertNBTCompoundtoNMSItem(comp));
Expand All @@ -365,6 +369,7 @@ public static ItemStack convertNBTtoItem(NBTCompound comp) {
* @param items
* @return Standalone {@link NBTContainer} with the Item's data
*/
@Deprecated
public static NBTContainer convertItemArraytoNBT(ItemStack[] items) {
NBTContainer container = new NBTContainer();
container.setInteger("size", items.length);
Expand Down Expand Up @@ -393,6 +398,7 @@ public static NBTContainer convertItemArraytoNBT(ItemStack[] items) {
* @return ItemStack[] using the {@link NBTCompound}'s data
*/
@Nullable
@Deprecated
public static ItemStack[] convertNBTtoItemArray(NBTCompound comp) {
if (!comp.hasTag("size")) {
return null;
Expand Down

0 comments on commit 82e5226

Please sign in to comment.