Class XModule<XForm extends XModule<XForm,BukkitForm>,BukkitForm>

java.lang.Object
com.cryptomorin.xseries.base.XModule<XForm,BukkitForm>
Type Parameters:
XForm - the class type associated with the Bukkit type defined by XSeries.
BukkitForm - the Bukkit class type associated with the XForm.
Direct Known Subclasses:
XAttribute, XBiome, XSound

public abstract class XModule<XForm extends XModule<XForm,BukkitForm>,BukkitForm> extends Object
Do not use this class directly.

All XModules should implement the following static methods:


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

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

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

  • Method Details

    • name

      @NotNull public final @NotNull String name()
      Should be used for saving data.
    • setEnumName

      @Experimental protected void setEnumName(XRegistry<XForm,BukkitForm> registry, String enumName)
    • getNames

      @Internal public String[] getNames()
    • friendlyName

      public String friendlyName()
      In most cases you should be using name() instead.
      Returns:
      a friendly readable string name.
    • get

      @Nullable public final BukkitForm get()
    • isSupported

      public final 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 public final 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.
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • hashCode

      public final int hashCode()
      Identity hash code.
      Overrides:
      hashCode in class Object
    • equals

      @Deprecated public final boolean equals(Object obj)
      Deprecated.
      Identity comparison. Should use == instead.
      Overrides:
      equals in class Object