13
0

Merge pull request 'Fix Search Click' (#147) from fix_search into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #147
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Chaoscaot 2023-04-22 15:41:40 +02:00
Commit 56a602ccee
2 geänderte Dateien mit 4 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -146,10 +146,10 @@ public class SchematicCommandUtils {
if (node.isDir()) { if (node.isDir()) {
schematics.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(SchematicSystem.MESSAGE.parse("UTIL_LIST_OPEN_DIR", player)).create())); schematics.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(SchematicSystem.MESSAGE.parse("UTIL_LIST_OPEN_DIR", player)).create()));
schematics.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem list " + (behavior.isPublics() ? "public " : "") + breadcrumbs + node.getName() + "/")); schematics.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem list " + (behavior.isPublics() ? "public " : "") + (behavior.nonCachedBreadcrumbs ? node.generateBreadcrumbs() : breadcrumbs + node.getName() + "/")));
} else { } else {
schematics.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(SchematicSystem.MESSAGE.parse("UTIL_LIST_OPEN_SCHEM", player)).create())); schematics.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(SchematicSystem.MESSAGE.parse("UTIL_LIST_OPEN_SCHEM", player)).create()));
schematics.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem info " + (behavior.isPublics() ? "public " : "") + breadcrumbs + node.getName())); schematics.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem info " + (behavior.isPublics() ? "public " : "") + (behavior.nonCachedBreadcrumbs ? node.generateBreadcrumbs() : breadcrumbs + node.getName())));
} }
player.spigot().sendMessage(schematics); player.spigot().sendMessage(schematics);
@ -194,6 +194,7 @@ public class SchematicCommandUtils {
@Builder.Default private boolean showPath = true; @Builder.Default private boolean showPath = true;
@Builder.Default private boolean publics = false; @Builder.Default private boolean publics = false;
@Builder.Default private boolean nonCachedBreadcrumbs = false;
@Builder.Default private UnaryOperator<String> renderHook = s -> s; @Builder.Default private UnaryOperator<String> renderHook = s -> s;
@Builder.Default private IntFunction<String> pageCommandGen = value -> "/schem list " + value; @Builder.Default private IntFunction<String> pageCommandGen = value -> "/schem list " + value;
} }

Datei anzeigen

@ -127,7 +127,7 @@ public class SearchPart extends SWCommand {
s = s.replace(ss, "§e§l" + ss + "§7"); s = s.replace(ss, "§e§l" + ss + "§7");
} }
return "§7" + s; return "§7" + s;
}).build()); }).setNonCachedBreadcrumbs(true).build());
} }
@Mapper(value = "searchMapper", local = true) @Mapper(value = "searchMapper", local = true)