mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-11-24 12:06:11 +01:00
fixed config screens
This commit is contained in:
parent
e18f886111
commit
158ba3ee93
@ -81,7 +81,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
int finalNewVersion = newVersion;
|
int finalNewVersion = newVersion;
|
||||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||||
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
||||||
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
|
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClickClientSide(ButtonWidget widget) {
|
private void onClickClientSide(ButtonWidget widget) {
|
||||||
@ -91,7 +91,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
if (answer) {
|
if (answer) {
|
||||||
ViaFabric.config.setClientSideEnabled(true);
|
ViaFabric.config.setClientSideEnabled(true);
|
||||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getClientSideText().asString());
|
widget.setMessage(getClientSideText().asString());
|
||||||
}
|
}
|
||||||
MinecraftClient.getInstance().openScreen(this);
|
MinecraftClient.getInstance().openScreen(this);
|
||||||
@ -103,14 +103,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
ViaFabric.config.setClientSideEnabled(false);
|
ViaFabric.config.setClientSideEnabled(false);
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
widget.setMessage(getClientSideText().asString());
|
widget.setMessage(getClientSideText().asString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removed() {
|
public void removed() {
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -131,7 +131,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
|
|
||||||
private void onHideViaButton(ButtonWidget widget) {
|
private void onHideViaButton(ButtonWidget widget) {
|
||||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getHideViaButtonText().asString());
|
widget.setMessage(getHideViaButtonText().asString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
int finalNewVersion = newVersion;
|
int finalNewVersion = newVersion;
|
||||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||||
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
||||||
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
|
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClickClientSide(ButtonWidget widget) {
|
private void onClickClientSide(ButtonWidget widget) {
|
||||||
@ -91,7 +91,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
if (answer) {
|
if (answer) {
|
||||||
ViaFabric.config.setClientSideEnabled(true);
|
ViaFabric.config.setClientSideEnabled(true);
|
||||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getClientSideText().asString());
|
widget.setMessage(getClientSideText().asString());
|
||||||
}
|
}
|
||||||
MinecraftClient.getInstance().openScreen(this);
|
MinecraftClient.getInstance().openScreen(this);
|
||||||
@ -103,14 +103,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
ViaFabric.config.setClientSideEnabled(false);
|
ViaFabric.config.setClientSideEnabled(false);
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
widget.setMessage(getClientSideText().asString());
|
widget.setMessage(getClientSideText().asString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removed() {
|
public void removed() {
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -131,7 +131,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
|
|
||||||
private void onHideViaButton(ButtonWidget widget) {
|
private void onHideViaButton(ButtonWidget widget) {
|
||||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getHideViaButtonText().asString());
|
widget.setMessage(getHideViaButtonText().asString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
int finalNewVersion = newVersion;
|
int finalNewVersion = newVersion;
|
||||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||||
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
||||||
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
|
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClickClientSide(ButtonWidget widget) {
|
private void onClickClientSide(ButtonWidget widget) {
|
||||||
@ -93,7 +93,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
if (answer) {
|
if (answer) {
|
||||||
ViaFabric.config.setClientSideEnabled(true);
|
ViaFabric.config.setClientSideEnabled(true);
|
||||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getClientSideText());
|
widget.setMessage(getClientSideText());
|
||||||
}
|
}
|
||||||
MinecraftClient.getInstance().openScreen(this);
|
MinecraftClient.getInstance().openScreen(this);
|
||||||
@ -105,14 +105,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
ViaFabric.config.setClientSideEnabled(false);
|
ViaFabric.config.setClientSideEnabled(false);
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
widget.setMessage(getClientSideText());
|
widget.setMessage(getClientSideText());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removed() {
|
public void removed() {
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -133,7 +133,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
|
|
||||||
private void onHideViaButton(ButtonWidget widget) {
|
private void onHideViaButton(ButtonWidget widget) {
|
||||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getHideViaButtonText());
|
widget.setMessage(getHideViaButtonText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
int finalNewVersion = newVersion;
|
int finalNewVersion = newVersion;
|
||||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||||
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
||||||
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
|
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClickClientSide(ButtonWidget widget) {
|
private void onClickClientSide(ButtonWidget widget) {
|
||||||
@ -93,7 +93,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
if (answer) {
|
if (answer) {
|
||||||
ViaFabric.config.setClientSideEnabled(true);
|
ViaFabric.config.setClientSideEnabled(true);
|
||||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getClientSideText());
|
widget.setMessage(getClientSideText());
|
||||||
}
|
}
|
||||||
MinecraftClient.getInstance().setScreen(this);
|
MinecraftClient.getInstance().setScreen(this);
|
||||||
@ -105,14 +105,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
ViaFabric.config.setClientSideEnabled(false);
|
ViaFabric.config.setClientSideEnabled(false);
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
widget.setMessage(getClientSideText());
|
widget.setMessage(getClientSideText());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removed() {
|
public void removed() {
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -133,7 +133,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
|
|
||||||
private void onHideViaButton(ButtonWidget widget) {
|
private void onHideViaButton(ButtonWidget widget) {
|
||||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getHideViaButtonText());
|
widget.setMessage(getHideViaButtonText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
int finalNewVersion = newVersion;
|
int finalNewVersion = newVersion;
|
||||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||||
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
||||||
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
|
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClickClientSide(ButtonWidget widget) {
|
private void onClickClientSide(ButtonWidget widget) {
|
||||||
@ -93,7 +93,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
if (answer) {
|
if (answer) {
|
||||||
ViaFabric.config.setClientSideEnabled(true);
|
ViaFabric.config.setClientSideEnabled(true);
|
||||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getClientSideText());
|
widget.setMessage(getClientSideText());
|
||||||
}
|
}
|
||||||
MinecraftClient.getInstance().setScreen(this);
|
MinecraftClient.getInstance().setScreen(this);
|
||||||
@ -105,14 +105,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
ViaFabric.config.setClientSideEnabled(false);
|
ViaFabric.config.setClientSideEnabled(false);
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
widget.setMessage(getClientSideText());
|
widget.setMessage(getClientSideText());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removed() {
|
public void removed() {
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -133,7 +133,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
|
|
||||||
private void onHideViaButton(ButtonWidget widget) {
|
private void onHideViaButton(ButtonWidget widget) {
|
||||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getHideViaButtonText());
|
widget.setMessage(getHideViaButtonText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
int finalNewVersion = newVersion;
|
int finalNewVersion = newVersion;
|
||||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||||
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
||||||
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
|
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClickClientSide(ButtonWidget widget) {
|
private void onClickClientSide(ButtonWidget widget) {
|
||||||
@ -97,7 +97,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
if (answer) {
|
if (answer) {
|
||||||
ViaFabric.config.setClientSideEnabled(true);
|
ViaFabric.config.setClientSideEnabled(true);
|
||||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getClientSideText());
|
widget.setMessage(getClientSideText());
|
||||||
}
|
}
|
||||||
MinecraftClient.getInstance().setScreen(this);
|
MinecraftClient.getInstance().setScreen(this);
|
||||||
@ -109,14 +109,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
ViaFabric.config.setClientSideEnabled(false);
|
ViaFabric.config.setClientSideEnabled(false);
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
widget.setMessage(getClientSideText());
|
widget.setMessage(getClientSideText());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removed() {
|
public void removed() {
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -137,7 +137,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
|
|
||||||
private void onHideViaButton(ButtonWidget widget) {
|
private void onHideViaButton(ButtonWidget widget) {
|
||||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getHideViaButtonText());
|
widget.setMessage(getHideViaButtonText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
int finalNewVersion = newVersion;
|
int finalNewVersion = newVersion;
|
||||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||||
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
||||||
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
|
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClickClientSide(ButtonWidget widget) {
|
private void onClickClientSide(ButtonWidget widget) {
|
||||||
@ -97,7 +97,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
if (answer) {
|
if (answer) {
|
||||||
ViaFabric.config.setClientSideEnabled(true);
|
ViaFabric.config.setClientSideEnabled(true);
|
||||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getClientSideText());
|
widget.setMessage(getClientSideText());
|
||||||
}
|
}
|
||||||
MinecraftClient.getInstance().setScreen(this);
|
MinecraftClient.getInstance().setScreen(this);
|
||||||
@ -109,14 +109,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
ViaFabric.config.setClientSideEnabled(false);
|
ViaFabric.config.setClientSideEnabled(false);
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
widget.setMessage(getClientSideText());
|
widget.setMessage(getClientSideText());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removed() {
|
public void removed() {
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -137,7 +137,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
|
|
||||||
private void onHideViaButton(ButtonWidget widget) {
|
private void onHideViaButton(ButtonWidget widget) {
|
||||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.setMessage(getHideViaButtonText());
|
widget.setMessage(getHideViaButtonText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
int finalNewVersion = newVersion;
|
int finalNewVersion = newVersion;
|
||||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||||
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
ViaFabric.config.setClientSideVersion(finalNewVersion);
|
||||||
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
|
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClickClientSide(ButtonWidget widget) {
|
private void onClickClientSide(ButtonWidget widget) {
|
||||||
@ -93,7 +93,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
if (answer) {
|
if (answer) {
|
||||||
ViaFabric.config.setClientSideEnabled(true);
|
ViaFabric.config.setClientSideEnabled(true);
|
||||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.message = getClientSideText().asUnformattedString();
|
widget.message = getClientSideText().asUnformattedString();
|
||||||
}
|
}
|
||||||
MinecraftClient.getInstance().setScreen(this);
|
MinecraftClient.getInstance().setScreen(this);
|
||||||
@ -106,14 +106,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
ViaFabric.config.setClientSideEnabled(false);
|
ViaFabric.config.setClientSideEnabled(false);
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
widget.message = getClientSideText().asUnformattedString();
|
widget.message = getClientSideText().asUnformattedString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removed() {
|
public void removed() {
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
private TranslatableText getClientSideText() {
|
private TranslatableText getClientSideText() {
|
||||||
@ -129,7 +129,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
|||||||
|
|
||||||
private void onHideViaButton(ButtonWidget widget) {
|
private void onHideViaButton(ButtonWidget widget) {
|
||||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||||
ViaFabric.config.saveConfig();
|
ViaFabric.config.save();
|
||||||
widget.message = getHideViaButtonText().asUnformattedString();
|
widget.message = getHideViaButtonText().asUnformattedString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user