Skip to content

Commit

Permalink
Fix issues with value requests on 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCodez committed Aug 22, 2022
1 parent 7f5b43b commit 4054e5e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ public void onClick(ClickEvent clickEvent) {
TextComponent comp = new TextComponent(option);
PlayerUtils.getInstance().setPlayerMeta(player, "ValueRequestBoolean", listener);
comp.setClickEvent(new net.md_5.bungee.api.chat.ClickEvent(Action.RUN_COMMAND,
"/" + AdvancedCorePlugin.getInstance().getName() + "valuerequestinput Boolean " + option));
"/" + AdvancedCorePlugin.getInstance().getName().toLowerCase() + "valuerequestinput Boolean "
+ option));
user.sendJson(comp);
option = "False";
comp = new TextComponent(option);
comp.setClickEvent(new net.md_5.bungee.api.chat.ClickEvent(Action.RUN_COMMAND,
"/" + AdvancedCorePlugin.getInstance().getName() + "valuerequestinput Boolean " + option));
"/" + AdvancedCorePlugin.getInstance().getName().toLowerCase() + "valuerequestinput Boolean "
+ option));
user.sendJson(comp);
} else if (method.equals(InputMethod.BOOK)) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ public void onClick(ClickEvent clickEvent) {
String option = num.toString();
TextComponent comp = new TextComponent(option);
comp.setClickEvent(new net.md_5.bungee.api.chat.ClickEvent(Action.RUN_COMMAND,
"/" + AdvancedCorePlugin.getInstance().getName() + "valuerequestinput Number " + option));
"/" + AdvancedCorePlugin.getInstance().getName().toLowerCase() + "valuerequestinput Number " + option));
user.sendJson(comp);
}
if (allowCustomOption) {
String option = "CustomValue";
TextComponent comp = new TextComponent(option);
comp.setClickEvent(new net.md_5.bungee.api.chat.ClickEvent(Action.RUN_COMMAND,
"/" + AdvancedCorePlugin.getInstance().getName() + "valuerequestinput Number " + option));
"/" + AdvancedCorePlugin.getInstance().getName().toLowerCase() + "valuerequestinput Number " + option));
user.sendJson(comp);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,16 @@ public void onClick(ClickEvent clickEvent) {
for (String option : options.keySet()) {
TextComponent comp = new TextComponent(option);
comp.setClickEvent(new net.md_5.bungee.api.chat.ClickEvent(Action.RUN_COMMAND,
"/" + AdvancedCorePlugin.getInstance().getName() + "valuerequestinput String " + option));
"/" + AdvancedCorePlugin.getInstance().getName().toLowerCase() + "valuerequestinput String "
+ option));
user.sendJson(comp);
}
if (allowCustomOption) {
String option = "CustomValue";
TextComponent comp = new TextComponent(option);
comp.setClickEvent(new net.md_5.bungee.api.chat.ClickEvent(Action.RUN_COMMAND,
"/" + AdvancedCorePlugin.getInstance().getName() + "valuerequestinput String " + option));
"/" + AdvancedCorePlugin.getInstance().getName().toLowerCase() + "valuerequestinput String "
+ option));
user.sendJson(comp);
}
} else {
Expand Down

0 comments on commit 4054e5e

Please sign in to comment.