Package org.bukkit

Interface UnsafeValues


@Deprecated public interface UnsafeValues
Deprecated.
This interface provides value conversions that may be specific to a runtime, or have arbitrary meaning (read: magic values).

Their existence and behavior is not guaranteed across future versions. They may be poorly named, throw exceptions, have misleading parameters, or any other bad programming practice.

  • Method Details

    • componentFlattener

      ComponentFlattener componentFlattener()
      Deprecated.
    • plainComponentSerializer

      PlainComponentSerializer plainComponentSerializer()
      Deprecated.
    • gsonComponentSerializer

      GsonComponentSerializer gsonComponentSerializer()
      Deprecated.
    • colorDownsamplingGsonComponentSerializer

      GsonComponentSerializer colorDownsamplingGsonComponentSerializer()
      Deprecated.
    • legacyComponentSerializer

      LegacyComponentSerializer legacyComponentSerializer()
      Deprecated.
    • reportTimings

      void reportTimings()
      Deprecated.
    • toLegacy

      Material toLegacy(Material material)
      Deprecated.
    • fromLegacy

      Material fromLegacy(Material material)
      Deprecated.
    • fromLegacy

      Material fromLegacy(MaterialData material)
      Deprecated.
    • fromLegacy

      Material fromLegacy(MaterialData material, boolean itemPriority)
      Deprecated.
    • fromLegacy

      BlockData fromLegacy(Material material, byte data)
      Deprecated.
    • getMaterial

      Material getMaterial(String material, int version)
      Deprecated.
    • getDataVersion

      int getDataVersion()
      Deprecated.
    • modifyItemStack

      ItemStack modifyItemStack(ItemStack stack, String arguments)
      Deprecated.
    • checkSupported

      void checkSupported(PluginDescriptionFile pdf) throws InvalidPluginException
      Deprecated.
      Throws:
      InvalidPluginException
    • processClass

      byte[] processClass(PluginDescriptionFile pdf, String path, byte[] clazz)
      Deprecated.
    • loadAdvancement

      Advancement loadAdvancement(NamespacedKey key, String advancement)
      Deprecated.
      Load an advancement represented by the specified string into the server. The advancement format is governed by Minecraft and has no specified layout.
      It is currently a JSON object, as described by the Minecraft Wiki: http://minecraft.gamepedia.com/Advancements
      Loaded advancements will be stored and persisted across server restarts and reloads.
      Callers should be prepared for Exception to be thrown.
      Parameters:
      key - the unique advancement key
      advancement - representation of the advancement
      Returns:
      the loaded advancement or null if an error occurred
    • removeAdvancement

      boolean removeAdvancement(NamespacedKey key)
      Deprecated.
      Delete an advancement which was loaded and saved by loadAdvancement(org.bukkit.NamespacedKey, java.lang.String).
      This method will only remove advancement from persistent storage. It should be accompanied by a call to Server.reloadData() in order to fully remove it from the running instance.
      Parameters:
      key - the unique advancement key
      Returns:
      true if a file matching this key was found and deleted
    • getTimingsServerName

      String getTimingsServerName()
      Deprecated.
      Server name to report to timings v2
      Returns:
      name
    • getVersionFetcher

      default VersionFetcher getVersionFetcher()
      Deprecated.
      Called once by the version command on first use, then cached.
    • isSupportedApiVersion

      boolean isSupportedApiVersion(String apiVersion)
      Deprecated.
    • isLegacyPlugin

      static boolean isLegacyPlugin(Plugin plugin)
      Deprecated.
    • serializeItem

      byte[] serializeItem(ItemStack item)
      Deprecated.
    • deserializeItem

      ItemStack deserializeItem(byte[] data)
      Deprecated.
    • serializeEntity

      byte[] serializeEntity(Entity entity)
      Deprecated.
    • deserializeEntity

      default Entity deserializeEntity(byte[] data, World world)
      Deprecated.
    • deserializeEntity

      Entity deserializeEntity(byte[] data, World world, boolean preserveUUID)
      Deprecated.
    • getTranslationKey

      String getTranslationKey(Material mat)
      Deprecated.
      Return the translation key for the Material, so the client can translate it into the active locale when using a TranslatableComponent.
      Returns:
      the translation key
    • getTranslationKey

      String getTranslationKey(Block block)
      Deprecated.
      Return the translation key for the Block, so the client can translate it into the active locale when using a TranslatableComponent.
      Returns:
      the translation key
    • getTranslationKey

      String getTranslationKey(EntityType type)
      Deprecated.
      Return the translation key for the EntityType, so the client can translate it into the active locale when using a TranslatableComponent.
      This is null, when the EntityType isn't known to NMS (custom entities)
      Returns:
      the translation key
    • getTranslationKey

      String getTranslationKey(ItemStack itemStack)
      Deprecated.
      Return the translation key for the ItemStack, so the client can translate it into the active locale when using a TranslatableComponent.
      Returns:
      the translation key
    • nextEntityId

      int nextEntityId()
      Deprecated.
      Creates and returns the next EntityId available.

      Use this when sending custom packets, so that there are no collisions on the client or server.

    • getItemRarity

      ItemRarity getItemRarity(Material material)
      Deprecated.
      Gets the item rarity of a material. The material MUST be an item. Use Material.isItem() before this.
      Parameters:
      material - the material to get the rarity of
      Returns:
      the item rarity
    • getItemStackRarity

      ItemRarity getItemStackRarity(ItemStack itemStack)
      Deprecated.
      Gets the item rarity of the itemstack. The rarity can change based on enchantements.
      Parameters:
      itemStack - the itemstack to get the rarity of
      Returns:
      the itemstack rarity
    • isValidRepairItemStack

      boolean isValidRepairItemStack(@NotNull @NotNull ItemStack itemToBeRepaired, @NotNull @NotNull ItemStack repairMaterial)
      Deprecated.
      Checks if an itemstack can be repaired with another itemstack. Returns false if either argument's type is not an item (Material.isItem()).
      Parameters:
      itemToBeRepaired - the itemstack to be repaired
      repairMaterial - the repair material
      Returns:
      true if valid repair, false if not
    • getItemAttributes

      @NotNull Multimap<Attribute,​AttributeModifier> getItemAttributes(@NotNull @NotNull Material material, @NotNull EquipmentSlot equipmentSlot)
      Deprecated.
      Returns an immutable multimap of attributes for the material and slot. Material.isItem() must be true for this material.
      Parameters:
      material - the material
      equipmentSlot - the slot to get the attributes for
      Returns:
      an immutable multimap of attributes
      Throws:
      IllegalArgumentException - if Material.isItem() is false
    • getProtocolVersion

      int getProtocolVersion()
      Deprecated.
      Returns the server's protocol version.
      Returns:
      the server's protocol version
    • hasDefaultEntityAttributes

      boolean hasDefaultEntityAttributes(@NotNull @NotNull NamespacedKey entityKey)
      Deprecated.
      Checks if the entity represented by the namespaced key has default attributes.
      Parameters:
      entityKey - the entity's key
      Returns:
      true if it has default attributes
    • getDefaultEntityAttributes

      @NotNull Attributable getDefaultEntityAttributes(@NotNull @NotNull NamespacedKey entityKey)
      Deprecated.
      Gets the default attributes for the entity represented by the namespaced key.
      Parameters:
      entityKey - the entity's key
      Returns:
      an unmodifiable instance of Attributable for reading default attributes.
      Throws:
      IllegalArgumentException - if the entity does not exist of have default attributes (use hasDefaultEntityAttributes(NamespacedKey) first)
    • isCollidable

      boolean isCollidable(@NotNull @NotNull Material material)
      Deprecated.
      Checks if this material is collidable.
      Parameters:
      material - the material to check
      Returns:
      true if collidable
      Throws:
      IllegalArgumentException - if Material.isBlock() is false