3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-09-08 22:02:50 +02:00

Fix dontbugme command

Fixes #2152
Dieser Commit ist enthalten in:
KennyTV 2020-10-24 11:13:16 +02:00
Ursprung 9a24129e49
Commit 0986b0982c
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
3 geänderte Dateien mit 16 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -120,6 +120,12 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf
return checkForUpdates;
}
@Override
public void setCheckForUpdates(boolean checkForUpdates) {
this.checkForUpdates = checkForUpdates;
set("checkforupdates", checkForUpdates);
}
@Override
public boolean isPreventCollision() {
return preventCollision;

Datei anzeigen

@ -11,6 +11,14 @@ public interface ViaVersionConfig {
*/
boolean isCheckForUpdates();
/**
* Sets whether to check for updates. This updates the internally cached value
* as well as the config, but does not save the config to disc.
*
* @param checkForUpdates true to check for updates on server start and joins
*/
void setCheckForUpdates(boolean checkForUpdates);
/**
* Get if collision preventing for players is enabled
*

Datei anzeigen

@ -6,6 +6,7 @@ import us.myles.ViaVersion.api.command.ViaSubCommand;
import us.myles.ViaVersion.api.configuration.ConfigurationProvider;
public class DontBugMeSubCmd extends ViaSubCommand {
@Override
public String name() {
return "dontbugme";
@ -21,7 +22,7 @@ public class DontBugMeSubCmd extends ViaSubCommand {
ConfigurationProvider provider = Via.getPlatform().getConfigurationProvider();
boolean newValue = !Via.getConfig().isCheckForUpdates();
provider.set("checkforupdates", newValue);
Via.getConfig().setCheckForUpdates(newValue);
provider.saveConfig();
sendMessage(sender, "&6We will %snotify you about updates.", (newValue ? "&a" : "&cnot "));