|
1 | 1 | package net.swofty.commons.config; |
2 | 2 |
|
| 3 | +import de.exlll.configlib.Comment; |
| 4 | +import de.exlll.configlib.Configuration; |
3 | 5 | import lombok.AccessLevel; |
4 | 6 | import lombok.Getter; |
5 | 7 | import lombok.NoArgsConstructor; |
6 | | -import org.spongepowered.configurate.objectmapping.ConfigSerializable; |
7 | | -import org.spongepowered.configurate.objectmapping.meta.Comment; |
| 8 | + |
| 9 | +import java.util.HashMap; |
| 10 | +import java.util.Map; |
8 | 11 |
|
9 | 12 | @Getter |
10 | | -@ConfigSerializable |
| 13 | +@Configuration |
11 | 14 | @SuppressWarnings({"unused", "FieldMayBeFinal"}) |
12 | 15 | public class Settings { |
13 | 16 |
|
14 | | - private String hostName = "0.0.0.0"; |
15 | | - private long transferTimeout = 800; |
| 17 | + @Comment("The host name or IP address to bind the server to") |
| 18 | + private String hostName = "0.0.0.0"; |
16 | 19 |
|
17 | | - @Comment("The MongoDB connection URI") |
18 | | - private String mongodb = "mongodb://localhost"; |
| 20 | + @Comment("The MongoDB connection URI") |
| 21 | + private String mongodb = "mongodb://localhost"; |
19 | 22 |
|
20 | | - @Comment("The Redis connection URI") |
21 | | - private String redisUri = "redis://localhost:6379"; |
| 23 | + @Comment("The Redis connection URI") |
| 24 | + private String redisUri = "redis://localhost:6379"; |
22 | 25 |
|
23 | | - @Comment("The secret key used to authenticate with Velocity proxy") |
24 | | - private String velocitySecret = "ixmSUgWOgvs7"; |
| 26 | + @Comment("The secret key used to authenticate with Velocity proxy") |
| 27 | + private String velocitySecret = "ixmSUgWOgvs7"; |
25 | 28 |
|
26 | | - private boolean requireAuth = false; |
| 29 | + private boolean requireAuth = false; |
27 | 30 |
|
28 | | - @Comment("Whether to enable sandbox features (such as editing items)") |
29 | | - private boolean sandbox = false; |
| 31 | + @Comment("Whether to enable sandbox features (such as editing items)") |
| 32 | + private boolean sandbox = false; |
30 | 33 |
|
31 | | - @Comment("Integrations with services") |
32 | | - private IntegrationSettings integrations = new IntegrationSettings(); |
| 34 | + @Comment("Integrations with services") |
| 35 | + private IntegrationSettings integrations = new IntegrationSettings(); |
33 | 36 |
|
34 | | - @Comment("Settings related to configuration of Limbo server connections") |
35 | | - private LimboSettings limbo = new LimboSettings(); |
| 37 | + @Comment("Settings related to configuration of Limbo server connections") |
| 38 | + private LimboSettings limbo = new LimboSettings(); |
36 | 39 |
|
37 | | - @Comment("Resource pack settings keyed by pack name (e.g. testingpack, bedwarspack)") |
38 | | - private java.util.Map<String, ResourcePackSettings> resourcePacks = new java.util.HashMap<>(); |
| 40 | + @Comment("Resource pack settings keyed by pack name (e.g. testingpack, bedwarspack)") |
| 41 | + private Map<String, ResourcePackSettings> resourcePacks = new HashMap<>(); |
39 | 42 |
|
40 | | - @Getter |
41 | | - @ConfigSerializable |
42 | | - @NoArgsConstructor(access = AccessLevel.PRIVATE) |
43 | | - public static class LimboSettings { |
44 | | - private String hostName = "127.0.0.1"; |
45 | | - private int port = 65535; |
46 | | - } |
| 43 | + @Getter |
| 44 | + @Configuration |
| 45 | + @NoArgsConstructor(access = AccessLevel.PRIVATE) |
| 46 | + public static class LimboSettings { |
| 47 | + private String hostName = "127.0.0.1"; |
| 48 | + private int port = 65535; |
| 49 | + } |
47 | 50 |
|
48 | | - @Getter |
49 | | - @ConfigSerializable |
50 | | - @NoArgsConstructor |
51 | | - public static class ResourcePackSettings { |
52 | | - @Comment("Base URL of the pack server (e.g. http://0.0.0.0:7270)") |
53 | | - private String serverUrl = "http://127.0.0.1:7270"; |
54 | | - } |
| 51 | + @Getter |
| 52 | + @Configuration |
| 53 | + @NoArgsConstructor |
| 54 | + public static class ResourcePackSettings { |
| 55 | + @Comment("Base URL of the pack server (e.g. http://0.0.0.0:7270)") |
| 56 | + private String serverUrl = "http://127.0.0.1:7270"; |
| 57 | + } |
55 | 58 |
|
56 | | - @Getter |
57 | | - @ConfigSerializable |
58 | | - @NoArgsConstructor(access = AccessLevel.PRIVATE) |
59 | | - public static class IntegrationSettings { |
60 | | - @Comment("Whether to enable Spark for performance monitoring") |
61 | | - private boolean spark = false; |
| 59 | + @Getter |
| 60 | + @Configuration |
| 61 | + @NoArgsConstructor(access = AccessLevel.PRIVATE) |
| 62 | + public static class IntegrationSettings { |
| 63 | + @Comment("Whether to enable Spark for performance monitoring") |
| 64 | + private boolean spark = false; |
62 | 65 |
|
63 | | - @Comment("Whether to enable anti-cheat measures") |
64 | | - private boolean anticheat = false; |
| 66 | + @Comment("Whether to enable anti-cheat measures") |
| 67 | + private boolean anticheat = false; |
65 | 68 |
|
66 | | - @Comment("Whether to enable ViaVersion for supporting multiple Minecraft versions. This may cause issues of any kind") |
67 | | - private boolean viaVersion = false; |
| 69 | + @Comment("Whether to enable ViaVersion for supporting multiple Minecraft versions. This may cause issues of any kind") |
| 70 | + private boolean viaVersion = false; |
68 | 71 |
|
69 | | - private String sentryDsn = ""; |
70 | | - } |
| 72 | + @Comment("The DSN to use for Sentry error tracking. If empty, Sentry will be disabled") |
| 73 | + private String sentryDsn = ""; |
| 74 | + } |
71 | 75 |
|
72 | 76 | } |
0 commit comments