2021-03-22 23:06:40 +01:00
|
|
|
/*
|
|
|
|
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
2024-01-01 12:39:45 +01:00
|
|
|
* Copyright (C) 2016-2024 ViaVersion and contributors
|
2021-03-22 23:06:40 +01:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2021-04-26 20:52:34 +02:00
|
|
|
package com.viaversion.viaversion.commands.defaultsubs;
|
2016-03-31 17:22:42 +02:00
|
|
|
|
2021-04-26 20:52:34 +02:00
|
|
|
import com.viaversion.viaversion.api.Via;
|
|
|
|
import com.viaversion.viaversion.api.command.ViaCommandSender;
|
|
|
|
import com.viaversion.viaversion.api.command.ViaSubCommand;
|
2023-10-08 06:23:55 +02:00
|
|
|
import com.viaversion.viaversion.api.configuration.ViaVersionConfig;
|
2016-03-31 17:22:42 +02:00
|
|
|
|
|
|
|
public class DontBugMeSubCmd extends ViaSubCommand {
|
2020-10-24 11:13:16 +02:00
|
|
|
|
2016-03-31 17:22:42 +02:00
|
|
|
@Override
|
|
|
|
public String name() {
|
|
|
|
return "dontbugme";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String description() {
|
2023-10-24 04:59:10 +02:00
|
|
|
return "Toggle checking for updates.";
|
2016-03-31 17:22:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-09-23 19:49:59 +02:00
|
|
|
public boolean execute(ViaCommandSender sender, String[] args) {
|
2023-10-08 06:23:55 +02:00
|
|
|
final ViaVersionConfig config = Via.getConfig();
|
|
|
|
boolean newValue = !config.isCheckForUpdates();
|
2016-03-31 17:22:42 +02:00
|
|
|
|
2023-10-08 06:23:55 +02:00
|
|
|
config.setCheckForUpdates(newValue);
|
|
|
|
config.save();
|
2016-04-02 11:51:17 +02:00
|
|
|
sendMessage(sender, "&6We will %snotify you about updates.", (newValue ? "&a" : "&cnot "));
|
2016-03-31 17:22:42 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|