Skip to content

Commit

Permalink
3.21.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rockyhawk64 committed Aug 23, 2024
1 parent 8b518e3 commit 768b2a6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion resource/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 3.21.4.0
version: 3.21.4.1
main: me.rockyhawk.commandpanels.CommandPanels
name: CommandPanels
author: RockyHawk
Expand Down
7 changes: 5 additions & 2 deletions src/me/rockyhawk/commandpanels/CommandPanels.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,11 @@ public void onEnable() {
}

try {
// Check for a class that exists only in Paper
Class.forName("com.destroystokyo.paper.PaperConfig");
// Check all the minimessage classes exist before loading
Class.forName("net.kyori.adventure.text.Component");
Class.forName("net.kyori.adventure.text.format.TextDecoration");
Class.forName("net.kyori.adventure.text.minimessage.MiniMessage");
Class.forName("net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer");
miniMessage = new MiniMessageUtils(this);
} catch (ClassNotFoundException ignore) {
//do not initialise miniMessage
Expand Down
10 changes: 5 additions & 5 deletions src/me/rockyhawk/commandpanels/floodgatecp/OpenFloodgateGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private List<String> processButtons(ConfigurationSection fgPanel, SimpleForm.Bui
ConfigurationSection buttonConfig = fgPanel.getConfigurationSection(key + section);
if (buttonConfig == null) return null;

String buttonContent = plugin.tex.placeholders(panel, null, p, buttonConfig.getString("text"));
String buttonContent = plugin.tex.placeholders(panel, null, p, buttonConfig.getString("text").replaceAll("\\\\n", "\n"));
if (!buttonConfig.contains("icon")) {
form.button(buttonContent);
} else {
Expand Down Expand Up @@ -116,26 +116,26 @@ private void createAndSendCustomForm(PanelOpenedEvent e, FloodgatePlayer fgPlaye
}
switch (type) {
case "toggle":
form.toggle(plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("text")),
form.toggle(plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("text").replaceAll("\\\\n", "\n")),
Boolean.parseBoolean(plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("default"))));
commandsOrder.add(key);
break;
case "slider":
form.slider(plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("text")),
form.slider(plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("text").replaceAll("\\\\n", "\n")),
Long.parseLong(plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("min"))),
Long.parseLong(plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("max"))),
Long.parseLong(plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("step"))),
Long.parseLong(plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("default"))));
commandsOrder.add(key);
break;
case "input":
form.input(plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("text")),
form.input(plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("text").replaceAll("\\\\n", "\n")),
plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("placeholder")),
plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("default")));
commandsOrder.add(key);
break;
case "dropdown":
form.dropdown(plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("text")),
form.dropdown(plugin.tex.placeholders(e.getPanel(), null, e.getPlayer(), fieldConfig.getString("text").replaceAll("\\\\n", "\n")),
plugin.tex.placeholdersList(e.getPanel(), null, e.getPlayer(), fieldConfig.getStringList("options"), true));
commandsOrder.add(key);
break;
Expand Down

0 comments on commit 768b2a6

Please sign in to comment.