Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 17:10:13 +01:00
Ursprung
9a24129e49
Commit
0986b0982c
@ -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;
|
||||
|
@ -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
|
||||
*
|
||||
|
@ -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 "));
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren