Remove auto updater and minors

- Remove Changelog command
- Remove Auto updater
This commit is contained in:
NotMyFault
2019-03-28 21:31:28 +01:00
parent 699783ba72
commit cb482ccbd5
5 changed files with 0 additions and 261 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();
@ -124,72 +116,6 @@ public class WorldEditCommands {
actor.print(BBC.getPrefix() + "Reloaded WorldEdit " + we.getVersion() + " and FAWE (" + Fawe.get().getVersion() + ")");
}
@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 = "",
@ -224,28 +150,6 @@ public class WorldEditCommands {
}
}
// @Command(aliases = {"report"}, desc = "Writes a report on WorldEdit", flags = "p", max = 0)
// @CommandPermissions({"worldedit.report"})
// public void report(Actor actor, CommandContext args) throws WorldEditException {
// ReportList report = new ReportList("Report");
// report.add(new SystemInfoReport());
// report.add(new ConfigReport());
// String result = report.toString();
//
// try {
// File dest = new File(we.getWorkingDirectoryFile(we.getConfiguration().saveDir), "report.txt");
// Files.write(result, dest, Charset.forName("UTF-8"));
// actor.print("WorldEdit report written to " + dest.getAbsolutePath());
// } catch (IOException e) {
// actor.printError("Failed to write report: " + e.getMessage());
// }
//
// if (args.hasFlag('p')) {
// actor.checkPermission("worldedit.report.pastebin");
// ActorCallbackPaste.pastebin(we.getSupervisor(), actor, result, "WorldEdit report: %s.report");
// }
// }
@Command(
aliases = {"cui"},
usage = "",