-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathConfiguration.java
More file actions
284 lines (246 loc) · 8.84 KB
/
Configuration.java
File metadata and controls
284 lines (246 loc) · 8.84 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
package fr.maxlego08.essentials.api;
import fr.maxlego08.essentials.api.chat.ChatCooldown;
import fr.maxlego08.essentials.api.commands.CommandCooldown;
import fr.maxlego08.essentials.api.commands.CommandRestriction;
import fr.maxlego08.essentials.api.configuration.ReplacePlaceholder;
import fr.maxlego08.essentials.api.server.RedisConfiguration;
import fr.maxlego08.essentials.api.server.ServerType;
import fr.maxlego08.essentials.api.storage.StorageType;
import fr.maxlego08.essentials.api.user.Option;
import fr.maxlego08.essentials.api.utils.MessageColor;
import fr.maxlego08.essentials.api.utils.NearDistance;
import fr.maxlego08.essentials.api.utils.TransformMaterial;
import fr.maxlego08.sarah.DatabaseConfiguration;
import org.bukkit.permissions.Permissible;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
/**
* Represents the configuration of the plugin.
* This interface provides methods to access various configuration settings, such as debug mode,
* command cooldowns, trash size, compact materials, storage type, database configuration,
* server type, and Redis configuration.
*
* @see ConfigurationFile
*/
public interface Configuration extends ConfigurationFile {
/**
* Checks if debug mode is enabled in the plugin configuration.
*
* @return true if debug mode is enabled, false otherwise.
*/
boolean isEnableDebug();
/**
* Checks if cooldown bypass is enabled in the plugin configuration.
*
* @return true if cooldown bypass is enabled, false otherwise.
*/
boolean isEnableCooldownBypass();
/**
* Gets the list of command cooldown configurations from the plugin configuration.
*
* @return The list of CommandCooldown objects representing command cooldown configurations.
*/
List<CommandCooldown> getCommandCooldown();
/**
* Gets the list of command restrictions from the plugin configuration.
*
* @return The list of {@link CommandRestriction} objects representing command restrictions.
*/
List<CommandRestriction> getCommandRestrictions();
/**
* Gets the cooldown duration for a specific command and permissible entity.
*
* @param permissible The permissible entity (e.g., player or command sender).
* @param command The name of the command.
* @return An Optional containing the cooldown duration if found, or empty otherwise.
*/
Optional<Integer> getCooldown(Permissible permissible, String command);
/**
* Gets the size of the trash in the plugin configuration.
*
* @return The size of the trash.
*/
int getTrashSize();
/**
* Gets the list of compact material configurations from the plugin configuration.
*
* @return The list of CompactMaterial objects representing compact material configurations.
*/
List<TransformMaterial> getCompactMaterials();
/**
* Gets the storage type configured in the plugin.
*
* @return The StorageType enum representing the storage type.
*/
StorageType getStorageType();
/**
* Gets the database configuration from the plugin configuration.
*
* @return The DatabaseConfiguration representing the database configuration.
*/
DatabaseConfiguration getDatabaseConfiguration();
/**
* Gets the server type configured in the plugin.
*
* @return The ServerType enum representing the server type.
*/
ServerType getServerType();
/**
* Gets the Redis configuration from the plugin configuration.
*
* @return The RedisConfiguration representing the Redis configuration.
*/
RedisConfiguration getRedisConfiguration();
/**
* Retrieves a list of message colors available.
*
* @return a list of {@link MessageColor} objects
*/
List<MessageColor> getMessageColors();
/**
* Retrieves a list of chat cooldown configurations.
*
* @return a list of {@link ChatCooldown} objects
*/
List<ChatCooldown> getCooldowns();
/**
* Retrieves an array of command cooldown times.
*
* @return an array of long values representing command cooldown times
*/
long[] getCooldownCommands();
/**
* Retrieves a list of smeltable materials.
*
* @return a list of {@link TransformMaterial} objects representing smeltable materials
*/
List<TransformMaterial> getSmeltableMaterials();
/**
* Retrieves the default distance used for the "near" command.
*
* @return the default near distance as a double
*/
double getDefaultNearDistance();
/**
* Retrieves a list of permissions related to near distance.
*
* @return a list of {@link NearDistance} objects representing near permissions
*/
List<NearDistance> getNearPermissions();
/**
* Retrieves the near distance allowed for a specific permissible entity.
*
* @param permissible the entity to check permissions for
* @return the near distance as a double
*/
double getNearDistance(Permissible permissible);
/**
* Checks if command logging is enabled.
*
* @return true if command logging is enabled, false otherwise
*/
boolean isEnableCommandLog();
/**
* Retrieves the global date format used across the server.
*
* @return the {@link SimpleDateFormat} object representing the global date format
*/
SimpleDateFormat getGlobalDateFormat();
/**
* Retrieves a list of placeholder replacements.
*
* @return a list of {@link ReplacePlaceholder} objects
*/
List<ReplacePlaceholder> getReplacePlaceholders();
/**
* Retrieves a specific placeholder replacement by its name.
*
* @param placeholder the name of the placeholder to retrieve
* @return an {@link Optional} containing the found {@link ReplacePlaceholder}, or empty if not found
*/
Optional<ReplacePlaceholder> getReplacePlaceholder(String placeholder);
/**
* Retrieves the default value that should be returned when a placeholder has no data.
*
* @return the placeholder empty value configured in {@code config.yml}
*/
String getPlaceholderEmpty();
/**
* Checks if temporary fly tasks are enabled.
*
* @return true if temporary fly tasks are enabled, false otherwise
*/
boolean isTempFlyTask();
/**
* Retrieves a list of world names where the fly feature is disabled.
*
* @return a list of world names where the fly feature is disabled
*/
List<String> getDisableFlyWorld();
/**
* Checks if fly should be re-enabled when returning to an allowed world.
*
* @return true if fly should be re-enabled automatically, false otherwise
*/
boolean isEnableFlyReturn();
/**
* Retrieves a list of random words used by the plugin for various tasks.
*
* @return a list of random words
*/
List<String> getRandomWords();
/**
* Checks if the plugin is enabled to display nicknames of online and offline players in the command completion tab.
*
* @return true if the plugin is enabled to display nicknames of online and offline players, false otherwise
*/
boolean isEnableOfflinePlayersName();
/**
* Retrieves the batch auto save interval in milliseconds.
*
* @return the batch auto save interval in milliseconds
*/
long getBatchAutoSave();
/**
* Retrieves a list of blacklisted UUIDs, which are the UUIDs of the players
* that are not allowed to connect to the server.
*
* @return a list of blacklisted UUIDs
*/
List<UUID> getBlacklistUuids();
/**
* Retrieves a list of intervals in seconds when the plugin should announce the temporary fly task to the player.
*
* @return a list of intervals in seconds when the plugin should announce the temporary fly task to the player
*/
List<Long> getFlyTaskAnnounce();
/**
* Retrieves a list of world names where the back feature is disabled.
*
* @return a list of world names where the back feature is disabled
*/
List<String> getDisableBackWorld();
/**
* Retrieves the default values of the options, which are the values
* that are set when a player joins the server for the first time.
*
* @return a map of options and their default values
*/
Map<Option, Boolean> getDefaultOptionValues();
/**
* Retrieves the server name used for cross-server communication.
* This is used with BungeeCord/Velocity for cross-server teleportation.
*
* @return the server name, or "default" if not configured
*/
String getServerName();
/**
* Checks if cross-server teleportation is enabled.
*
* @return true if cross-server teleportation is enabled
*/
boolean isCrossServerTeleportEnabled();
}