Package com.cryptomorin.xseries.base
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 TypeMethodDescriptiondefault @NotNull StringIn most cases you should be usingname()instead.get()default XModuleMetadataGets additional information which is only needed during initialization and will only cause unnecessary memory consumptions when used during runtime.String[]getNames()default booleanChecks if this sound is supported in the current Minecraft version.@NotNull Stringname()Should be used for saving data.default XFormChecks if this form is supported in the current version and returns itself if yes.
-
Method Details
-
name
Should be used for saving data. -
getNames
-
friendlyName
In most cases you should be usingname()instead.- Returns:
- a friendly readable string name.
-
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
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.
-
getMetadata
Gets additional information which is only needed during initialization and will only cause unnecessary memory consumptions when used during runtime.- See Also:
-