1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 12:05:16 +01:00

Fixed issue when used a dev-build of papi

This commit is contained in:
montlikadani 2019-12-13 17:07:42 +01:00
parent 4f6b7b633a
commit d30f0d578d
2 changed files with 20 additions and 9 deletions

View File

@ -1,4 +1,5 @@
# 4.15.0
- Fixed issue when used a dev-build of papi
# 4.15.0 (Dev)
- Fixed issue when the quest description only showed one lines of list.

View File

@ -206,19 +206,27 @@ public class Jobs extends JavaPlugin {
return Placeholder;
}
private boolean setupPlaceHolderAPI() {
@SuppressWarnings("deprecation")
private boolean setupPlaceHolderAPI() {
if (!getServer().getPluginManager().isPluginEnabled("PlaceholderAPI"))
return false;
if (Integer.parseInt(getServer().getPluginManager().getPlugin("PlaceholderAPI")
.getDescription().getVersion().replace(".", "")) >= Integer.parseInt("2100")) {
if (new NewPlaceholderAPIHook(this).register())
try {
if (Integer.parseInt(getServer().getPluginManager().getPlugin("PlaceholderAPI")
.getDescription().getVersion().replace(".", "")) >= Integer.parseInt("2100")) {
if (new NewPlaceholderAPIHook(this).register())
consoleMsg("&e[Jobs] PlaceholderAPI hooked.");
} else {
if (new PlaceholderAPIHook(this).hook())
consoleMsg("&e[Jobs] PlaceholderAPI hooked. This is a deprecated version of PlaceholderAPI. Please update "
+ "to the latest version.");
}
} catch (NumberFormatException e) { // when using a dev build
if (new NewPlaceholderAPIHook(this).register()) {
consoleMsg("&e[Jobs] PlaceholderAPI hooked.");
} else {
if (new PlaceholderAPIHook(this).hook())
consoleMsg("&e[Jobs] PlaceholderAPI hooked. This is a deprecated version of PlaceholderAPI. Please update "
+ "to the latest version.");
}
}
return true;
}
@ -1427,7 +1435,9 @@ public class Jobs extends JavaPlugin {
}
public static void consoleMsg(String msg) {
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
if (msg != null) {
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
}
}
public static SelectionManager getSelectionManager() {