Package org.bukkit

Interface UnsafeValues


@Deprecated(since="1.7.2") 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

      @Deprecated(forRemoval=true) PlainComponentSerializer plainComponentSerializer()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • plainTextSerializer

      Deprecated, for removal: This API element is subject to removal in a future version.
    • gsonComponentSerializer

      @Deprecated(forRemoval=true) GsonComponentSerializer gsonComponentSerializer()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • colorDownsamplingGsonComponentSerializer

      @Deprecated(forRemoval=true) GsonComponentSerializer colorDownsamplingGsonComponentSerializer()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • legacyComponentSerializer

      @Deprecated(forRemoval=true) LegacyComponentSerializer legacyComponentSerializer()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • resolveWithContext

      Component resolveWithContext(Component component, CommandSender context, Entity scoreboardSubject, boolean bypassPermissions) throws IOException
      Deprecated.
      Throws:
      IOException
    • 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.
      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
    • reloadAdvancement

      @NotNull CompletableFuture<Void> reloadAdvancement()
      Deprecated.
      발전 과제만 다시 로드합니다. 로드는 비동기로 실행됩니다.
      Returns:
      future (서버 스레드)
    • unloadAdvancement

      void unloadAdvancement(boolean save, NamespacedKey... keys)
      Deprecated.
      발전 과제를 서버에서 언로드합니다.
      Parameters:
      save - 언로드 전 플레이어 데이터 저장 여부
      keys - 언로드할 발전 과제 목록
    • newAdvancementProgressMap

      ProgressMap newAdvancementProgressMap()
      Deprecated.
      새로운 진행도 맵을 생성합니다.
      Returns:
      진행도 맵
      See Also:
    • newAdvancementProgress

      AdvancementProgress newAdvancementProgress(Map<String,CriterionProgress> criteria)
      Deprecated.
      주어진 발전 과제에 대하여 새로운 진행도를 생성합니다.
      Parameters:
      criteria - 기준 달성 목록
      Returns:
      생성된 진행도
    • newCriterionProgress

      CriterionProgress newCriterionProgress(@Nullable Instant obtainedTime)
      Deprecated.
      새로운 기준 진행도를 생성합니다.
      Parameters:
      obtainedTime - 기준 달성 시간 (null인 경우 달성하지 않음)
      Returns:
      기준 진행도
      See Also:
    • newAdvancementProgress

      CountableProgress newAdvancementProgress(int currentCount, @Nullable Instant obtainedTime)
      Deprecated.
      주어진 발전 과제에 대하여 새로운 카운트 형식의 진행도를 생성합니다.
      Parameters:
      currentCount - 현재 카운트
      obtainedTime - 기준 달성 시간 (null인 경우 달성하지 않음)
      Returns:
      생성된 카운트 형식의 진행도
    • getDefaultAttributeModifiers

      @Deprecated(since="1.21", forRemoval=true) Multimap<Attribute,AttributeModifier> getDefaultAttributeModifiers(Material material, EquipmentSlot slot)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getCreativeCategory

      @Deprecated(since="1.21", forRemoval=true) CreativeCategory getCreativeCategory(Material material)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getBlockTranslationKey

      @Deprecated(since="1.21", forRemoval=true) String getBlockTranslationKey(Material material)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getItemTranslationKey

      @Deprecated(since="1.21", forRemoval=true) String getItemTranslationKey(Material material)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getTranslationKey

      String getTranslationKey(EntityType entityType)
      Deprecated.
    • getTranslationKey

      String getTranslationKey(ItemStack itemStack)
      Deprecated.
    • getTranslationKey

      @Deprecated(since="1.21.3", forRemoval=true) String getTranslationKey(Attribute attribute)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getInternalPotionData

      @Internal @Deprecated(since="1.20.2", forRemoval=true) PotionType.InternalPotionData getInternalPotionData(NamespacedKey key)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Do not use, method will get removed, and the plugin won't run
      Parameters:
      key - of the potion type
      Returns:
      an internal potion data
    • createDamageSourceBuilder

      @Internal @NotNull DamageSource.Builder createDamageSourceBuilder(@NotNull @NotNull DamageType damageType)
      Deprecated.
      Create a new DamageSource.Builder.
      Parameters:
      damageType - the DamageType to use
      Returns:
      a DamageSource.Builder
    • get

      @Internal String get(Class<?> aClass, String value)
      Deprecated.
    • get

      @Internal <B extends Keyed> B get(RegistryKey<B> registry, NamespacedKey key)
      Deprecated.
    • isSupportedApiVersion

      @Deprecated(forRemoval=true) boolean isSupportedApiVersion(String apiVersion)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isLegacyPlugin

      @Deprecated(forRemoval=true) static boolean isLegacyPlugin(Plugin plugin)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getVersionFetcher

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

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

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

      @NotNull com.google.gson.JsonObject serializeItemAsJson(@NotNull @NotNull ItemStack itemStack)
      Deprecated.
      Serializes this itemstack to json format. It is safe for data migrations as it will use the built-in data converter instead of bukkit's dangerous serialization system.

      The emitted json object's format will inherently change across versions and hence should not be used for non-development purposes like plugin configurations or end-user input.

      Returns:
      json object representing this item.
      Throws:
      IllegalArgumentException - if the passed itemstack is ItemStack.empty().
      See Also:
    • deserializeItemFromJson

      @NotNull @NotNull ItemStack deserializeItemFromJson(@NotNull com.google.gson.JsonObject data) throws IllegalArgumentException
      Deprecated.
      Creates an itemstack from a json object.

      This method expects a json object in the format emitted by serializeItemAsJson(ItemStack).

      The emitted json object's format will inherently change across versions and hence should not be used for non-development purposes like plugin configurations or end-user input.

      Parameters:
      data - object representing an item in Json format
      Returns:
      the deserialize item stack, migrated to the latest data version if needed.
      Throws:
      IllegalArgumentException - if the json object is not a valid item
      See Also:
    • serializeEntity

      default byte @NotNull [] serializeEntity(@NotNull @NotNull Entity entity)
      Deprecated.
      Serializes the provided entity.
      Parameters:
      entity - entity
      Returns:
      serialized entity data
      Throws:
      IllegalArgumentException - if couldn't serialize the entity
      Since:
      1.17.1
      See Also:
    • serializeEntity

      byte @NotNull [] serializeEntity(@NotNull @NotNull Entity entity, @NotNull @NotNull EntitySerializationFlag... serializationFlags)
      Deprecated.
      Serializes the provided entity.
      Parameters:
      entity - entity
      serializationFlags - serialization flags
      Returns:
      serialized entity data
      Throws:
      IllegalArgumentException - if couldn't serialize the entity
      Since:
      1.21.4
      See Also:
    • deserializeEntity

      @NotNull default @NotNull Entity deserializeEntity(byte @NotNull [] data, @NotNull @NotNull World world)
      Deprecated.
      Deserializes the entity from data.
      The entity's UUID as well as passengers will not be preserved.
      Parameters:
      data - serialized entity data
      world - world
      Returns:
      deserialized entity
      Throws:
      IllegalArgumentException - if invalid serialized entity data provided
      Since:
      1.17.1
      See Also:
    • deserializeEntity

      @NotNull default @NotNull Entity deserializeEntity(byte @NotNull [] data, @NotNull @NotNull World world, boolean preserveUUID)
      Deprecated.
      Deserializes the entity from data.
      The entity's passengers will not be preserved.
      Parameters:
      data - serialized entity data
      world - world
      preserveUUID - whether to preserve the entity's uuid
      Returns:
      deserialized entity
      Throws:
      IllegalArgumentException - if invalid serialized entity data provided
      Since:
      1.17.1
      See Also:
    • deserializeEntity

      @NotNull @NotNull Entity deserializeEntity(byte @NotNull [] data, @NotNull @NotNull World world, boolean preserveUUID, boolean preservePassengers)
      Deprecated.
      Deserializes the entity from data.
      Parameters:
      data - serialized entity data
      world - world
      preserveUUID - whether to preserve uuids of the entity and its passengers
      preservePassengers - whether to preserve passengers
      Returns:
      deserialized entity
      Throws:
      IllegalArgumentException - if invalid serialized entity data provided
      Since:
      1.21.4
      See Also:
    • 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.

    • getMainLevelName

      @NotNull @NotNull String getMainLevelName()
      Deprecated.
      Just don't use it.
    • getProtocolVersion

      int getProtocolVersion()
      Deprecated.
      Returns the server's protocol version.
      Returns:
      the server's protocol version
    • 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
    • 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)
    • getBiomeKey

      @NotNull @Deprecated(since="1.21.3", forRemoval=true) @NotNull NamespacedKey getBiomeKey(RegionAccessor accessor, int x, int y, int z)
      Deprecated, for removal: This API element is subject to removal in a future version.
      custom biomes are properly supported in API now
      Gets the NamespacedKey for the biome at the given location.
      Parameters:
      accessor - The RegionAccessor of the provided coordinates
      x - X-coordinate of the block
      y - Y-coordinate of the block
      z - Z-coordinate of the block
      Returns:
      the biome's NamespacedKey
    • setBiomeKey

      @Deprecated(since="1.21.3", forRemoval=true) void setBiomeKey(RegionAccessor accessor, int x, int y, int z, NamespacedKey biomeKey)
      Deprecated, for removal: This API element is subject to removal in a future version.
      custom biomes are properly supported in API now
      Sets the biome at the given location to a biome registered to the given NamespacedKey. If no biome by the given NamespacedKey exists, an IllegalStateException will be thrown.
      Parameters:
      accessor - The RegionAccessor of the provided coordinates
      x - X-coordinate of the block
      y - Y-coordinate of the block
      z - Z-coordinate of the block
      biomeKey - Biome key
      Throws:
      IllegalStateException - if no biome by the given key is registered.
    • getStatisticCriteriaKey

      String getStatisticCriteriaKey(@NotNull Statistic statistic)
      Deprecated.
    • getSpawnEggLayerColor

      @Deprecated(since="1.21.4") @Nullable @Nullable Color getSpawnEggLayerColor(EntityType entityType, int layer)
      Deprecated.
      the color is no longer available to the server
      Obtains the underlying color informating for a spawn egg of a given entity type, or null if the entity passed does not have a spawn egg. Spawn eggs have two colors - the background layer (0), and the foreground layer (1)
      Parameters:
      entityType - the entity type to get the color for
      layer - the texture layer to get a color for
      Returns:
      the color of the layer for the entity's spawn egg
    • computeTooltipLines

      @NotNull List<Component> computeTooltipLines(@NotNull @NotNull ItemStack itemStack, @NotNull TooltipContext tooltipContext, @Nullable Player player)
      Deprecated.
    • createEmptyStack

      ItemStack createEmptyStack()
      Deprecated.
    • serializeStack

      @NotNull @NotNull Map<String,Object> serializeStack(ItemStack itemStack)
      Deprecated.
    • deserializeStack

      @NotNull @NotNull ItemStack deserializeStack(@NotNull @NotNull Map<String,Object> args)
      Deprecated.
    • createChatSession

      @NotNull ChatSession createChatSession(@NotNull UUID uniqueId, @NotNull IdentifyKey identifyKey)
      Deprecated.
    • createIdentifyKey

      @NotNull IdentifyKey createIdentifyKey(@NotNull Instant expiresAt, @NotNull PublicKey publicKey, byte @NotNull [] signature)
      Deprecated.
    • createInventoryIterator

      @NotNull ListIterator<ItemStack> createInventoryIterator(@NotNull Inventory inventory)
      Deprecated.
      Inventory Iterator를 생성합니다.
      Parameters:
      inventory - 대상 인벤토리
      Returns:
      Iterator
    • createInventoryIterator

      @NotNull ListIterator<ItemStack> createInventoryIterator(@NotNull Inventory inventory, int nextIndex)
      Deprecated.
      Inventory Iterator를 생성합니다.
      Parameters:
      inventory - 대상 인벤토리
      nextIndex - 다음 인덱스
      Returns:
      Iterator
    • getCraftDamageSource

      @NotNull DamageSource getCraftDamageSource(@NotNull @NotNull Object nmsDamageSource)
      Deprecated.
    • eme$setEntityDimensions

      void eme$setEntityDimensions(@NotNull @NotNull Object nmsEntity, @NotNull @NotNull Object entityDimensions)
      Deprecated.
    • eme$setEntityEyeHeight

      void eme$setEntityEyeHeight(@NotNull @NotNull Object nmsEntity, float eyeHeight)
      Deprecated.
    • eme$setEntityBukkitEntity

      void eme$setEntityBukkitEntity(@NotNull @NotNull Object nmsEntity, @Nullable Entity entity)
      Deprecated.
    • eme$getPassengerAttachmentPoint

      @NotNull @NotNull Object eme$getPassengerAttachmentPoint(@NotNull @NotNull Object nmsEntity, @NotNull @NotNull Object entity, @NotNull @NotNull Object dimensions, float partialTick)
      Deprecated.
    • eme$setLivingEntityNoJumpDelay

      void eme$setLivingEntityNoJumpDelay(@NotNull @NotNull Object nmsLivingEntity, int noJumpDelay)
      Deprecated.
    • eme$setMobLookControl

      void eme$setMobLookControl(@NotNull @NotNull Object nmsMob, @NotNull @NotNull Object lookControl)
      Deprecated.
    • eme$setMobMoveControl

      void eme$setMobMoveControl(@NotNull @NotNull Object nmsMob, @NotNull @NotNull Object moveControl)
      Deprecated.
    • eme$setMobJumpControl

      void eme$setMobJumpControl(@NotNull @NotNull Object nmsMob, @NotNull @NotNull Object jumpControl)
      Deprecated.
    • eme$setMobBodyRotationControl

      void eme$setMobBodyRotationControl(@NotNull @NotNull Object nmsMob, @NotNull @NotNull Object bodyRotationControl)
      Deprecated.
    • eme$setMobNavigation

      void eme$setMobNavigation(@NotNull @NotNull Object nmsMob, @NotNull @NotNull Object navigation)
      Deprecated.
    • eme$getLevelThreadSafeRandom

      @NotNull @NotNull Object eme$getLevelThreadSafeRandom(@NotNull @NotNull Object level)
      Deprecated.
    • eme$invokeTrackedEntityGetEffectiveRange

      int eme$invokeTrackedEntityGetEffectiveRange(@NotNull @NotNull Object trackedEntity)
      Deprecated.
    • eme$getTrackedEntityRange

      int eme$getTrackedEntityRange(@NotNull @NotNull Object trackedEntity)
      Deprecated.
    • eme$setTrackedEntityRange

      void eme$setTrackedEntityRange(@NotNull @NotNull Object trackedEntity, int range)
      Deprecated.
    • eme$invokeInstrumentItemGetInstrument

      @NotNull @NotNull Object eme$invokeInstrumentItemGetInstrument(@NotNull @NotNull Object instrumentItem, @NotNull @NotNull Object itemStack, @NotNull @NotNull Object entity)
      Deprecated.
    • eme$setInteractPacketReadCallback

      void eme$setInteractPacketReadCallback(@NotNull @NotNull Object interactPacket, @Nullable @Nullable UnsafeValues.InteractPacketReadCallback readCallback)
      Deprecated.
    • eme$invokeGameConnectionHandleInteract

      void eme$invokeGameConnectionHandleInteract(@NotNull @NotNull Object gamePacketListener, @NotNull @NotNull Object interactPacket, @NotNull @NotNull UnsafeValues.InteractPacketHandleCallback beforePlayerCheck, @NotNull @NotNull UnsafeValues.InteractPacketHandleCallback afterPlayerCheck)
      Deprecated.
    • eme$invokeGameConnectionHandleUseItem

      void eme$invokeGameConnectionHandleUseItem(@NotNull @NotNull Object gamePacketListener, @NotNull @NotNull Object useItemPacket, @NotNull Consumer<Object> interactionResult)
      Deprecated.
    • eme$setGameConnectionClientIsFloating

      void eme$setGameConnectionClientIsFloating(@NotNull @NotNull Object gamePacketListener, boolean clientIsFloating)
      Deprecated.