Enum Class EnchantmentSource

java.lang.Object
java.lang.Enum<EnchantmentSource>
net.fabricmc.fabric.api.item.v1.EnchantmentSource
All Implemented Interfaces:
Serializable, Comparable<EnchantmentSource>, Constable

@Deprecated public enum EnchantmentSource extends Enum<EnchantmentSource>
Deprecated.
Use ResourceSource instead.
Determines where an enchantment has been loaded from.
  • Enum Constant Details

    • VANILLA

      public static final EnchantmentSource VANILLA
      Deprecated.
      An enchantment loaded from the vanilla data pack.
    • MOD

      public static final EnchantmentSource MOD
      Deprecated.
      An enchantment loaded from mods' bundled resources.

      This includes the additional builtin data packs registered by mods with Fabric Resource Loader.

    • DATA_PACK

      public static final EnchantmentSource DATA_PACK
      Deprecated.
      An enchantment loaded from an external data pack.
  • Method Details

    • values

      public static EnchantmentSource[] values()
      Deprecated.
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static EnchantmentSource valueOf(String name)
      Deprecated.
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isBuiltin

      public boolean isBuiltin()
      Deprecated.
      Returns whether this enchantment source is built-in and bundled in the vanilla or mod resources.

      VANILLA and MOD are built-in.

      Returns:
      true if built-in, false otherwise
    • toResourceSource

      public ResourceSource toResourceSource()
      Deprecated.
      Converts to the new ResourceSource which should be used instead of this class.
      Returns:
      The ResourceSource equivalent of this.
    • fromResourceSource

      @Deprecated public static EnchantmentSource fromResourceSource(ResourceSource source)
      Deprecated.
      ResourceSource should be used instead of EnchantmentSource.
      Converts from the new ResourceSource which should be used instead of this class.
      Parameters:
      source - The ResourceSource to convert from.
      Returns:
      The EnchantmentSource equivalent of the given source.