Fixed placeholders with proxy-based profiles

This commit is contained in:
Jules 2023-10-22 02:11:45 +02:00
parent f79a66df80
commit 71d0f7219f
3 changed files with 8 additions and 9 deletions

View File

@ -142,7 +142,7 @@
<dependency> <dependency>
<groupId>fr.phoenixdevt</groupId> <groupId>fr.phoenixdevt</groupId>
<artifactId>Profile-API</artifactId> <artifactId>Profile-API</artifactId>
<version>1.1</version> <version>1.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>

View File

@ -15,10 +15,9 @@ import net.Indyuce.mmocore.manager.InventoryManager;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
public class ForceClassProfileDataModule implements ProfileDataModule, Listener { public class ForceClassProfileDataModule implements ProfileDataModule {
public ForceClassProfileDataModule() { public ForceClassProfileDataModule() {
final ProfileProvider<?> provider = Bukkit.getServicesManager().getRegistration(ProfileProvider.class).getProvider(); final ProfileProvider<?> provider = Bukkit.getServicesManager().getRegistration(ProfileProvider.class).getProvider();
provider.registerModule(this); provider.registerModule(this);

View File

@ -3,6 +3,7 @@ package net.Indyuce.mmocore.comp.profile;
import fr.phoenixdevt.profiles.ProfileDataModule; import fr.phoenixdevt.profiles.ProfileDataModule;
import fr.phoenixdevt.profiles.event.ProfileCreateEvent; import fr.phoenixdevt.profiles.event.ProfileCreateEvent;
import fr.phoenixdevt.profiles.event.ProfileRemoveEvent; import fr.phoenixdevt.profiles.event.ProfileRemoveEvent;
import fr.phoenixdevt.profiles.placeholder.PlaceholderProcessor;
import fr.phoenixdevt.profiles.placeholder.PlaceholderRequest; import fr.phoenixdevt.profiles.placeholder.PlaceholderRequest;
import io.lumine.mythic.lib.MythicLib; import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.player.MMOPlayerData; import io.lumine.mythic.lib.api.player.MMOPlayerData;
@ -11,10 +12,9 @@ import net.Indyuce.mmocore.api.player.PlayerData;
import net.Indyuce.mmocore.api.player.attribute.PlayerAttribute; import net.Indyuce.mmocore.api.player.attribute.PlayerAttribute;
import net.Indyuce.mmocore.experience.Profession; import net.Indyuce.mmocore.experience.Profession;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
public class MMOCoreProfileDataModule implements ProfileDataModule, Listener { public class MMOCoreProfileDataModule implements ProfileDataModule, PlaceholderProcessor {
@Override @Override
public JavaPlugin getOwningPlugin() { public JavaPlugin getOwningPlugin() {
@ -22,13 +22,13 @@ public class MMOCoreProfileDataModule implements ProfileDataModule, Listener {
} }
@Override @Override
public boolean hasPlaceholders() { public String getIdentifier() {
return true; return "mmocore";
} }
@Override @Override
public String getIdentifier() { public ProfileDataModule getDataModule() {
return "mmocore"; return this;
} }
@Override @Override