mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-02-05 15:55:28 +01:00
UpdateChecker Update
This commit is contained in:
parent
63151dc800
commit
61070e1a84
@ -42,6 +42,7 @@ public class PlaceholderAPIConfig {
|
|||||||
public boolean cloudAllowUnverifiedExpansions() {
|
public boolean cloudAllowUnverifiedExpansions() {
|
||||||
return plugin.getConfig().getBoolean("cloud_allow_unverified_expansions");
|
return plugin.getConfig().getBoolean("cloud_allow_unverified_expansions");
|
||||||
}
|
}
|
||||||
|
public boolean warnUpdateToAdmin(){return plugin.getConfig().getBoolean("warn_admin_update");}
|
||||||
|
|
||||||
public boolean isCloudEnabled() {
|
public boolean isCloudEnabled() {
|
||||||
return plugin.getConfig().getBoolean("cloud_enabled");
|
return plugin.getConfig().getBoolean("cloud_enabled");
|
||||||
|
@ -46,7 +46,7 @@ public class UpdateChecker implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onJoin(PlayerJoinEvent e) {
|
public void onJoin(PlayerJoinEvent e) {
|
||||||
if (plugin.getConfig().getBoolean("warn_admin_update")) {
|
if (plugin.getPlaceholderAPIConfig().warnUpdateToAdmin()) {
|
||||||
if (e.getPlayer().hasPermission("placeholderapi.updatenotify")) {
|
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('&', "&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 + "/"));
|
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) {
|
private String toReadable(String version) {
|
||||||
String[] split = Pattern.compile(".", Pattern.LITERAL).split(version.replace("v", ""));
|
String[] split = Pattern.compile(".", Pattern.LITERAL).split(version.replace("v", ""));
|
||||||
version = "";
|
version = "";
|
||||||
for (String s : split) {
|
for (String s : split) version += String.format("%4s", s);
|
||||||
version += String.format("%4s", s);
|
|
||||||
}
|
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user