Class RefRegistry

java.lang.Object
xyz.srnyx.annoyingapi.reflection.org.bukkit.RefRegistry

public class RefRegistry extends Object
org.bukkit.Registry
  • Field Details

    • REGISTRY_CLASS

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

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

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

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

    • getEffect

      @NotNull public static @NotNull Optional<org.bukkit.potion.PotionEffectType> getEffect(@NotNull @NotNull 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 Optional<org.bukkit.enchantments.Enchantment> getEnchantment(@NotNull @NotNull String name)
      Get an Enchantment by name, using reflection if needed
      Parameters:
      name - the name of the enchantment
      Returns:
      the Enchantment