-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathDefaultConfigObjects.java
139 lines (109 loc) · 5.05 KB
/
DefaultConfigObjects.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
package at.helpch.chatchat.config;
import at.helpch.chatchat.api.channel.Channel;
import at.helpch.chatchat.api.format.Format;
import at.helpch.chatchat.api.format.PriorityFormat;
import at.helpch.chatchat.channel.ChatChannel;
import at.helpch.chatchat.config.holder.FormatsHolderImpl;
import at.helpch.chatchat.format.SimpleFormat;
import at.helpch.chatchat.format.ChatFormat;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.sound.Sound;
import org.jetbrains.annotations.NotNull;
import java.util.LinkedHashMap;
import java.util.List;
/**
* Used to create default objects in the config
*/
public final class DefaultConfigObjects {
public static @NotNull Channel createDefaultChannel() {
return new ChatChannel("default", "",
List.of("global"), "<gray>[<blue>Global<gray>]", new FormatsHolderImpl(), -1, false);
}
public static @NotNull Channel createStaffChannel() {
return new ChatChannel("staff", "@",
List.of("staffchat"), "<gray>[<green>Staff<gray>]", new FormatsHolderImpl(), -1, false);
}
public static @NotNull SimpleFormat createDefaultConsoleFormat() {
final LinkedHashMap<String, List<String>> map = new LinkedHashMap<>();
map.put("channel", List.of("%chatchat_channel_prefix% "));
map.put("prefix", List.of("<gray>[<color:#40c9ff>Chat<color:#e81cff>Chat<gray>] "));
map.put("name", List.of("<white>%player_name%"));
map.put("message", List.of(" <gray>» <white><message>"));
return new SimpleFormat("console-format", map);
}
public static @NotNull PriorityFormat createDefaultFormat() {
final LinkedHashMap<String, List<String>> map = new LinkedHashMap<>();
map.put("channel", List.of("%chatchat_channel_prefix% "));
map.put("prefix", List.of("<gray>[<color:#40c9ff>Chat<color:#e81cff>Chat<gray>] "));
map.put("name", List.of("<white>%player_name%"));
map.put("message", List.of(" <gray>» <white><message>"));
return new ChatFormat("default", 2, map);
}
public static @NotNull PriorityFormat createOtherFormat() {
final LinkedHashMap<String, List<String>> map = new LinkedHashMap<>();
map.put("channel", List.of("%chatchat_channel_prefix% "));
map.put("prefix", List.of("<gray>[<gradient:#40c9ff:#e81cff>ChatChat<gray>] "));
map.put(
"name",
List.of(
"<hover:show_text:\"Prefix: %vault_group%\">",
"<rainbow>%player_name%",
"</hover>"
)
);
map.put("message", List.of(" <gray>» <white><message>"));
return new ChatFormat("other", 1, map);
}
public static @NotNull SimpleFormat createPrivateMessageSenderFormat() {
final LinkedHashMap<String, List<String>> map = new LinkedHashMap<>();
map.put("sender", List.of("<gray>you"));
map.put("separator", List.of(" <color:#40c9ff>-> "));
map.put("recipient", List.of("<gray><recipient:player_name>"));
map.put("message", List.of(" <#e81cff>» <white><message>"));
return new SimpleFormat("sender", map);
}
public static @NotNull SimpleFormat createPrivateMessageRecipientFormat() {
final LinkedHashMap<String, List<String>> map = new LinkedHashMap<>();
map.put("sender", List.of("<gray>%player_name%"));
map.put("separator", List.of(" <#40c9ff>-> "));
map.put("recipient", List.of("<gray>you"));
map.put("message", List.of(" <#e81cff>» <white><message>"));
return new SimpleFormat("recipient", map);
}
public static @NotNull SimpleFormat createPrivateMessageSocialSpyFormat() {
final LinkedHashMap<String, List<String>> map = new LinkedHashMap<>();
map.put("prefix", List.of("<gray>(spy) "));
map.put("sender", List.of("%player_name%"));
map.put("separator", List.of(" <#40c9ff>-> "));
map.put("recipient", List.of("<gray><recipient:player_name>"));
map.put("message", List.of(" <#e81cff>» <white><message>"));
return new SimpleFormat("socialspy", map);
}
public static @NotNull SimpleFormat createPersonalMentionFormat() {
final LinkedHashMap<String, List<String>> map = new LinkedHashMap<>();
map.put(
"name",
List.of(
"<hover:show_text:\"<gold>This is a mention!\">",
"<yellow>@%player_name%",
"</hover>"
)
);
return new SimpleFormat("personal-mention", map);
}
public static @NotNull SimpleFormat createChannelMentionFormat() {
final LinkedHashMap<String, List<String>> map = new LinkedHashMap<>();
map.put(
"name",
List.of(
"<hover:show_text:\"<gold>This is a mention!\">",
"<yellow>@everyone",
"</hover>"
)
);
return new SimpleFormat("channel-mention", map);
}
public static @NotNull Sound createMentionSound() {
return Sound.sound(Key.key("entity.experience_orb.pickup"), Sound.Source.MASTER, 1f, 1f);
}
}