接口 RegistryAware

所有已知子接口:
Art, Attribute, Biome, BlockType, BlockType.Typed<B>, Cat.Type, Chicken.Variant, Cow.Variant, DamageType, Fluid, Frog.Variant, ItemType, ItemType.Typed<M>, JukeboxSong, MapCursor.Type, MenuType, MenuType.Typed<V,B>, PatternType, Pig.Variant, Sound, TrimMaterial, TrimPattern, Villager.Profession, Villager.Type, Wolf.Variant
所有已知实现类:
Enchantment, EnchantmentWrapper, EntityType, GameEvent, Material, MemoryKey, MusicInstrument, Particle, PotionEffectType, PotionEffectTypeWrapper, PotionType, Structure, StructureType

public interface RegistryAware
Indicates that instances of a class may be registered to the server and have a key associated with them.
另请参阅:
  • 方法概要

    修饰符和类型
    方法
    说明
    Gets the key of this instance if it is registered otherwise returns null.
    Gets the key of this instance if it is registered otherwise throws an error.
    boolean
    Returns whether this instance is register in a registry and therefore has a key or not.
  • 方法详细资料

    • getKeyOrThrow

      Gets the key of this instance if it is registered otherwise throws an error.
      This is a convenience method and plugins should always check isRegistered() before using this method.
      返回:
      the key with which this instance is registered.
      抛出:
      IllegalStateException - if this instance is not registered.
      另请参阅:
    • getKeyOrNull

      Gets the key of this instance if it is registered otherwise returns null.
      返回:
      the key with which this instance is registered or null if not registered.
      另请参阅:
    • isRegistered

      boolean isRegistered()
      Returns whether this instance is register in a registry and therefore has a key or not.
      返回:
      true, if this instance is registered. Otherwise, false.
      另请参阅: