mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-16 15:45:58 +01:00
Remove version matching, it's pointless now
This commit is contained in:
parent
9f4ccf9eaf
commit
d63e342f78
@ -145,22 +145,9 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
|||||||
final PluginManager pm = getServer().getPluginManager();
|
final PluginManager pm = getServer().getPluginManager();
|
||||||
for (Plugin plugin : pm.getPlugins()) {
|
for (Plugin plugin : pm.getPlugins()) {
|
||||||
if (plugin.getDescription().getName().startsWith("Essentials") && !plugin.getDescription().getVersion().equals(this.getDescription().getVersion()) && !plugin.getDescription().getName().equals("EssentialsAntiCheat")) {
|
if (plugin.getDescription().getName().startsWith("Essentials") && !plugin.getDescription().getVersion().equals(this.getDescription().getVersion()) && !plugin.getDescription().getName().equals("EssentialsAntiCheat")) {
|
||||||
LOGGER.log(Level.WARNING, tl("versionMismatch", plugin.getDescription().getName()));
|
getLogger().warning(tl("versionMismatch", plugin.getDescription().getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final Matcher versionMatch = Pattern.compile("git-Bukkit-(?:(?:[0-9]+)\\.)+[0-9]+-R[\\.0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(getServer().getVersion());
|
|
||||||
if (versionMatch.matches()) {
|
|
||||||
final int versionNumber = Integer.parseInt(versionMatch.group(1));
|
|
||||||
if (versionNumber < BUKKIT_VERSION && versionNumber > 100) {
|
|
||||||
wrongVersion();
|
|
||||||
this.setEnabled(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LOGGER.log(Level.INFO, tl("bukkitFormatChanged"));
|
|
||||||
LOGGER.log(Level.INFO, getServer().getVersion());
|
|
||||||
LOGGER.log(Level.INFO, getServer().getBukkitVersion());
|
|
||||||
}
|
|
||||||
execTimer.mark("BukkitCheck");
|
execTimer.mark("BukkitCheck");
|
||||||
|
|
||||||
for (Method method : Server.class.getDeclaredMethods()) {
|
for (Method method : Server.class.getDeclaredMethods()) {
|
||||||
@ -216,9 +203,9 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
|||||||
execTimer.mark("RegHandler");
|
execTimer.mark("RegHandler");
|
||||||
|
|
||||||
final MetricsStarter metricsStarter = new MetricsStarter(this);
|
final MetricsStarter metricsStarter = new MetricsStarter(this);
|
||||||
if (metricsStarter.getStart() != null && metricsStarter.getStart() == true) {
|
if (metricsStarter.getStart() != null && metricsStarter.getStart()) {
|
||||||
runTaskLaterAsynchronously(metricsStarter, 1);
|
runTaskLaterAsynchronously(metricsStarter, 1);
|
||||||
} else if (metricsStarter.getStart() != null && metricsStarter.getStart() == false) {
|
} else if (metricsStarter.getStart() != null) {
|
||||||
final MetricsListener metricsListener = new MetricsListener(this, metricsStarter);
|
final MetricsListener metricsListener = new MetricsListener(this, metricsStarter);
|
||||||
pm.registerEvents(metricsListener, this);
|
pm.registerEvents(metricsListener, this);
|
||||||
}
|
}
|
||||||
@ -476,13 +463,6 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void wrongVersion() {
|
|
||||||
LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *");
|
|
||||||
LOGGER.log(Level.SEVERE, tl("notRecommendedBukkit"));
|
|
||||||
LOGGER.log(Level.SEVERE, tl("requiredBukkit", Integer.toString(BUKKIT_VERSION)));
|
|
||||||
LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BukkitScheduler getScheduler() {
|
public BukkitScheduler getScheduler() {
|
||||||
return this.getServer().getScheduler();
|
return this.getServer().getScheduler();
|
||||||
|
@ -140,7 +140,7 @@ public class PermissionsHandler implements IPermissionsHandler {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!(handler instanceof ConfigPermissionsHandler)) {
|
if (!(handler instanceof ConfigPermissionsHandler)) {
|
||||||
ess.getLogger().info("Essentials: Using config file enhanced permissions.");
|
ess.getLogger().info("Using config file enhanced permissions.");
|
||||||
ess.getLogger().info("Permissions listed in as player-commands will be given to all users.");
|
ess.getLogger().info("Permissions listed in as player-commands will be given to all users.");
|
||||||
handler = new ConfigPermissionsHandler(ess);
|
handler = new ConfigPermissionsHandler(ess);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user