Fix /ld update forcing
This commit is contained in:
parent
78b19d5596
commit
bf12201452
@ -40,6 +40,8 @@ public class LDUpdate implements LDCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean releaseBuilds = checker.isUsingReleaseBuilds();
|
boolean releaseBuilds = checker.isUsingReleaseBuilds();
|
||||||
|
boolean forceUpdate = args[0].endsWith("!");
|
||||||
|
boolean forceCheck = args[0].endsWith("?") || args.length > 1 || forceUpdate;
|
||||||
|
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (args[1].equalsIgnoreCase("dev")) {
|
if (args[1].equalsIgnoreCase("dev")) {
|
||||||
@ -54,7 +56,8 @@ public class LDUpdate implements LDCommand {
|
|||||||
DisguiseConfig.setUsingReleaseBuilds(releaseBuilds);
|
DisguiseConfig.setUsingReleaseBuilds(releaseBuilds);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checker.getUpdate() != null && checker.getUpdate().isReleaseBuild() == releaseBuilds && args.length <= 1) {
|
if (checker.getUpdate() != null && checker.getUpdate().isReleaseBuild() == releaseBuilds && args.length <= 1 &&
|
||||||
|
!forceCheck) {
|
||||||
if (checker.isServerLatestVersion()) {
|
if (checker.isServerLatestVersion()) {
|
||||||
DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_ON_LATEST);
|
DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_ON_LATEST);
|
||||||
return;
|
return;
|
||||||
@ -71,7 +74,7 @@ public class LDUpdate implements LDCommand {
|
|||||||
public void run() {
|
public void run() {
|
||||||
LibsMsg updateResult = null;
|
LibsMsg updateResult = null;
|
||||||
|
|
||||||
if (checker.getUpdate() == null || args.length > 1 || checker.isOldUpdate()) {
|
if (checker.getUpdate() == null || args.length > 1 || checker.isOldUpdate() || forceCheck) {
|
||||||
updateResult = checker.doUpdateCheck();
|
updateResult = checker.doUpdateCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,7 +93,7 @@ public class LDUpdate implements LDCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!args[0].endsWith("!")) {
|
if (!forceUpdate) {
|
||||||
if (updateResult != null) {
|
if (updateResult != null) {
|
||||||
sender.sendMessage(updateResult.get());
|
sender.sendMessage(updateResult.get());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user