UpdateChecker Update

This commit is contained in:
wherkamp 2018-04-02 14:19:52 -04:00
parent 63151dc800
commit 61070e1a84
2 changed files with 3 additions and 4 deletions

View File

@ -42,6 +42,7 @@ public class PlaceholderAPIConfig {
public boolean cloudAllowUnverifiedExpansions() {
return plugin.getConfig().getBoolean("cloud_allow_unverified_expansions");
}
public boolean warnUpdateToAdmin(){return plugin.getConfig().getBoolean("warn_admin_update");}
public boolean isCloudEnabled() {
return plugin.getConfig().getBoolean("cloud_enabled");

View File

@ -46,7 +46,7 @@ public class UpdateChecker implements Listener {
@EventHandler(priority = EventPriority.MONITOR)
public void onJoin(PlayerJoinEvent e) {
if (plugin.getConfig().getBoolean("warn_admin_update")) {
if (plugin.getPlaceholderAPIConfig().warnUpdateToAdmin()) {
if (e.getPlayer().hasPermission("placeholderapi.updatenotify")) {
e.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', "&bAn update for &fPlaceholder&7API &e(&fPlaceholder&7API &fv" + getLatestVersion() + "&e)"));
e.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', "&bis available at &ehttps://www.spigotmc.org/resources/placeholderapi." + resourceId + "/"));
@ -97,9 +97,7 @@ public class UpdateChecker implements Listener {
private String toReadable(String version) {
String[] split = Pattern.compile(".", Pattern.LITERAL).split(version.replace("v", ""));
version = "";
for (String s : split) {
version += String.format("%4s", s);
}
for (String s : split) version += String.format("%4s", s);
return version;
}