-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathConfigSettings.java
More file actions
512 lines (410 loc) · 14.1 KB
/
ConfigSettings.java
File metadata and controls
512 lines (410 loc) · 14.1 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
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
package world.bentobox.level.config;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.configuration.ConfigComment;
import world.bentobox.bentobox.api.configuration.ConfigEntry;
import world.bentobox.bentobox.api.configuration.ConfigObject;
import world.bentobox.bentobox.api.configuration.StoreAt;
@StoreAt(filename="config.yml", path="addons/Level")
@ConfigComment("Level Configuration [version]")
@ConfigComment("")
public class ConfigSettings implements ConfigObject {
@ConfigComment("")
@ConfigComment("Disabled Game Mode Addons")
@ConfigComment("Level will NOT hook into these game mode addons.")
@ConfigEntry(path = "disabled-game-modes")
private List<String> gameModes = Collections.emptyList();
@ConfigComment("")
@ConfigComment("Disable ItemsAdder support")
@ConfigComment("This will ignore ItemsAdder even if it is installed and not use it. Do not set this to true unless you know what you are doing.")
@ConfigEntry(path = "disabled-itemsadder")
private boolean disableItemsAdder = false;
@ConfigComment("")
@ConfigComment("When executing level command from console, should a report be shown?")
@ConfigEntry(path = "log-report-to-console")
private boolean logReportToConsole = true;
@ConfigComment("")
@ConfigComment("Number of concurrent island calculations")
@ConfigComment("If your CPU can handle it, you can run parallel island calcs if there are more than one in the queue")
@ConfigEntry(path = "concurrent-island-calcs")
private int concurrentIslandCalcs = 1;
@ConfigComment("")
@ConfigComment("Island level calculation timeout in minutes.")
@ConfigComment("If an island takes longer that this time to calculate, then the calculation will abort.")
@ConfigComment("Generally, calculation should only take a few seconds, so if this ever triggers then something is not right.")
@ConfigEntry(path = "calculation-timeout")
private int calculationTimeout = 5;
@ConfigComment("")
@ConfigComment("Zero island levels on new island or island reset")
@ConfigComment("If true, Level will calculate the starter island's level and remove it from any future level calculations.")
@ConfigComment("If false, the player's starter island blocks will count towards their level.")
@ConfigComment("This will reduce CPU if false.")
@ConfigEntry(path = "zero-new-island-levels")
private boolean zeroNewIslandLevels = true;
@ConfigComment("")
@ConfigComment("Calculate island level on login")
@ConfigComment("This silently calculates the player's island level when they login")
@ConfigComment("This applies to all islands the player has on the server, e.g., BSkyBlock, AcidIsland")
@ConfigEntry(path = "login")
private boolean calcOnLogin = false;
@ConfigComment("")
@ConfigComment("Include nether island in level calculations.")
@ConfigComment("Warning: Enabling this mid-game will give players with an island a jump in")
@ConfigComment("island level. New islands will be correctly zeroed.")
@ConfigEntry(path = "nether")
private boolean nether = false;
@ConfigComment("")
@ConfigComment("Include end island in level calculations.")
@ConfigComment("Warning: Enabling this mid-game will give players with an island a jump in")
@ConfigComment("island level. New islands will be correctly zeroed.")
@ConfigEntry(path = "end")
private boolean end = false;
@ConfigComment("")
@ConfigComment("Include chest contents in level calculations.")
@ConfigComment("Will count blocks in chests or containers.")
@ConfigEntry(path = "include-chests")
private boolean includeChests = false;
@ConfigComment("")
@ConfigComment("Underwater block multiplier")
@ConfigComment("If blocks are below sea-level, they can have a higher value. e.g. 2x")
@ConfigComment("Promotes under-water development if there is a sea. Value can be fractional.")
@ConfigEntry(path = "underwater")
private double underWaterMultiplier = 1.0;
@ConfigComment("")
@ConfigComment("Value of one island level. Default 100. Minimum value is 1.")
@ConfigEntry(path = "levelcost")
private long levelCost = 100;
@ConfigComment("")
@ConfigComment("Island level calculation formula")
@ConfigComment("blocks - the sum total of all block values, less any death penalty")
@ConfigComment("level_cost - in a linear equation, the value of one level")
@ConfigComment("island_members - the number of members on the island team (useful for handicap/fairness systems)")
@ConfigComment("This formula can include +,=,*,/,sqrt,^,sin,cos,tan,log (natural log). Result will always be rounded to a long integer")
@ConfigComment("for example, an alternative non-linear option could be: 3 * sqrt(blocks / level_cost)")
@ConfigComment("To implement a handicap by team size: blocks / level_cost / island_members")
@ConfigEntry(path = "level-calc")
private String levelCalc = "blocks / level_cost";
@ConfigComment("")
@ConfigComment("Cooldown between level requests in seconds")
@ConfigEntry(path = "levelwait")
private int levelWait = 60;
@ConfigComment("")
@ConfigComment("Death penalty")
@ConfigComment("How many block values a player will lose per death.")
@ConfigComment("Default value of 100 means that for every death, the player will lose 1 level (if levelcost is 100)")
@ConfigComment("Set to zero to not use this feature")
@ConfigEntry(path = "deathpenalty")
private int deathPenalty = 100;
@ConfigComment("Sum team deaths - if true, all the teams deaths are summed")
@ConfigComment("If false, only the leader's deaths counts")
@ConfigComment("For other death related settings, see the GameModeAddon's config.yml settings.")
@ConfigEntry(path = "sumteamdeaths")
private boolean sumTeamDeaths = false;
@ConfigComment("Shorthand island level")
@ConfigComment("Shows large level values rounded down, e.g., 10,345 -> 10k")
@ConfigEntry(path = "shorthand")
private boolean shorthand = false;
@ConfigComment("Shorthand units")
@ConfigEntry(path = "units.kilo")
private String kilo = "k";
@ConfigEntry(path = "units.mega")
private String mega = "M";
@ConfigEntry(path = "units.giga")
private String giga = "G";
@ConfigEntry(path = "units.tera")
private String tera = "T";
@ConfigComment("")
@ConfigComment("Include Shulker Box content in chests in level calculations.")
@ConfigComment("Will count blocks in Shulker Boxes inside of chests.")
@ConfigComment("NOTE: include-chests needs to be enabled for this to work!.")
@ConfigEntry(path = "include-shulkers-in-chest")
private boolean includeShulkersInChest = false;
@ConfigComment("")
@ConfigComment("Disables hooking with other plugins.")
@ConfigComment("Example: disabled-plugin-hooks: [UltimateStacker, RoseStacker]")
@ConfigEntry(path = "disabled-plugin-hooks")
private List<String> disabledPluginHooks = new ArrayList<>();
/**
* @return the gameModes
*/
public List<String> getGameModes() {
return gameModes;
}
/**
* @param gameModes the gameModes to set
*/
public void setGameModes(List<String> gameModes) {
this.gameModes = gameModes;
}
/**
* @return the calcOnLogin
*/
public boolean isCalcOnLogin() {
return calcOnLogin;
}
/**
* @param calcOnLogin the calcOnLogin to set
*/
public void setCalcOnLogin(boolean calcOnLogin) {
this.calcOnLogin = calcOnLogin;
}
/**
* @return the nether
*/
public boolean isNether() {
return nether;
}
/**
* @param nether the nether to set
*/
public void setNether(boolean nether) {
this.nether = nether;
}
/**
* @return the end
*/
public boolean isEnd() {
return end;
}
/**
* @param end the end to set
*/
public void setEnd(boolean end) {
this.end = end;
}
/**
* @return the underWaterMultiplier
*/
public double getUnderWaterMultiplier() {
return underWaterMultiplier;
}
/**
* @param underWaterMultiplier the underWaterMultiplier to set
*/
public void setUnderWaterMultiplier(double underWaterMultiplier) {
this.underWaterMultiplier = underWaterMultiplier;
}
/**
* @return the levelCost
*/
public long getLevelCost() {
if (levelCost < 1) {
levelCost = 1;
BentoBox.getInstance().logError("levelcost in config.yml cannot be less than 1. Setting to 1.");
}
return levelCost;
}
/**
* @param levelCost the levelCost to set
*/
public void setLevelCost(long levelCost) {
this.levelCost = levelCost;
}
/**
* @return the levelCalc
*/
public String getLevelCalc() {
return levelCalc;
}
/**
* @param levelCalc the levelCalc to set
*/
public void setLevelCalc(String levelCalc) {
this.levelCalc = levelCalc;
}
/**
* @return the levelWait
*/
public int getLevelWait() {
if (levelWait < 0) {
BentoBox.getInstance().logError("levelwait must be at least 0");
levelWait = 0;
}
return levelWait;
}
/**
* @param levelWait the levelWait to set
*/
public void setLevelWait(int levelWait) {
this.levelWait = levelWait;
}
/**
* @return the deathPenalty
*/
public int getDeathPenalty() {
return deathPenalty;
}
/**
* @param deathPenalty the deathPenalty to set
*/
public void setDeathPenalty(int deathPenalty) {
this.deathPenalty = deathPenalty;
}
/**
* @return the sumTeamDeaths
*/
public boolean isSumTeamDeaths() {
return sumTeamDeaths;
}
/**
* @param sumTeamDeaths the sumTeamDeaths to set
*/
public void setSumTeamDeaths(boolean sumTeamDeaths) {
this.sumTeamDeaths = sumTeamDeaths;
}
/**
* @return the shorthand
*/
public boolean isShorthand() {
return shorthand;
}
/**
* @param shorthand the shorthand to set
*/
public void setShorthand(boolean shorthand) {
this.shorthand = shorthand;
}
/**
* @return the includeChests
*/
public boolean isIncludeChests() {
return includeChests;
}
/**
* @param includeChests the includeChests to set
*/
public void setIncludeChests(boolean includeChests) {
this.includeChests = includeChests;
}
/**
* @return the concurrentIslandCalcs
*/
public int getConcurrentIslandCalcs() {
if (concurrentIslandCalcs < 1) concurrentIslandCalcs = 1;
return concurrentIslandCalcs;
}
/**
* @param concurrentIslandCalcs the concurrentIslandCalcs to set
*/
public void setConcurrentIslandCalcs(int concurrentIslandCalcs) {
if (concurrentIslandCalcs < 1) concurrentIslandCalcs = 1;
this.concurrentIslandCalcs = concurrentIslandCalcs;
}
/**
* @return the zeroNewIslandLevels
*/
public boolean isZeroNewIslandLevels() {
return zeroNewIslandLevels;
}
/**
* @param zeroNewIslandLevels the zeroNewIslandLevels to set
*/
public void setZeroNewIslandLevels(boolean zeroNewIslandLevels) {
this.zeroNewIslandLevels = zeroNewIslandLevels;
}
/**
* @return the calculationTimeout
*/
public int getCalculationTimeout() {
return calculationTimeout;
}
/**
* @param calculationTimeout the calculationTimeout to set
*/
public void setCalculationTimeout(int calculationTimeout) {
this.calculationTimeout = calculationTimeout;
}
/**
* @return logReportToConsole
*/
public boolean isLogReportToConsole() {
return logReportToConsole;
}
/**
* @param logReportToConsole if logReportToConsole should be shown on console
*/
public void setLogReportToConsole(boolean logReportToConsole) {
this.logReportToConsole = logReportToConsole;
}
/**
* @return includeShulkersInChest
*/
public boolean isIncludeShulkersInChest() {
return includeShulkersInChest;
}
/**
* @param includeShulkersInChest the includeChests to set
*/
public void setIncludeShulkersInChest(boolean includeShulkersInChest) {
this.includeShulkersInChest = includeShulkersInChest;
}
public List<String> getDisabledPluginHooks() {
return disabledPluginHooks;
}
public void setDisabledPluginHooks(List<String> disabledPluginHooks) {
this.disabledPluginHooks = disabledPluginHooks;
}
/**
* @return the kilo
*/
public String getKilo() {
return Objects.requireNonNullElse(kilo, "k");
}
/**
* @param kilo the kilo to set
*/
public void setKilo(String kilo) {
this.kilo = kilo;
}
/**
* @return the mega
*/
public String getMega() {
return Objects.requireNonNullElse(mega, "M");
}
/**
* @param mega the mega to set
*/
public void setMega(String mega) {
this.mega = mega;
}
/**
* @return the giga
*/
public String getGiga() {
return Objects.requireNonNullElse(giga, "G");
}
/**
* @param giga the giga to set
*/
public void setGiga(String giga) {
this.giga = giga;
}
/**
* @return the tera
*/
public String getTera() {
return Objects.requireNonNullElse(tera, "T");
}
/**
* @param tera the tera to set
*/
public void setTera(String tera) {
this.tera = tera;
}
/**
* @return the disableItemsAdder
*/
public boolean isDisableItemsAdder() {
return disableItemsAdder;
}
/**
* @param disableItemsAdder the disableItemsAdder to set
*/
public void setDisableItemsAdder(boolean disableItemsAdder) {
this.disableItemsAdder = disableItemsAdder;
}
}