1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 05:55:27 +01:00

#413 Now checks the papi version when using old version and update to latest

- Last commit fix for offlineplayer, we not using this
This commit is contained in:
montlikadani 2019-05-08 12:56:28 +02:00
parent 2147c270ea
commit afb07a69d4
4 changed files with 5 additions and 13 deletions

View File

@ -124,7 +124,7 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.9.2</version>
<version>2.10.1</version>
<scope>provided</scope>
</dependency>
</dependencies>

View File

@ -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 {

View File

@ -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;

View File

@ -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);
}