Class RefRegistry


  • public class RefRegistry
    extends java.lang.Object
    org.bukkit.Registry
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static @Nullable java.lang.Object EFFECT_FIELD
      1.20.3+ org.bukkit.Registry#EFFECT
      static @Nullable java.lang.Object ENCHANTMENT_FIELD
      1.14+ org.bukkit.Registry#ENCHANTMENT
      static @Nullable java.lang.reflect.Method GET_METHOD
      1.14+ org.bukkit.Registry#get(NamespacedKey)
      static @Nullable java.lang.Class<?> REGISTRY_CLASS
      1.14+ org.bukkit.Registry
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @NotNull java.util.Optional<org.bukkit.potion.PotionEffectType> getEffect​(@NotNull java.lang.String name)
      Get a PotionEffectType by name, using reflection if needed
      static @NotNull java.util.Optional<org.bukkit.enchantments.Enchantment> getEnchantment​(@NotNull java.lang.String name)
      Get an Enchantment by name, using reflection if needed
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • REGISTRY_CLASS

        @Nullable
        public static final @Nullable java.lang.Class<?> REGISTRY_CLASS
        1.14+ org.bukkit.Registry
      • GET_METHOD

        @Nullable
        public static final @Nullable java.lang.reflect.Method GET_METHOD
        1.14+ org.bukkit.Registry#get(NamespacedKey)
      • EFFECT_FIELD

        @Nullable
        public static final @Nullable java.lang.Object EFFECT_FIELD
        1.20.3+ org.bukkit.Registry#EFFECT
      • ENCHANTMENT_FIELD

        @Nullable
        public static final @Nullable java.lang.Object ENCHANTMENT_FIELD
        1.14+ org.bukkit.Registry#ENCHANTMENT
    • Method Detail

      • getEffect

        @NotNull
        public static @NotNull java.util.Optional<org.bukkit.potion.PotionEffectType> getEffect​(@NotNull
                                                                                                @NotNull java.lang.String name)
        Get a PotionEffectType by name, using reflection if needed
        Parameters:
        name - the name of the potion effect
        Returns:
        the PotionEffectType
      • getEnchantment

        @NotNull
        public static @NotNull java.util.Optional<org.bukkit.enchantments.Enchantment> getEnchantment​(@NotNull
                                                                                                      @NotNull java.lang.String name)
        Get an Enchantment by name, using reflection if needed
        Parameters:
        name - the name of the enchantment
        Returns:
        the Enchantment