### Accessing ProfileProvider Source: https://docs.phoenixdevt.fr/mmoprofiles/api/usage.html Example of how to retrieve the ProfileProvider instance using Bukkit's service manager. ```APIDOC ## Accessing ProfileProvider ### Description Access the main API class, `ProfileProvider`, using Bukkit's service manager. ### Method Java Code ### Endpoint N/A ### Parameters N/A ### Request Example ```java ProfileProvider provider = Bukkit.getServicesManager().getRegistration(ProfileProvider.class).getProvider(); ``` ### Response N/A ``` -------------------------------- ### Retrieve Player Data in Java Source: https://docs.phoenixdevt.fr/mmoprofiles/api/player-data.html Demonstrates how to fetch player profile data using the ProfileProvider. It includes methods to get all profiles associated with a player and the player's current profile. Requires a player ID (UUID) as input. ```java UUID playerId = /* TODO */; // get player data ProfileList playerData = provider.getPlayerData(playerId); // get all profiles from player List profiles = playerData.getProfiles(); // get current profile @Nullable PlayerProfile currentProfile = playerData.getCurrent(); ``` -------------------------------- ### Register PlaceholderProcessor Instance in MMOProfiles Source: https://docs.phoenixdevt.fr/mmoprofiles/api/placeholders.html This Java code snippet shows how to register an instance of your custom PlaceholderProcessor with MMOProfiles. This registration should occur when your profile data module is being registered. It utilizes Bukkit's ServiceManager to get the ProfileProvider. ```java ProfileProvider provider = Bukkit.getServicesManager().getRegistration(ProfileProvider.class).getProvider(); PlaceholderProcessor yourPlaceholderProcessor = /* TODO */; provider.registerPlaceholders(yourPlaceholderProcessor); ``` -------------------------------- ### Disable Multiverse-Core First Spawn Override (YAML) Source: https://docs.phoenixdevt.fr/mmoprofiles/install.html Configure Multiverse-Core's config.yml to disable the first spawn override. This prevents interference with MMOProfiles' profile selection and teleportation features. ```yaml firstspawnoverride: 'false' ``` -------------------------------- ### Disable Spigot Player Data Saving (YAML) Source: https://docs.phoenixdevt.fr/mmoprofiles/install.html Configure spigot.yml to disable Spigot's player data saving. This prevents data duplication as MMOProfiles handles player data saving. ```yaml players: disable-saving: true ``` -------------------------------- ### Configure Resource Pack Loading Options Source: https://docs.phoenixdevt.fr/mmoprofiles/features/config.html Controls whether MMOProfiles waits for the server resource pack to load before displaying the profile selection UI. Includes an option to set a delay in ticks for the loading process. ```yml resource-pack-options: wait-for-resource-pack: false resource-pack-load-delay: 40 ``` -------------------------------- ### Implement PlaceholderProcessor for MMOCore Placeholders Source: https://docs.phoenixdevt.fr/mmoprofiles/api/placeholders.html This Java code demonstrates how to implement the processPlaceholderRequest method for MMOCore. It asynchronously loads player data, extracts class, level, and experience, and registers them as placeholders. Dependencies include MMOCore and MythicLib. ```java void processPlaceholderRequest(PlaceholderRequest placeholderRequest) { final PlayerData fictiveData = new PlayerData(new MMOPlayerData(placeholderRequest.getProfile().getUniqueId())); MMOCore.plugin.playerDataManager.loadData(fictiveData).thenRun(() -> { placeholderRequest.addPlaceholder("class", fictiveData.getProfess().getName()); placeholderRequest.addPlaceholder("level", fictiveData.getLevel()); placeholderRequest.addPlaceholder("exp", MythicLib.plugin.getMMOConfig().decimal.format(fictiveData.getExperience())); placeholderRequest.addPlaceholder("exp_next_level", MythicLib.plugin.getMMOConfig().decimal.format(fictiveData.getLevelUpExperience())); // Skipping some of the placeholders..... placeholderRequest.validate(); }); } ``` -------------------------------- ### Maven Repository Configuration Source: https://docs.phoenixdevt.fr/mmoprofiles/api/usage.html Instructions on how to add the Phoenix Maven repository to your project's pom.xml file. ```APIDOC ## Maven Repository Configuration ### Description Add the Phoenix Maven repository to your `pom.xml` to access API builds. ### Method XML Configuration ### Endpoint N/A ### Parameters N/A ### Request Example ```xml phoenix https://nexus.phoenixdevt.fr/repository/maven-public/ ``` ### Response N/A ``` -------------------------------- ### ProfileAPI Dependency Source: https://docs.phoenixdevt.fr/mmoprofiles/api/usage.html How to include the ProfileAPI as a dependency in your project's pom.xml. ```APIDOC ## ProfileAPI Dependency ### Description Add the Profile-API as a dependency to your `pom.xml` file. ### Method XML Configuration ### Endpoint N/A ### Parameters N/A ### Request Example ```xml fr.phoenixdevt Profile-API 1.1 provided true ``` ### Response N/A ``` -------------------------------- ### Configure Scripts for Player Actions Source: https://docs.phoenixdevt.fr/mmoprofiles/features/config.html Allows specification of MythicLib scripts to be executed upon specific player actions. Supported events include profile creation, player login (before profile selection), and profile selection (after login). ```yml script: # MythicLib script ran when the player creates a new profile. profile-create: mechanics: send_message: type: tell format: 'Welcome to your new profile!' # MythicLib script ran when the player logs in (before profile selection). login: mechanics: send_message: type: tell format: 'Welcome! Please choose the profile you''d like to play on.' # MythicLib script ran when the player chooses a profile (after login). profile-select: mechanics: play_sound: type: sound sound: ENTITY_PLAYER_LEVELUP send_message: type: tell format: 'Have fun!' ``` -------------------------------- ### Access ProfileProvider Service Source: https://docs.phoenixdevt.fr/mmoprofiles/api/usage.html This Java code snippet shows how to retrieve the ProfileProvider instance using Bukkit's service manager. This is the primary way to interact with the Profile API. ```java ProfileProvider provider = Bukkit.getServicesManager().getRegistration(ProfileProvider.class).getProvider(); ``` -------------------------------- ### Include ProfileAPI Dependency Source: https://docs.phoenixdevt.fr/mmoprofiles/api/usage.html This XML snippet demonstrates how to add the ProfileAPI as a provided dependency in your project's pom.xml. This makes the API available at runtime without including its transitive dependencies. ```xml fr.phoenixdevt Profile-API 1.1 provided true ``` -------------------------------- ### Check Proxy-Mode Status in Java Source: https://docs.phoenixdevt.fr/mmoprofiles/api/events.html This snippet demonstrates how to determine if MMOProfiles is currently operating in proxy-mode. It compares the current profile mode against the PROXY constant provided by MythicLib. ```java // possible values: PROXY, LEGACY, NONE // are proxy-mode profiles enabled? boolean proxyMode = MythicLib.plugin.getProfileMode() == ProfileMode.PROXY; ``` -------------------------------- ### Enable Proxy-Based Profile Switching Source: https://docs.phoenixdevt.fr/mmoprofiles/features/config.html When activated, this setting enables MMOProfiles to operate in a proxy-based mode. This allows players to switch or spoof UUIDs, making it appear to other plugins that a different player has joined, thus enabling profile-specific progress across various plugins. ```yml # Proxy-based profiles are configured elsewhere, this is a conceptual note. ``` -------------------------------- ### Disable Automatic Profile Selection GUI on Login Source: https://docs.phoenixdevt.fr/mmoprofiles/features/config.html When enabled, this option prevents MMOProfiles from automatically opening the profile selection GUI upon player login. Manual opening is possible via the '/mmoprofiles open ' command. This setting is not compatible with 'wait-for-resource-pack'. ```yml no-gui-on-login: false ``` -------------------------------- ### Add Maven Repository for Phoenix API Source: https://docs.phoenixdevt.fr/mmoprofiles/api/usage.html This XML snippet shows how to add the Phoenix Maven repository to your project's pom.xml. This allows Maven to locate and download Phoenix API builds. ```xml phoenix https://nexus.phoenixdevt.fr/repository/maven-public/ ``` -------------------------------- ### Server Identifier Configuration in YAML Source: https://docs.phoenixdevt.fr/mmoprofiles/api/player-data.html This snippet shows the configuration for a server identifier in the MMOProfiles config.yml file. This identifier is crucial for grouping servers in a proxy environment, ensuring consistent handling of player data like locations. ```yaml server-identifier: 'default' ``` -------------------------------- ### Set Default and Rank-Based Profile Slots Source: https://docs.phoenixdevt.fr/mmoprofiles/features/config.html Defines the default number of profile slots available to all players. Additionally, it allows configuration of rank-specific profile slots, where each rank is associated with a permission, a slot count, and a display name. ```yml default-slots: 5 ``` ```yml ranks: vip: permission: 'rank.vip' slots: 7 name: 'VIP' vip_plus: permission: 'rank.vip_plus' slots: 10 name: 'VIP+' mvp: permission: 'rank.mvp' slots: 12 name: 'MVP' mvp_plus: permission: 'rank.mvp_plus' slots: 15 name: 'MVP+' ``` -------------------------------- ### Handle Profile Events with ProfileDataModule in Java Source: https://docs.phoenixdevt.fr/mmoprofiles/api/custom-module.html This snippet demonstrates how to implement the onProfileSelection and onProfileUnload methods for a custom ProfileDataModule. It shows asynchronous data loading/unloading and the crucial call to event.validate(dataModule) to signal completion. Ensure validate is called synchronously. ```java Plugin myPlugin; ProfileDataModule dataModule; // MMOProfiles API PlayerDataManager manager; // MMO plugin API @EventHandler public void onProfileSelection(ProfileSelectEvent event) { final PlayerData playerData = manager.get(event.getPlayer()); manager.loadData(playerData).thenAccept(Tasks.sync(plugin, v -> { // ... event.validate(dataModule); })); } @EventHandler public void onProfileUnload(ProfileUnloadEvent event) { manager.unregister(event.getPlayer()).thenAccept(Tasks.sync(plugin, v -> { // ... event.validate(dataModule); })); } ``` -------------------------------- ### Register ProfileDataModule Instance in Java Source: https://docs.phoenixdevt.fr/mmoprofiles/api/custom-module.html This code snippet shows how to register an instance of your custom ProfileDataModule with MMOProfiles during your plugin's onEnable method. It retrieves the ProfileProvider service and calls registerModule with your module instance. If your module implements Listener, MMOProfiles handles event registration automatically. ```java ProfileProvider provider = Bukkit.getServicesManager().getRegistration(ProfileProvider.class).getProvider(); ProfileDataModule yourProfileDataModule = /* TODO */; provider.registerModule(yourProfileDataModule); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.