mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-11-21 11:35:16 +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;
|
||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||
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) {
|
||||
@ -91,7 +91,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
if (answer) {
|
||||
ViaFabric.config.setClientSideEnabled(true);
|
||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getClientSideText().asString());
|
||||
}
|
||||
MinecraftClient.getInstance().openScreen(this);
|
||||
@ -103,14 +103,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
));
|
||||
} else {
|
||||
ViaFabric.config.setClientSideEnabled(false);
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
widget.setMessage(getClientSideText().asString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed() {
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,7 +131,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
|
||||
private void onHideViaButton(ButtonWidget widget) {
|
||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getHideViaButtonText().asString());
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
int finalNewVersion = newVersion;
|
||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||
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) {
|
||||
@ -91,7 +91,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
if (answer) {
|
||||
ViaFabric.config.setClientSideEnabled(true);
|
||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getClientSideText().asString());
|
||||
}
|
||||
MinecraftClient.getInstance().openScreen(this);
|
||||
@ -103,14 +103,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
));
|
||||
} else {
|
||||
ViaFabric.config.setClientSideEnabled(false);
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
widget.setMessage(getClientSideText().asString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed() {
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,7 +131,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
|
||||
private void onHideViaButton(ButtonWidget widget) {
|
||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getHideViaButtonText().asString());
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
int finalNewVersion = newVersion;
|
||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||
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) {
|
||||
@ -93,7 +93,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
if (answer) {
|
||||
ViaFabric.config.setClientSideEnabled(true);
|
||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getClientSideText());
|
||||
}
|
||||
MinecraftClient.getInstance().openScreen(this);
|
||||
@ -105,14 +105,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
));
|
||||
} else {
|
||||
ViaFabric.config.setClientSideEnabled(false);
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
widget.setMessage(getClientSideText());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed() {
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -133,7 +133,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
|
||||
private void onHideViaButton(ButtonWidget widget) {
|
||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getHideViaButtonText());
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
int finalNewVersion = newVersion;
|
||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||
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) {
|
||||
@ -93,7 +93,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
if (answer) {
|
||||
ViaFabric.config.setClientSideEnabled(true);
|
||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getClientSideText());
|
||||
}
|
||||
MinecraftClient.getInstance().setScreen(this);
|
||||
@ -105,14 +105,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
));
|
||||
} else {
|
||||
ViaFabric.config.setClientSideEnabled(false);
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
widget.setMessage(getClientSideText());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed() {
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -133,7 +133,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
|
||||
private void onHideViaButton(ButtonWidget widget) {
|
||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getHideViaButtonText());
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
int finalNewVersion = newVersion;
|
||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||
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) {
|
||||
@ -93,7 +93,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
if (answer) {
|
||||
ViaFabric.config.setClientSideEnabled(true);
|
||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getClientSideText());
|
||||
}
|
||||
MinecraftClient.getInstance().setScreen(this);
|
||||
@ -105,14 +105,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
));
|
||||
} else {
|
||||
ViaFabric.config.setClientSideEnabled(false);
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
widget.setMessage(getClientSideText());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed() {
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -133,7 +133,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
|
||||
private void onHideViaButton(ButtonWidget widget) {
|
||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getHideViaButtonText());
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
int finalNewVersion = newVersion;
|
||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||
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) {
|
||||
@ -97,7 +97,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
if (answer) {
|
||||
ViaFabric.config.setClientSideEnabled(true);
|
||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getClientSideText());
|
||||
}
|
||||
MinecraftClient.getInstance().setScreen(this);
|
||||
@ -109,14 +109,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
));
|
||||
} else {
|
||||
ViaFabric.config.setClientSideEnabled(false);
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
widget.setMessage(getClientSideText());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed() {
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -137,7 +137,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
|
||||
private void onHideViaButton(ButtonWidget widget) {
|
||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getHideViaButtonText());
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
int finalNewVersion = newVersion;
|
||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||
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) {
|
||||
@ -97,7 +97,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
if (answer) {
|
||||
ViaFabric.config.setClientSideEnabled(true);
|
||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getClientSideText());
|
||||
}
|
||||
MinecraftClient.getInstance().setScreen(this);
|
||||
@ -109,14 +109,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
));
|
||||
} else {
|
||||
ViaFabric.config.setClientSideEnabled(false);
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
widget.setMessage(getClientSideText());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed() {
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -137,7 +137,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
|
||||
private void onHideViaButton(ButtonWidget widget) {
|
||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.setMessage(getHideViaButtonText());
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
int finalNewVersion = newVersion;
|
||||
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
|
||||
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) {
|
||||
@ -93,7 +93,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
if (answer) {
|
||||
ViaFabric.config.setClientSideEnabled(true);
|
||||
ViaFabric.config.setClientSideVersion(-2); // AUTO
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.message = getClientSideText().asUnformattedString();
|
||||
}
|
||||
MinecraftClient.getInstance().setScreen(this);
|
||||
@ -106,14 +106,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
));
|
||||
} else {
|
||||
ViaFabric.config.setClientSideEnabled(false);
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
widget.message = getClientSideText().asUnformattedString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed() {
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
}
|
||||
|
||||
private TranslatableText getClientSideText() {
|
||||
@ -129,7 +129,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
|
||||
|
||||
private void onHideViaButton(ButtonWidget widget) {
|
||||
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
|
||||
ViaFabric.config.saveConfig();
|
||||
ViaFabric.config.save();
|
||||
widget.message = getHideViaButtonText().asUnformattedString();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user