mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2024-11-14 19:15:08 -05:00
Added warning when starting ViaProxy for the first time
This commit is contained in:
parent
4455f90949
commit
e9b3f7605c
2 changed files with 22 additions and 0 deletions
|
@ -52,6 +52,10 @@ public class UISave extends AbstractSave {
|
|||
this.values.put(key, value);
|
||||
}
|
||||
|
||||
public String get(final String key) {
|
||||
return this.values.get(key);
|
||||
}
|
||||
|
||||
public void loadTextField(final String key, final JTextField textField) {
|
||||
try {
|
||||
String value = this.values.get(key);
|
||||
|
|
|
@ -191,6 +191,24 @@ public class GeneralTab extends AUITab {
|
|||
}
|
||||
|
||||
private void start() {
|
||||
Object selectedItem = this.serverVersion.getSelectedItem();
|
||||
if (!(selectedItem instanceof VersionEnum)) {
|
||||
this.frame.showError("Please select a server version!");
|
||||
return;
|
||||
}
|
||||
if (ViaProxy.saveManager.uiSave.get("notice.ban_warning") == null) {
|
||||
ViaProxy.saveManager.uiSave.put("notice.ban_warning", "true");
|
||||
ViaProxy.saveManager.save();
|
||||
|
||||
this.frame.showWarning("<html>ViaProxy may trigger anti-cheats, due to block, item, movement and other differences between versions. <b>USE AT OWN RISK!</b></html>");
|
||||
}
|
||||
if (VersionEnum.bedrockLatest.equals(selectedItem) && ViaProxy.saveManager.uiSave.get("notice.bedrock_warning") == null) {
|
||||
ViaProxy.saveManager.uiSave.put("notice.bedrock_warning", "true");
|
||||
ViaProxy.saveManager.save();
|
||||
|
||||
this.frame.showWarning("<html>ViaBedrock is currently in very early development and not ready for general use. <b>CONTINUE AT YOUR OWN RISK!</b></html>");
|
||||
}
|
||||
|
||||
this.setComponentsEnabled(false);
|
||||
this.stateButton.setEnabled(false);
|
||||
this.stateButton.setText("Starting...");
|
||||
|
|
Loading…
Reference in a new issue