Merge branch 'remove-auto_updater' into breaking

This commit is contained in:
NotMyFault
2019-04-13 12:30:54 +02:00
5 changed files with 0 additions and 239 deletions

View File

@ -84,14 +84,6 @@ public class WorldEditCommands {
actor.printDebug(" - COMMIT: " + Integer.toHexString(version.hash));
actor.printDebug(" - BUILD: #" + version.build);
actor.printDebug(" - PLATFORM: " + Settings.IMP.PLATFORM);
Updater updater = Fawe.get().getUpdater();
if (updater == null) {
actor.printDebug(" - UPDATES: DISABLED");
} else if (updater.isOutdated()) {
actor.printDebug(" - UPDATES: " + updater.getChanges().split("\n").length + " (see /fawe cl)");
} else {
actor.printDebug(" - UPDATES: Latest Version");
}
actor.printDebug("------------------------------------");
}
PlatformManager pm = we.getPlatformManager();
@ -149,72 +141,6 @@ public class WorldEditCommands {
// }
// }
@Command(
aliases = {"update"},
usage = "",
desc = "Update the plugin",
min = 0,
max = 0
)
public void update(FawePlayer fp) throws WorldEditException {
if (Fawe.get().getUpdater().installUpdate(fp)) {
TaskManager.IMP.sync(() -> {
fp.executeCommand("restart");
return null;
});
fp.sendMessage(BBC.getPrefix() + "Please restart to finish installing the update");
} else {
fp.sendMessage(BBC.getPrefix() + "No update is pending");
}
}
@Command(
aliases = {"changelog", "cl"},
usage = "",
desc = "View the FAWE changelog",
min = 0,
max = 0
)
@CommandPermissions("worldedit.changelog")
public void changelog(Actor actor) throws WorldEditException {
try {
Updater updater = Fawe.get().getUpdater();
String changes = updater != null ? updater.getChanges() : null;
String url = "https://empcraft.com/fawe/cl?" + Integer.toHexString(Fawe.get().getVersion().hash);
if (changes == null) {
try (Scanner scanner = new Scanner(new URL(url).openStream(), "UTF-8")) {
changes = scanner.useDelimiter("\\A").next();
}
}
changes = changes.replaceAll("#([0-9]+)", "github.com/boy0001/FastAsyncWorldedit/issues/$1");
String[] split = changes.substring(1).split("[\n](?! )");
if (changes.length() <= 1) actor.print(BBC.getPrefix() + "No description available");
else {
StringBuilder msg = new StringBuilder();
msg.append(BBC.getPrefix() + split.length + " commits:");
for (String change : split) {
String[] split2 = change.split("\n ");
msg.append("\n&a&l" + split2[0]);
if (split2.length != 0) {
for (int i = 1; i < split2.length; i++) {
msg.append('\n');
String[] split3 = split2[i].split("\n");
String subChange = "&8 - &7" + StringMan.join(split3, "\n&7 ");
msg.append(subChange);
}
}
}
msg.append("\n&7More info: &9&o" + url);
msg.append("\n&7Discuss: &9&ohttps://discord.gg/ngZCzbU");
actor.print(BBC.color(msg.toString()));
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@Command(
aliases = {"debugpaste"},
usage = "",