java.lang.Object
dev.triumphteam.gui.components.nbt.Pdc
All Implemented Interfaces:
NbtWrapper

public final class Pdc
extends java.lang.Object
implements NbtWrapper
Wrapper for compatibility with LegacyNbt. This ideally wouldn't need exist, but legacy.
  • Constructor Summary

    Constructors 
    Constructor Description
    Pdc()  
  • Method Summary

    Modifier and Type Method Description
    @Nullable java.lang.String getString​(@NotNull org.bukkit.inventory.ItemStack itemStack, java.lang.String key)
    Gets the NBT tag based on a given key.
    org.bukkit.inventory.ItemStack removeTag​(@NotNull org.bukkit.inventory.ItemStack itemStack, java.lang.String key)
    Removes a tag from an ItemStack.
    org.bukkit.inventory.ItemStack setBoolean​(@NotNull org.bukkit.inventory.ItemStack itemStack, java.lang.String key, boolean value)
    Sets a boolean to the ItemStack.
    org.bukkit.inventory.ItemStack setString​(@NotNull org.bukkit.inventory.ItemStack itemStack, java.lang.String key, java.lang.String value)
    Sets an String NBT tag to the an ItemStack.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Pdc

      public Pdc()
  • Method Details

    • setString

      public org.bukkit.inventory.ItemStack setString​(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, java.lang.String key, java.lang.String value)
      Sets an String NBT tag to the an ItemStack.
      Specified by:
      setString in interface NbtWrapper
      Parameters:
      itemStack - The current ItemStack to be set.
      key - The NBT key to use.
      value - The tag value to set.
      Returns:
      An ItemStack that has NBT set.
    • removeTag

      public org.bukkit.inventory.ItemStack removeTag​(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, java.lang.String key)
      Removes a tag from an ItemStack.
      Specified by:
      removeTag in interface NbtWrapper
      Parameters:
      itemStack - The current ItemStack to be remove.
      key - The NBT key to remove.
      Returns:
      An ItemStack that has the tag removed.
    • setBoolean

      public org.bukkit.inventory.ItemStack setBoolean​(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, java.lang.String key, boolean value)
      Sets a boolean to the ItemStack. Mainly used for setting an item to be unbreakable on older versions.
      Specified by:
      setBoolean in interface NbtWrapper
      Parameters:
      itemStack - The ItemStack to set the boolean to.
      key - The key to use.
      value - The boolean value.
      Returns:
      An ItemStack with a boolean value set.
    • getString

      @Nullable public @Nullable java.lang.String getString​(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, java.lang.String key)
      Gets the NBT tag based on a given key.
      Specified by:
      getString in interface NbtWrapper
      Parameters:
      itemStack - The ItemStack to get from.
      key - The key to look for.
      Returns:
      The tag that was stored in the ItemStack.