-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginConfig.java
More file actions
375 lines (296 loc) · 16.9 KB
/
PluginConfig.java
File metadata and controls
375 lines (296 loc) · 16.9 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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
package com.eternalcode.parcellockers.configuration.implementation;
import com.eternalcode.parcellockers.configuration.serializable.ConfigItem;
import com.eternalcode.parcellockers.database.DatabaseType;
import eu.okaeri.configs.OkaeriConfig;
import eu.okaeri.configs.annotation.Comment;
import eu.okaeri.configs.annotation.Header;
import java.time.Duration;
import java.util.Collections;
import java.util.List;
import org.bukkit.Material;
@Header({
"# ParcelLockers plugin configuration file.",
"",
"# You can change the settings here to customize the plugin behavior or appearance.",
"# If you want to reload the configuration, you can do it using the '/parcellockers reload' command.",
"# Both legacy color codes and MiniMessage formatting are supported in messages and GUI titles."
})
public class PluginConfig extends OkaeriConfig {
public Settings settings = new Settings();
@Comment({ "", "# The plugin GUI settings." })
public GuiSettings guiSettings = new GuiSettings();
@Comment({ "", "# The plugin Discord integration settings." })
public DiscordSettings discord = new DiscordSettings();
public static class Settings extends OkaeriConfig {
@Comment("# Whether the player after entering the server should receive information about the new version of the plugin?")
public boolean receiveUpdates = true;
@Comment({ "", "# The database type. (MYSQL, SQLITE)" })
public DatabaseType databaseType = DatabaseType.SQLITE;
@Comment({ "", "# The URL to the database." })
public String host = "localhost";
@Comment({ "", "# The database name." })
public String databaseName = "parcellockers";
@Comment({ "", "# The database user." })
public String user = "root";
@Comment({ "", "# The database port." })
public String port = "3306";
@Comment({ "", "# The database password." })
public String password = "";
@Comment({ "", "# The parcel locker item." })
public ConfigItem parcelLockerItem = new ConfigItem()
.name("&3Parcel locker")
.type(Material.CHEST)
.lore(List.of("&bPlace to create a parcel locker."));
@Comment({"", "# Standard parcel sending duration"})
public Duration parcelSendDuration = Duration.ofMinutes(30);
@Comment({"", "# Parcel sending duration for priority parcels"})
public Duration priorityParcelSendDuration = Duration.ofSeconds(30);
@Comment({"", "# Maximum number of parcels that can be stored in a single locker"})
public int maxParcelsPerLocker = 30;
@Comment({"", "# Small parcel fee in in-game currency"})
public double smallParcelFee = 10.0;
@Comment({"", "# Medium parcel fee in in-game currency"})
public double mediumParcelFee = 25.0;
@Comment({"", "# Large parcel fee in in-game currency"})
public double largeParcelFee = 50.0;
}
public static class GuiSettings extends OkaeriConfig {
@Comment({ "", "# The title of the main GUI" })
public String mainGuiTitle = "&6Parcel management";
@Comment({ "", "# The title of the parcel list GUI" })
public String parcelListGuiTitle = "&9My parcels";
@Comment({ "", "# The item of the sent parcels GUI" })
public String sentParcelsTitle = "&6Sent parcels";
@Comment({ "", "# The item of the parcel locker sending GUI" })
public String parcelLockerSendingGuiTitle = "&6Send parcel";
@Comment({ "", "# The item of the parcel recipient pick GUI" })
public String parcelReceiverSelectionGuiTitle = "&5Select recipient";
@Comment({ "", "# The item of the parcel collection GUI" })
public String parcelCollectionGuiTitle = "&2Collect parcels";
@Comment({ "", "# The item of the small parcel size button" })
public ConfigItem smallParcelSizeItem = new ConfigItem()
.name("&2\uD83C\uDF37 &aSmall")
.lore(List.of("&2» &aClick to select the small parcel size."))
.type(Material.OAK_CHEST_BOAT);
@Comment({ "", "# The item of the medium parcel size button" })
public ConfigItem mediumParcelSizeItem = new ConfigItem()
.name("&6\uD83C\uDF39 &eMedium")
.lore(List.of("&6» &eClick to select the medium parcel size."))
.type(Material.CHEST_MINECART);
@Comment({ "", "# The item of the large parcel size button" })
public ConfigItem largeParcelSizeItem = new ConfigItem()
.name("&4\uD83C\uDFDD &cLarge")
.lore(List.of("&4» &cClick to select the large parcel size."))
.type(Material.TNT_MINECART);
@Comment({ "", "# The item represents selected small parcel size." })
public ConfigItem selectedSmallParcelSizeItem = new ConfigItem()
.name("&2\uD83C\uDF37 &aSmall")
.lore(List.of("&2✔ Currently selected!"))
.glow(true)
.type(Material.OAK_CHEST_BOAT);
@Comment({ "", "# The item represents selected medium parcel size." })
public ConfigItem selectedMediumParcelSizeItem = new ConfigItem()
.name("&6\uD83C\uDF39 &eMedium")
.lore(List.of("&6✔ &eCurrently selected!"))
.glow(true)
.type(Material.CHEST_MINECART);
@Comment({ "", "# The item represents selected large parcel size." })
public ConfigItem selectedLargeParcelSizeItem = new ConfigItem()
.name("&4\uD83C\uDFDD &cLarge")
.lore(List.of("&4✔ &cCurrently selected!"))
.glow(true)
.type(Material.TNT_MINECART);
@Comment({ "", "# The item of the priority button" })
public ConfigItem priorityItem = new ConfigItem()
.name("&4\uD83D\uDE80 &cPriority")
.lore(List.of("&cClick to send the parcel faster."))
.type(Material.FIREWORK_ROCKET);
@Comment({ "", "# The item of the selected priority button" })
public ConfigItem selectedPriorityItem = new ConfigItem()
.name("&4\uD83D\uDE80 &cPriority")
.lore(List.of("&4✔ &cCurrently selected!", "&8&oClick to unselect."))
.type(Material.FIREWORK_ROCKET)
.glow(true);
@Comment({ "", "# The close button item" })
public ConfigItem closeItem = new ConfigItem()
.name("&4✖ &cClose")
.lore(List.of("&cClick to close the GUI."))
.type(Material.BARRIER);
@Comment({ "", "# The item of the main GUI" })
public ConfigItem mainGuiBackgroundItem = new ConfigItem()
.name("")
.lore(Collections.emptyList())
.type(Material.GRAY_STAINED_GLASS_PANE);
@Comment({ "", "# The item of the corner GUI item.", "# Purely for decoration purposes." })
public ConfigItem cornerItem = new ConfigItem()
.name("")
.lore(Collections.emptyList())
.type(Material.BLUE_STAINED_GLASS_PANE);
@Comment({ "", "# The item of the parcel submit button" })
public ConfigItem submitParcelItem = new ConfigItem()
.name("&2✔ &aSubmit")
.lore(List.of("<gradient:#089F49:#32D25E>Click to send your parcel.</gradient>", "<gradient:#CD2D2D:#EC2465>Before submitting, check if everything has been filled correctly!</gradient>"))
.type(Material.EMERALD_BLOCK)
.glow(true);
@Comment({ "", "# The item of the parcel list button" })
public ConfigItem myParcelsItem = new ConfigItem()
.name("&9\uD83D\uDD83 My parcels")
.lore(List.of("&9» Click to open your parcels."))
.type(Material.ENDER_CHEST);
@Comment({ "", "# The item of the sent parcels button" })
public ConfigItem sentParcelsItem = new ConfigItem()
.name("&6\uD83D\uDD85 &eSent parcels")
.lore(List.of("&6» &eClick to list parcels that you have sent."))
.type(Material.YELLOW_SHULKER_BOX)
.glow(true);
@Comment({ "", "# The parcel archive item button." })
public ConfigItem parcelArchiveItem = new ConfigItem()
.name("&5\uD83D\uDCDA &dParcel archive")
.lore(List.of("&5» &dClick to show all parcels, which you sent or received in the past.", "&c&oNot implemented yet"))
.type(Material.BOOKSHELF);
@Comment({ "", "# The item of the parcel locker collect button" })
public ConfigItem parcelLockerCollectItem = new ConfigItem()
.name("&2\uD83C\uDF20 Collect parcels")
.lore(List.of("&2» &aClick to collect your parcels."))
.type(Material.LECTERN)
.glow(true);
@Comment({ "", "# The item of the parcel locker send button" })
public ConfigItem parcelLockerSendItem = new ConfigItem()
.name("&6\uD83D\uDCE6 Send parcels")
.lore(List.of("&6» &eClick to send parcels."))
.type(Material.CHEST_MINECART)
.glow(true);
@Comment({ "", "# The item of the parcel" })
public ConfigItem parcelItem = new ConfigItem()
.name("&6{NAME}")
.lore(List.of(
"&6Sender: &e{SENDER}",
"&6Receiver: &e{RECEIVER}",
"&6Size: &e{SIZE}",
"&6Position: &6X: &e{POSITION_X}, &6Y: &e{POSITION_Y}, &6Z: &e{POSITION_Z}",
"&6Priority: &e{PRIORITY}",
"&6Description: &e{DESCRIPTION}"
)
)
.type(Material.CHEST_MINECART);
@Comment({ "", "# The lore line showing when the parcel will arrive. Placeholders: {DURATION} - time remaining, {DATE} - arrival date" })
public String parcelArrivingLine = "&6Arriving in: &e{DURATION} &7({DATE})";
@Comment({ "", "# The item of the parcel item storage button" })
public ConfigItem parcelStorageItem = new ConfigItem()
.name("&6\uD83D\uDCBE Parcel storage")
.lore(List.of("&6» &eClick to add/remove items from this parcel."))
.type(Material.CHEST);
@Comment({ "", "# The first line of lore when the parcel item storage contains items."})
public String parcelStorageItemsSetLine = " &6› &eCurrent items:";
@Comment({ "", "# The line of lore containing the item name and amount when the parcel item storage contains items."})
public String parcelStorageItemLine = " &6- &e{AMOUNT}x {ITEM}";
@Comment({ "", "# The item of the parcel name button" })
public ConfigItem parcelNameItem = new ConfigItem()
.name("&4✎ &cParcel name")
.lore(List.of("&4» &cClick to name the parcel."))
.type(Material.NAME_TAG);
@Comment({ "", "# The value of the GUI line, when parcel name is set" })
public String parcelNameSetLine = "&4› &cCurrent parcel name: &e{NAME}";
@Comment({ "", "# The item of the parcel name button" })
public ConfigItem parcelDescriptionItem = new ConfigItem()
.name("&2\uD83D\uDDC9 &aParcel description")
.lore(List.of("&2» &aClick to add parcel description."))
.type(Material.OAK_SIGN);
public String parcelDescriptionSetLine = "&2› &aCurrent parcel description: &2{DESCRIPTION}";
@Comment({ "", "# The item of the parcel receiver button" })
public ConfigItem parcelReceiverItem = new ConfigItem()
.name("&5\uD83E\uDDCD &dParcel receiver")
.lore(List.of("&5» &dClick to choose the parcel receiver."))
.type(Material.PLAYER_HEAD);
@Comment({ "", "# The value of the GUI line, when parcel name is set" })
public String parcelReceiverGuiSetLine = "&5› &dCurrent parcel receiver: &5{RECEIVER}";
@Comment({ "", "# The value of the player itemlore line, when parcel receiver is not set" })
public String parcelReceiverNotSetLine = "&9» &bClick to select.";
@Comment({ "", "# The value of the player item lore line, when parcel receiver is set" })
public String parcelReceiverSetLine = "&2✔ &aSelected!";
@Comment({ "", "# The item of the parcel destination locker button" })
public ConfigItem parcelDestinationLockerItem = new ConfigItem()
.name("&9\uD83D\uDEE3 Destination locker")
.lore(List.of("&9» &3Click to edit the parcel destination locker."))
.type(Material.END_PORTAL_FRAME);
@Comment({ "", "# The item of the previous page button" })
public ConfigItem previousPageItem = new ConfigItem()
.name("&b← Previous page")
.lore(List.of("&bClick to go to the previous page."))
.type(Material.ARROW);
@Comment({ "", "# The item of the next page button" })
public ConfigItem nextPageItem = new ConfigItem()
.name("&b→ Next page")
.lore(List.of("&bClick to go to the next page."))
.type(Material.ARROW);
@Comment({ "", "# The item of the confirm items button" })
public ConfigItem confirmItemsItem = new ConfigItem()
.name("&2✔ &aConfirm items")
.lore(List.of("&2» &aClick to confirm the items."))
.type(Material.GREEN_DYE);
@Comment({ "", "# The name of the parcel small content GUI" })
public String parcelSmallContentGuiTitle = "&2Small parcel content";
@Comment({ "", "# The name of the parcel medium content GUI" })
public String parcelMediumContentGuiTitle = "&6Medium parcel content";
@Comment({ "", "# The name of the parcel large content GUI" })
public String parcelLargeContentGuiTitle = "&4Large parcel content";
@Comment({ "", "# The title of the parcel destination locker selection GUI" })
public String parcelDestinationLockerSelectionGuiTitle = "&3Select destination locker";
@Comment({ "", "# The item of the parcel in destination selection GUI" })
public ConfigItem destinationLockerItem = new ConfigItem()
.name("&3{DESCRIPTION}")
.lore(List.of("&3» &bClick to select this locker."))
.type(Material.END_PORTAL_FRAME);
@Comment({ "", "# The lore of the button in the sending GUI of the parcel destination locker selection GUI" })
public String parcelDestinationLockerSetLine = "&9› &3Current destination locker: &9{DESCRIPTION}";
@Comment({ "", "# The destination GUI locker button lore in case the destination locker is set." })
public String parcelDestinationSetLine = "&2✔ &aSelected!";
@Comment({ "", "# The destination GUI locker button lore in case the destination locker is not set." })
public String parcelDestinationNotSetLine = "&9» &bClick to select.";
@Comment({ "", "# Illegal items list, that cannot be stored in the parcel." })
public List<Material> illegalItems = List.of(
Material.BARRIER,
Material.COMMAND_BLOCK,
Material.COMMAND_BLOCK_MINECART,
Material.CHAIN_COMMAND_BLOCK,
Material.REPEATING_COMMAND_BLOCK,
Material.STRUCTURE_BLOCK,
Material.STRUCTURE_VOID,
Material.JIGSAW,
Material.DEBUG_STICK,
Material.SPAWNER,
Material.BEDROCK,
Material.VAULT,
Material.END_PORTAL_FRAME
);
@Comment({ "", "# The first line of lore when the parcel contains items in the collection GUI."})
public String parcelItemsCollectionGui = "&6Items:";
@Comment({ "", "# The line of lore containing the item name and amount when the parcel contains items in the collection GUI."})
public String parcelItemCollectionFormat = "&6- <gradient:#f6d14a:#862f51>{AMOUNT}x {ITEM}</gradient>";
@Comment({ "", "# The item of the parcel item in the collection GUI" })
public ConfigItem parcelCollectionItem = new ConfigItem()
.name("&a{NAME}")
.lore(List.of(
"&6Sender: &e{SENDER}",
"&6Size: &e{SIZE}",
"&6Description: &e{DESCRIPTION}"
)
)
.type(Material.CHEST_MINECART);
@Comment({ "", "# The item that is displayed in the collection GUI when no parcels are found" })
public ConfigItem noParcelsItem = new ConfigItem()
.name("&4✘ &cNo parcels found")
.lore(List.of("&cYou don't have any parcels to collect."))
.type(Material.STRUCTURE_VOID);
@Comment({ "", "# The lore line showing when the parcel has arrived. Placeholders: {DATE} - arrival date" })
public String parcelArrivedLine = "&aArrived on: &2{DATE}";
}
public static class DiscordSettings extends OkaeriConfig {
@Comment("# Whether Discord integration is enabled.")
public boolean enabled = true;
@Comment("# The Discord bot token used by the bot to connect.")
public String botToken = "";
@Comment("# The expiration duration of the Discord account linking codes.")
public Duration linkCodeExpiration = Duration.ofMinutes(2);
}
}