mirror of
https://github.com/darksaid98/nightcore-spigot.git
synced 2026-12-03 22:16:57 +00:00
Click commands fix for menus, update fastutil version
This commit is contained in:
1 parent
f70589cbe2
commit
0a8196eb8d
3 files changed
+7
-7
No files matched your search
@@ -88,8 +88,8 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>it.unimi.dsi</groupId>
|
<groupId>it.unimi.dsi</groupId>
|
||||||
<artifactId>fastutil</artifactId>
|
<artifactId>fastutil-core</artifactId>
|
||||||
<version>8.5.11</version>
|
<version>8.5.13</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.MilkBowl</groupId>
|
<groupId>com.github.MilkBowl</groupId>
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public abstract class ConfigMenu<P extends NightCorePlugin> extends AbstractMenu
|
|||||||
comments.add("=".repeat(20) + " ITEM OPTIONS " + "=".repeat(20));
|
comments.add("=".repeat(20) + " ITEM OPTIONS " + "=".repeat(20));
|
||||||
comments.add("> Item: Item to display. Please check: " + Placeholders.WIKI_ITEMS_URL);
|
comments.add("> Item: Item to display. Please check: " + Placeholders.WIKI_ITEMS_URL);
|
||||||
comments.add("> Priority: Button priority. Better values will override other item(s) in the same slot(s).");
|
comments.add("> Priority: Button priority. Better values will override other item(s) in the same slot(s).");
|
||||||
comments.add("> Slots: Button slots. From [0] to [Size - 1]. Split them with a comma.");
|
comments.add("> Slots: Button slots. From [0] to [Size - 1]. Split with commas.");
|
||||||
comments.add("> Click_Commands: Execute custom commands on click. " + Plugins.PLACEHOLDER_API + " available here.");
|
comments.add("> Click_Commands: Execute custom commands on click. " + Plugins.PLACEHOLDER_API + " available here.");
|
||||||
comments.add(" Available click types: " + String.join(", ", Lists.getEnums(ClickType.class)));
|
comments.add(" Available click types: " + String.join(", ", Lists.getEnums(ClickType.class)));
|
||||||
comments.add(" Click_Commands:");
|
comments.add(" Click_Commands:");
|
||||||
@@ -154,13 +154,13 @@ public abstract class ConfigMenu<P extends NightCorePlugin> extends AbstractMenu
|
|||||||
menuItem.setHandler(handler);
|
menuItem.setHandler(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg.contains(path + ".Click_Actions")) {
|
if (cfg.contains(path + ".Click_Commands")) {
|
||||||
Map<ClickType, List<String>> commandMap = new HashMap<>();
|
Map<ClickType, List<String>> commandMap = new HashMap<>();
|
||||||
for (String sType : cfg.getSection(path + ".Click_Actions")) {
|
for (String sType : cfg.getSection(path + ".Click_Commands")) {
|
||||||
ClickType clickType = StringUtil.getEnum(sType, ClickType.class).orElse(null);
|
ClickType clickType = StringUtil.getEnum(sType, ClickType.class).orElse(null);
|
||||||
if (clickType == null) continue;
|
if (clickType == null) continue;
|
||||||
|
|
||||||
List<String> commands = cfg.getStringList(path + ".Click_Actions." + sType);
|
List<String> commands = cfg.getStringList(path + ".Click_Commands." + sType);
|
||||||
commandMap.put(clickType, commands);
|
commandMap.put(clickType, commands);
|
||||||
}
|
}
|
||||||
commandMap.values().removeIf(List::isEmpty);
|
commandMap.values().removeIf(List::isEmpty);
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ api-version: 1.18
|
|||||||
load: STARTUP
|
load: STARTUP
|
||||||
libraries:
|
libraries:
|
||||||
- com.zaxxer:HikariCP:5.0.1
|
- com.zaxxer:HikariCP:5.0.1
|
||||||
- it.unimi.dsi:fastutil:8.5.11
|
- it.unimi.dsi:fastutil-core:8.5.13
|
||||||
Reference in new issue
Block a user