Fetch latest vesion on command

PS.get().update would return the URL of the latest update at the time
the server was started. Not everybody is restarting their servers daily
so it might end up in people not noticing an update in a long while
This commit is contained in:
manuelgu 2016-05-13 19:09:40 +02:00
parent c1bc3dfc29
commit a5a001130c

View File

@ -1,6 +1,7 @@
package com.intellectualcrafters.plot.commands; package com.intellectualcrafters.plot.commands;
import com.intellectualcrafters.plot.PS; import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.Updater;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
@ -23,7 +24,7 @@ public class Update extends SubCommand {
public boolean onCommand(PlotPlayer plr, String[] args) { public boolean onCommand(PlotPlayer plr, String[] args) {
URL url; URL url;
if (args.length == 0) { if (args.length == 0) {
url = PS.get().update; url = Updater.getUpdate();
} else if (args.length == 1) { } else if (args.length == 1) {
try { try {
url = new URL(args[0]); url = new URL(args[0]);