Provides basic chat functionality and access to the HeroProfile system for minigames. Additional features pending...
List the people who are responsible for this repository:
- Akabe: GitHub Profile
- IDev: GitHub Profile
List all the dependencies required to run the project:
- OpenJDK 21
- Spigot API - Version x.x
- PlaceholderAPI - Version x.x
If applicable, provide a summary of the version history:
- Version 1.0.0: Initial release.
- Version 1.1.0: ...
If applicable, provide references to the API and its usage:
The InfinityHeroes Core API provides a set of interfaces and classes to manage player profiles, plugin data, and other essential functions of the InfinityHeroes plugin. This documentation serves as a tutorial for using the primary interfaces and classes.
To access the API, use the following code snippet. This retrieves the instance of the InfinityHeroesCoreAPI from the plugin:
InfinityHeroesCoreAPI infinityHeroesCoreAPI = InfinityHeroesCorePlugin.getAPI();Package: de.ifheroes.core
The main interface of the InfinityHeroesCore plugin, providing access to player-related information and core functions.
- Description: Retrieves the player profile based on a
Playerobject. - Parameters:
Player player: The player for whom the profile is retrieved.
- Return Value:
HeroProfile: The player profile.
HeroProfile heroProfile = InfinityHeroesCoreAPI.getProfile(PLAYER);
- Description: Retrieves the player profile based on the UUID from the Warehouse.
- Parameters:
UUID uuid: The unique ID of the player.
- Return Value:
HeroProfile: The player profile.
HeroProfile heroProfile = InfinityHeroesCoreAPI.getProfile(UUID);
- Description: Creates a new player profile.
- Parameters:
UUID uuid: The unique ID of the player.String name: The name of the player.
- Return Value:
HeroProfile: The newly created player profile.
HeroProfile heroProfile = InfinityHeroesCoreAPI.newProfile(UUID, NAME);
- Description: Deletes the player profile based on the UUID.
- Parameters:
UUID uuid: The unique ID of the player.
- Return Value:
boolean:trueif the profile was successfully deleted; otherwise,false.
boolean success = InfinityHeroesCoreAPI.deleteProfile(UUID);
- Description: Unloads the player profile from memory.
- Parameters:
UUID uuid: The unique ID of the player.
InfinityHeroesCoreAPI.unloadProfile(UUID);
Package: de.ifheroes.core.profile
The interface for player profiles, encapsulating basic, advanced, and plugin-specific data.
- Description: Retrieves the player's UUID.
- Return Value:
UUID: The unique identifier of the player.
UUID uuid = HeroProfile.getUUID();
- Description: Retrieves the player's name.
- Return Value:
String: The name of the player.
String name = HeroProfile.getName();
- Description: Sets the player's name.
- Parameters:
String name: The new name of the player.
HeroProfile.setName(NAME);
- Description: Retrieves the language of the player's profile.
- Return Value:
HeroProfileLanguage: The player's profile language as an enum based reponse.
HeroProfileLanguage uuid = HeroProfile.getLanguage();
- Description: Sets the language of the player's profile.
- Parameters:
HeroProfileLanguage language: The language to set.
HeroProfile.setLanguage();
- Description: Retrieves the plugin-specific data of the player's profile.
- Return Value:
PluginData: The plugin data object.
PluginData pluginData = HeroProfile.getPluginData();
- Description: Converts the player profile to a string.
- Return Value:
String: The string representation of the player profile.
Package: de.ifheroes.core.profile.levelstructur.plugin
The interface for managing plugin-specific data within a player's profile.
- Description: Sets a value in the plugin data for the specified domain key.
- Parameters:
DomainKey domainKey: The key representing the domain for the value.Object value: The value to set.
PluginData.set(DOMAINKEY, VALUE);
- Description: Retrieves a value based on the key and type.
- Parameters:
DomainKey domainKey: The domain key.Class<T> clazz: The type of the value.
- Return Value:
Optional<T>: The retrieved value.
Optional<T> optionalValue = PluginData.get(DOMAINKEY, T); T value = optionalValue.get(); /*or*/ T value = optionalValue.orElse(T);
- Description: Checks if a value exists for the specified key.
- Parameters:
DomainKey domainKey: The key to check.
- Return Value:
boolean:trueif a value exists; otherwise,false.
boolean hasKey = PluginData.has(DOMAINKEY);
- Description: Removes a value based on the key.
- Parameters:
DomainKey domainKey: The key for the value to remove.
- Return Value:
boolean:trueif the value was successfully removed; otherwise,false.
boolean successfullyRemoved = PluginData.remove(DOMAINKEY);- Description: Returns all plugin data as a nested map structure.
- Return Value:
Map<String, Map<String, Object>>: The plugin data.
Map<String, Map<String, Object>> data = PluginData.getAllData();- Description: Retrieves the player's UUID.
- Return Value:
UUID: The unique ID of the player.
UUID uuid = PluginData.getUUID();Package: de.ifheroes.core.profile.levelstructur
The DomainKey class uniquely identifies a piece of data within a specific domain (plugin). It consists of a domain (typically the name of a plugin) and a key (a specific identifier within that domain).
- Description: Constructs a new
DomainKeywith the specified domain and key. - Parameters:
String pluginName: The name of the plugin, serving as the domain.String key: The specific key within the domain.
DomainKey domainKey = new DomainKey(PLUGINNAME, KEY);
- Description: Constructs a new
DomainKeyusing aPluginobject and a key. The domain is set to the lowercase name of the plugin. - Parameters:
Plugin plugin: The plugin object whose name will be used as the domain.String key: The specific key within the domain.
DomainKey domainKey = new DomainKey(JAVAPLUGIN, KEY);
- Description: Retrieves the domain of this
DomainKey. - Return Value:
String: The domain as the plugin name.
String domain = DomainKey.getDomain();
- Description: Retrieves the key of this
DomainKey. - Return Value:
String: The key.
String key = DomainKey.getKey();