diff --git a/pom.xml b/pom.xml index cd383713..c3e84807 100644 --- a/pom.xml +++ b/pom.xml @@ -124,7 +124,7 @@ me.clip placeholderapi - 2.9.2 + 2.10.1 provided diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index 4901518f..c1d93c21 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -227,7 +227,8 @@ public class Jobs extends JavaPlugin { private boolean setupPlaceHolderAPI() { if (!getServer().getPluginManager().isPluginEnabled("PlaceholderAPI")) return false; - if (!getServer().getPluginManager().getPlugin("PlaceholderAPI").getDescription().getVersion().contains("2.10.0")) { + if (getVersionCheckManager().convertVersion(getServer().getPluginManager() + .getPlugin("PlaceholderAPI").getDescription().getVersion()) >= getVersionCheckManager().convertVersion("2.10.0")) { if ((new NewPlaceholderAPIHook(this)).register()) consoleMsg("&e[Jobs] PlaceholderAPI hooked."); } else { diff --git a/src/main/java/com/gamingmesh/jobs/Placeholders/NewPlaceholderAPIHook.java b/src/main/java/com/gamingmesh/jobs/Placeholders/NewPlaceholderAPIHook.java index 3f7483b6..bfd4ff76 100644 --- a/src/main/java/com/gamingmesh/jobs/Placeholders/NewPlaceholderAPIHook.java +++ b/src/main/java/com/gamingmesh/jobs/Placeholders/NewPlaceholderAPIHook.java @@ -1,6 +1,6 @@ package com.gamingmesh.jobs.Placeholders; -import org.bukkit.OfflinePlayer; +import org.bukkit.entity.Player; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.Placeholders.Placeholder.JobsPlaceHolders; @@ -16,7 +16,7 @@ public class NewPlaceholderAPIHook extends PlaceholderExpansion { } @Override - public String onRequest(OfflinePlayer player, String identifier) { + public String onPlaceholderRequest(Player player, String identifier) { JobsPlaceHolders placeHolder = JobsPlaceHolders.getByName(identifier); if (placeHolder == null) return null; diff --git a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java index d156a1b0..4551c928 100644 --- a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java +++ b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java @@ -6,7 +6,6 @@ import java.util.UUID; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; import com.gamingmesh.jobs.Jobs; @@ -333,18 +332,10 @@ public class Placeholder { return message; } - public String getValue(OfflinePlayer player, JobsPlaceHolders placeHolder) { - return getValue(player.getPlayer(), placeHolder, null); - } - public String getValue(Player player, JobsPlaceHolders placeHolder) { return getValue(player, placeHolder, null); } - public String getValue(OfflinePlayer player, JobsPlaceHolders placeHolder, String value) { - return getValue(player != null ? player.getUniqueId() : null, placeHolder, value); - } - public String getValue(Player player, JobsPlaceHolders placeHolder, String value) { return getValue(player != null ? player.getUniqueId() : null, placeHolder, value); }