Interface XBase<XForm extends XBase<XForm,BukkitForm>,BukkitForm>

Type Parameters:
XForm - the class type associated with the Bukkit type defined by XSeries.
BukkitForm - the Bukkit class type associated with the XForm.
All Known Implementing Classes:
XAttribute, XBiome, XEnchantment, XEntityType, XItemFlag, XMaterial, XModule, XPatternType, XPotion, XSound

public interface XBase<XForm extends XBase<XForm,BukkitForm>,BukkitForm>
Do not use this class directly.

All XModules should implement the following static methods:


     public static final XRegistry<XAttribute, Attribute> REGISTRY;

     public static XForm of(@NotNull BukkitForm bukkit) {
         return REGISTRY.getByBukkitForm(bukkit);
     }

     public static Optional<XForm> of(@NotNull String bukkit) {
         return REGISTRY.getByName(bukkit);
     }

     @NotNull
     @Deprecated
     public static XForm[] values() {
         return REGISTRY.values();
     }

     @NotNull
     @Unmodifable
     public static Collection<XAttribute> getValues() {
         return REGISTRY.getValues();
     }
 
All these methods are available from their XRegistry, however these are for cross-compatibility (which will be removed later) and ease of use.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default @NotNull String
    In most cases you should be using name() instead.
    get()
     
    Gets additional information which is only needed during initialization and will only cause unnecessary memory consumptions when used during runtime.
     
    default boolean
    Checks if this sound is supported in the current Minecraft version.
    @NotNull String
    Should be used for saving data.
    default XForm
    or(XForm other)
    Checks if this form is supported in the current version and returns itself if yes.
  • Method Details

    • name

      @NotNull @Contract(pure=true) @NotNull String name()
      Should be used for saving data.
    • getNames

      @Internal @Contract(pure=true) String[] getNames()
    • friendlyName

      @NotNull @Contract(pure=true) default @NotNull String friendlyName()
      In most cases you should be using name() instead.
      Returns:
      a friendly readable string name.
    • get

      @Nullable @Contract(pure=true) BukkitForm get()
    • isSupported

      @Contract(pure=true) default boolean isSupported()
      Checks if this sound is supported in the current Minecraft version.

      An invocation of this method yields exactly the same result as the expression:

      get() != null
      Returns:
      true if the current version has this sound, otherwise false.
      Since:
      1.0.0
    • or

      @NotNull @Contract(pure=true) default XForm or(XForm other)
      Checks if this form is supported in the current version and returns itself if yes.

      In the other case, the alternate form will get returned, no matter if it is supported or not.

      Parameters:
      other - the other form to get if this one is not supported.
      Returns:
      this form or the other if not supported.
    • getMetadata

      @Internal default XModuleMetadata getMetadata()
      Gets additional information which is only needed during initialization and will only cause unnecessary memory consumptions when used during runtime.
      See Also: