|
|
@ -179,42 +179,39 @@ public class SchematicCommandUtils {
|
|
|
|
|
|
|
|
|
|
|
|
public static void printSchemInfo(Player player, SchematicNode node) {
|
|
|
|
public static void printSchemInfo(Player player, SchematicNode node) {
|
|
|
|
SteamwarUser user = getUser(player);
|
|
|
|
SteamwarUser user = getUser(player);
|
|
|
|
player.sendMessage("§7Schematic: §e" + node.generateBreadcrumbs(user));
|
|
|
|
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_SCHEM", player, node.generateBreadcrumbs(user));
|
|
|
|
if(node.getOwner() == user.getId()) {
|
|
|
|
if(node.getOwner() == user.getId()) {
|
|
|
|
player.spigot().sendMessage(
|
|
|
|
player.spigot().sendMessage(
|
|
|
|
new ComponentBuilder("Name: ").color(ChatColor.GRAY)
|
|
|
|
new ComponentBuilder(SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_NAME", false, player, node.getName()))
|
|
|
|
.append(node.getName()).color(ChatColor.YELLOW)
|
|
|
|
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent[] {SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_ACTION_RENAME_HOVER", false, player)}))
|
|
|
|
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText("§e" + (node.isDir() ? "Ordner" : "Schematic") + " umbenennen")))
|
|
|
|
.event(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/schem rename " + node.generateBreadcrumbs(user) + " "))
|
|
|
|
.event(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/schem rename " + node.generateBreadcrumbs(user) + " [Neuer Name]"))
|
|
|
|
|
|
|
|
.create()
|
|
|
|
.create()
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
player.sendMessage("Name: " + node.getName());
|
|
|
|
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_NAME", player, node.getName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
player.sendMessage("§7Besitzer: §e" + SteamwarUser.get(node.getOwner()).getUserName());
|
|
|
|
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_OWNER", player, node.getOwner() == user.getId() ? user.getUserName() : SteamwarUser.get(node.getOwner()).getUserName());
|
|
|
|
if(node.getOwner() == user.getId()) {
|
|
|
|
if(node.getOwner() == user.getId()) {
|
|
|
|
player.spigot().sendMessage(
|
|
|
|
player.spigot().sendMessage(
|
|
|
|
new ComponentBuilder("Ordner: ").color(ChatColor.GRAY)
|
|
|
|
new ComponentBuilder(SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_PARENT", false, player, node.getParent() == null ? "/" : node.getParentNode().generateBreadcrumbs(user)))
|
|
|
|
.append(node.getParent() == null || node.getParent() == 0 ? "/" : node.getParentNode().generateBreadcrumbs(user))
|
|
|
|
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent[] {SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_ACTION_MOVE_HOVER", false, player)}))
|
|
|
|
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText("§e" + (node.isDir() ? "Ordner" : "Schematic") + " verschieben")))
|
|
|
|
|
|
|
|
.event(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/schem move " + node.generateBreadcrumbs(user) + " " + node.generateBreadcrumbs(user).replace("/" + node.getName(), "")))
|
|
|
|
.event(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/schem move " + node.generateBreadcrumbs(user) + " " + node.generateBreadcrumbs(user).replace("/" + node.getName(), "")))
|
|
|
|
.create()
|
|
|
|
.create()
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
player.sendMessage("§7Ordner: §e" + (node.getParent() == null ? "/" : node.getParentNode().generateBreadcrumbs(user)));
|
|
|
|
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_PARENT", player, node.getParent() == null ? "/" : node.getParentNode().generateBreadcrumbs(user));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
player.sendMessage("§7Letzes Update: §e" + node.getLastUpdate().toLocalDateTime().format(DateTimeFormatter.ofPattern("HH:mm dd.MM.yyyy", Locale.GERMAN)));
|
|
|
|
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_UPDATED", player, node.getLastUpdate());
|
|
|
|
if (!node.isDir()) {
|
|
|
|
if (!node.isDir()) {
|
|
|
|
if(node.getOwner() == user.getId()) {
|
|
|
|
if(node.getOwner() == user.getId()) {
|
|
|
|
player.spigot().sendMessage(
|
|
|
|
player.spigot().sendMessage(
|
|
|
|
new ComponentBuilder("Typ: ").color(ChatColor.GRAY)
|
|
|
|
new ComponentBuilder(SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_TYPE", false, player, node.getSchemtype().name()))
|
|
|
|
.append(node.getSchemtype().name()).color(ChatColor.YELLOW)
|
|
|
|
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent[] {SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_ACTION_TYPE_HOVER", false, player)}))
|
|
|
|
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText("§eSchematic Typ ändern")))
|
|
|
|
|
|
|
|
.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem changetype " + node.generateBreadcrumbs(user)))
|
|
|
|
.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem changetype " + node.generateBreadcrumbs(user)))
|
|
|
|
.create()
|
|
|
|
.create()
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
player.sendMessage("§7Typ: §e" + node.getSchemtype().name());
|
|
|
|
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_TYPE", player, node.getSchemtype().name());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (node.getRank() > 0) {
|
|
|
|
if (node.getRank() > 0) {
|
|
|
|
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_RANK", player, node.getRank());
|
|
|
|
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_RANK", player, node.getRank());
|
|
|
@ -225,32 +222,32 @@ public class SchematicCommandUtils {
|
|
|
|
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_REPLAY", player, SchematicSystem.MESSAGE.parse(node.allowReplay() ? "ON" : "OFF", player));
|
|
|
|
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_REPLAY", player, SchematicSystem.MESSAGE.parse(node.allowReplay() ? "ON" : "OFF", player));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
player.sendMessage("§7Format: §e" + (node.getSchemFormat() ? ".schem" : ".schematic"));
|
|
|
|
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_FORMAT", player, node.getSchemFormat() ? ".schem" : ".schematic");
|
|
|
|
CheckedSchematic.getLastDeclinedOfNode(node).stream().findFirst().ifPresent(checkedSchematic -> player.sendMessage("§cStatus: §c" + checkedSchematic.getStartTime() + " : " + checkedSchematic.getDeclineReason()));
|
|
|
|
CheckedSchematic.getLastDeclinedOfNode(node).stream().findFirst().ifPresent(checkedSchematic -> SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_STATUS", player, checkedSchematic.getEndTime(), checkedSchematic.getDeclineReason()));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
player.sendMessage("§7Typ: §7DIR");
|
|
|
|
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_TYPE", player, SchematicSystem.MESSAGE.parse("UTIL_INFO_TYPE_DIR", player));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(node.getOwner() == user.getId()) {
|
|
|
|
if(node.getOwner() == user.getId()) {
|
|
|
|
ComponentBuilder memberBuilder = new ComponentBuilder("Mitglieder: ").color(ChatColor.GRAY);
|
|
|
|
ComponentBuilder memberBuilder = new ComponentBuilder(SchematicSystem.MESSAGE.parse("UTIL_INFO_MEMBER_STRING", player) + " ").color(ChatColor.GRAY);
|
|
|
|
NodeMember.getNodeMembers(node.getId()).forEach(nodeMember -> {
|
|
|
|
NodeMember.getNodeMembers(node.getId()).forEach(nodeMember -> {
|
|
|
|
SteamwarUser member = SteamwarUser.get(nodeMember.getMember());
|
|
|
|
SteamwarUser member = SteamwarUser.get(nodeMember.getMember());
|
|
|
|
memberBuilder.append(member.getUserName())
|
|
|
|
memberBuilder.append(member.getUserName())
|
|
|
|
.color(ChatColor.YELLOW)
|
|
|
|
.color(ChatColor.YELLOW)
|
|
|
|
.event(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/schem delmember " + node.generateBreadcrumbs(user) + " " + member.getUserName()))
|
|
|
|
.event(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/schem delmember " + node.generateBreadcrumbs(user) + " " + member.getUserName()))
|
|
|
|
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText("§e" + member.getUserName() + " entfernen")))
|
|
|
|
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent[]{SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_ACTION_REMOVE_HOVER", false, player, member.getUserName())}))
|
|
|
|
.append(" ", ComponentBuilder.FormatRetention.NONE);
|
|
|
|
.append(" ", ComponentBuilder.FormatRetention.NONE);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
memberBuilder.append("+", ComponentBuilder.FormatRetention.NONE)
|
|
|
|
memberBuilder.append("+", ComponentBuilder.FormatRetention.NONE)
|
|
|
|
.color(ChatColor.GREEN)
|
|
|
|
.color(ChatColor.GREEN)
|
|
|
|
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText("§eMember hinzufügen")))
|
|
|
|
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent[]{SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_ACTION_ADD_HOVER", false, player)}))
|
|
|
|
.event(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/schem addmember " + node.generateBreadcrumbs(user) + " "));
|
|
|
|
.event(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/schem addmember " + node.generateBreadcrumbs(user) + " "));
|
|
|
|
player.spigot().sendMessage(memberBuilder.create());
|
|
|
|
player.spigot().sendMessage(memberBuilder.create());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
List<String> schematicMembers = new ArrayList<>();
|
|
|
|
List<String> schematicMembers = new ArrayList<>();
|
|
|
|
NodeMember.getNodeMembers(node.getId()).forEach(nodeMember -> schematicMembers.add(SteamwarUser.get(nodeMember.getMember()).getUserName()));
|
|
|
|
NodeMember.getNodeMembers(node.getId()).forEach(nodeMember -> schematicMembers.add(SteamwarUser.get(nodeMember.getMember()).getUserName()));
|
|
|
|
player.sendMessage("§7Mitglieder: §e" + schematicMembers);
|
|
|
|
SchematicSystem.MESSAGE.sendPrefixless("UTIL_INFO_MEMBER", player, schematicMembers);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TextComponent base = new TextComponent();
|
|
|
|
TextComponent base = new TextComponent();
|
|
|
@ -274,7 +271,7 @@ public class SchematicCommandUtils {
|
|
|
|
TextComponent delete = SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_ACTION_DELETE", false, player);
|
|
|
|
TextComponent delete = SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_ACTION_DELETE", false, player);
|
|
|
|
delete.setColor(ChatColor.DARK_RED);
|
|
|
|
delete.setColor(ChatColor.DARK_RED);
|
|
|
|
delete.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent[]{SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_ACTION_DELETE_HOVER", false, player)}));
|
|
|
|
delete.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent[]{SchematicSystem.MESSAGE.parseToComponent("UTIL_INFO_ACTION_DELETE_HOVER", false, player)}));
|
|
|
|
delete.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem delete " + node.generateBreadcrumbs(user)));
|
|
|
|
delete.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/schem delete " + node.generateBreadcrumbs(user)));
|
|
|
|
base.addExtra(delete);
|
|
|
|
base.addExtra(delete);
|
|
|
|
|
|
|
|
|
|
|
|
if (!base.getExtra().isEmpty()) {
|
|
|
|
if (!base.getExtra().isEmpty()) {
|
|
|
|