Package com.cryptomorin.xseries.base
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
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanDeprecated.In most cases you should be usingname()instead.final BukkitFormget()String[]getNames()final inthashCode()Identity hash code.final booleanChecks if this sound is supported in the current Minecraft version.final @NotNull Stringname()Should be used for saving data.final XFormChecks if this form is supported in the current version and returns itself if yes.protected voidsetEnumName(XRegistry<XForm, BukkitForm> registry, String enumName) final StringtoString()
-
Constructor Details
-
XModule
-
-
Method Details
-
name
Should be used for saving data. -
setEnumName
-
getNames
-
friendlyName
In most cases you should be usingname()instead.- Returns:
- a friendly readable string name.
-
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
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
otherif not supported.
-
toString
-
hashCode
public final int hashCode()Identity hash code. -
equals
Deprecated.Identity comparison. Should use==instead.
-