update
This commit is contained in:
1 parent
3f672d1819
commit
15d1c70b8c
5 files changed
+105
-101
No files matched your search
@@ -83,11 +83,6 @@ public final class Dialog {
|
||||
String title;
|
||||
|
||||
switch (state.currentPage()) {
|
||||
case secret -> {
|
||||
title = "Secret";
|
||||
body.add(plain("Bitte gib das Secret ein, das du erhalten hast."));
|
||||
inputs.add(text("secret", "Secret", state.secret, 50));
|
||||
}
|
||||
case data -> {
|
||||
title = "Profildaten";
|
||||
body.add(plain("Bitte fülle deine Profildaten aus."));
|
||||
@@ -158,7 +153,6 @@ public final class Dialog {
|
||||
|
||||
private static void saveCurrentPage(DialogState state, CompoundBinaryTag payload) {
|
||||
switch (state.currentPage()) {
|
||||
case secret -> state.secret = payload.getString("secret", "").trim();
|
||||
case data -> {
|
||||
state.firstName = payload.getString("name", "").trim();
|
||||
state.secondName = payload.getString("secondName", "").trim();
|
||||
@@ -175,15 +169,6 @@ public final class Dialog {
|
||||
|
||||
private static Component validateCurrentPage(Player player, DialogState state) {
|
||||
switch (state.currentPage()) {
|
||||
case secret -> {
|
||||
try {
|
||||
if (!Api.isSecretValid(player.getUsername(), state.secret))
|
||||
return error("Das Secret ist ungültig.");
|
||||
} catch (IllegalStateException e) {
|
||||
e.printStackTrace();
|
||||
return error("Die Überprüfung ist gerade nicht möglich. Bitte versuche es später erneut.");
|
||||
}
|
||||
}
|
||||
case data -> {
|
||||
if (state.firstName.isBlank() || state.secondName.isBlank() || state.birthday.isBlank())
|
||||
return error("Bitte fülle alle Pflichtfelder aus.");
|
||||
|
||||
Reference in new issue
Block a user