Skip to content

Commit 70a5459

Browse files
committed
style: clean up unused config options and add extensive comments
1 parent 110d799 commit 70a5459

3 files changed

Lines changed: 90 additions & 37 deletions

File tree

docs/CONFIGURATION.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ Permission overrides: `landclaim.limit.<n>`, `landclaim.warps.limit.<n>`
3939
If you disable `multiProfilesEnabled` after players have already created multiple profiles, they will lose access to all secondary profiles. This setting should be treated as permanent once enabled.
4040
:::
4141

42-
### Auto-Claim Defaults
43-
44-
| Key | Type | Default | Description |
45-
|-----|------|---------|-------------|
46-
| `autoClaimDefault` | Boolean | `false` | Auto-claim enabled by default for new players |
47-
| `autoUnclaimDefault` | Boolean | `false` | Auto-unclaim enabled by default |
48-
4942
### World & Command Blocking
5043

5144
| Key | Type | Default | Description |

src/main/java/org/ayosynk/landClaimPlugin/config/PluginConfig.java

Lines changed: 79 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,111 +5,163 @@
55

66
import java.util.List;
77

8-
@Header("LandClaimPlugin - Main Configuration")
8+
@Header({
9+
"===========================================================",
10+
" LandClaimPlugin - Main Configuration ",
11+
"==========================================================="
12+
})
913
public class PluginConfig extends OkaeriConfig {
1014

11-
@Comment("Messages Prefix (MiniMessage format)")
15+
@Comment({
16+
"Messages Prefix (MiniMessage format)",
17+
"This prefix will appear before all chat messages sent by the plugin."
18+
})
1219
public String prefix = "<dark_gray>[<gold>LandClaim<dark_gray>]</gold> ";
1320

14-
@Comment("The item used as the Claim Wand (Material name)")
15-
public String claimWandItem = "GOLDEN_SHOVEL";
16-
17-
@Comment("The default language file to load from the locales folder (e.g., en-US, es-ES)")
21+
@Comment({
22+
"The default language/locale file to load from the locales folder (e.g., en-US, es-ES).",
23+
"Make sure the corresponding file exists in the plugins/LandClaimPlugin/locales/ directory."
24+
})
1825
public String language = "en-US";
1926

27+
@Comment({
28+
"Adjacent Claim Connection Check",
29+
"If true, players can only claim new chunks that are directly adjacent to their existing claims.",
30+
"If false, players can claim chunks anywhere in the world."
31+
})
2032
public boolean requireConnectedClaims = false;
33+
34+
@Comment({
35+
"Diagonal Chunk Connection Check",
36+
"If requireConnectedClaims is true, this determines whether diagonal chunks count as connected (true)",
37+
"or only orthogonal (north/south/east/west) chunks count as connected (false)."
38+
})
2139
public boolean allowDiagonalConnections = true;
2240

23-
@Comment("Blocked worlds for claiming")
41+
@Comment({
42+
"Blocked Worlds for Claiming",
43+
"Players will be unable to claim any land inside the worlds listed below."
44+
})
2445
public List<String> blockWorld = List.of("world_nether", "world_the_end");
2546

47+
@Comment({
48+
"Blocked Commands in Claims",
49+
"List of commands that players are strictly blocked from executing while standing inside other players' claims.",
50+
"Use this to prevent unauthorized warping, setting homes, or teleportation in claimed territories."
51+
})
2652
public List<String> blockCmd = List.of("setwarp", "warp", "sethome");
2753

2854
@Comment({
2955
"Multi-Profile System",
30-
"Enable to allow players to manage multiple claims via an active profile selector.",
56+
"Enable to allow players to manage multiple separate claim profiles via an active profile selector GUI.",
3157
"WARNING: If you disable this after players have already created multiple profiles, ",
32-
"they will lose access to all but their primary profile! (Unless they switch back)",
58+
"they will lose access to all secondary profiles! Switch back to enable them again.",
3359
"Use with caution."
3460
})
3561
public boolean multiProfilesEnabled = false;
36-
@Comment("Maximum number of profiles a single player is allowed to create (own)")
62+
63+
@Comment("Maximum number of separate claim profiles a single player is allowed to own/create.")
3764
public int maxProfilesPerPlayer = 2;
3865

66+
@Comment("Cooldown in seconds for the /claim unstuck command to prevent spamming.")
3967
public int cooldownUnstuck = 30;
4068

41-
@Comment("Map Integration")
69+
@Comment("Integration settings for web-based live maps (Dynmap, BlueMap, Squaremap, Pl3xmap).")
4270
public MapConfig dynmap = new MapConfig();
4371
public MapConfig bluemap = new MapConfig();
4472
public MapConfig squaremap = new MapConfig();
4573
public MapConfig pl3xmap = new MapConfig();
4674

4775
public static class MapConfig extends OkaeriConfig {
76+
@Comment("Enable/disable this specific map integration.")
4877
public boolean enabled = true;
78+
@Comment("Fill color for the claim areas on the map (Hex color code without #).")
4979
public String fillColor = "3366FF";
80+
@Comment("Fill opacity for the claim areas on the map (0.0 = fully transparent, 1.0 = fully solid).")
5081
public double fillOpacity = 0.3;
82+
@Comment("Border color for the claim areas on the map (Hex color code without #).")
5183
public String borderColor = "3366FF";
84+
@Comment("Border opacity for the claim areas on the map (0.0 = fully transparent, 1.0 = fully solid).")
5285
public double borderOpacity = 0.8;
5386
}
5487

55-
public boolean autoClaimDefault = false;
56-
public boolean autoUnclaimDefault = false;
88+
@Comment("Default maximum number of chunks a player is allowed to claim (can be bypassed with landclaim.limit.X permission).")
5789
public int chunkClaimLimit = 5;
5890

59-
@Comment("Maximum number of claims a player can be a member of (default: 1)")
91+
@Comment("Maximum number of claims a player is allowed to join as a trusted member (default: 1).")
6092
public int maxMemberships = 1;
6193

62-
@Comment("Database Settings (Supported: MYSQL, SQLITE)")
94+
@Comment("Database connection and backend settings (Supported backends: SQLITE, MYSQL, MARIADB).")
6395
public DatabaseConfig database = new DatabaseConfig();
6496

6597
public static class DatabaseConfig extends OkaeriConfig {
66-
@Comment("Database type: SQLITE or MYSQL")
98+
@Comment("Database type: SQLITE, MYSQL, or MARIADB")
6799
public String type = "SQLITE";
68-
@Comment("MySQL/MariaDB host (ignored for SQLite)")
100+
@Comment("MySQL/MariaDB host address (ignored for SQLite)")
69101
public String host = "localhost";
70102
@Comment("MySQL/MariaDB port (ignored for SQLite)")
71103
public int port = 3306;
72104
@Comment("Database name")
73105
public String databaseName = "landclaim";
74106
@Comment("MySQL/MariaDB username (leave empty for SQLite)")
75107
public String username = "";
76-
@Comment({"MySQL/MariaDB password (leave empty for SQLite)",
77-
"Can also be set via LANDCLAIM_DB_PASSWORD environment variable for security"})
108+
@Comment({
109+
"MySQL/MariaDB password (leave empty for SQLite)",
110+
"For improved security, this can also be set via the LANDCLAIM_DB_PASSWORD environment variable."
111+
})
78112
public String password = "";
79-
@Comment("Table prefix for all plugin tables")
113+
@Comment("Table prefix for all plugin tables in the database")
80114
public String tablePrefix = "lc_";
81-
@Comment("Maximum number of database connections in the pool")
115+
@Comment("Maximum number of active database connections in the HikariCP pool")
82116
public int maximumPoolSize = 10;
83-
@Comment("Minimum number of idle connections in the pool")
117+
@Comment("Minimum number of idle connections to maintain in the pool")
84118
public int minimumIdle = 2;
85-
@Comment("Connection timeout in milliseconds")
119+
@Comment("Maximum connection timeout in milliseconds before failing")
86120
public long connectionTimeout = 30000;
87121
}
88122

89-
@Comment("Redis Cross-Server Sync Settings")
123+
@Comment("Redis settings for cross-server synchronization (useful for BungeeCord/Velocity proxy networks).")
90124
public RedisConfig redis = new RedisConfig();
91125

92126
public static class RedisConfig extends OkaeriConfig {
127+
@Comment("Enable/disable Redis synchronization.")
93128
public boolean enabled = false;
129+
@Comment("Redis server host address.")
94130
public String host = "localhost";
131+
@Comment("Redis server port.")
95132
public int port = 6379;
133+
@Comment("Redis server password (leave empty if no authentication is required).")
96134
public String password = "";
135+
@Comment("Redis Pub/Sub channel name used for synchronization messages.")
97136
public String channel = "landclaim:sync";
98137
}
99138

139+
@Comment({
140+
"WorldGuard Adjacency Protection Gap",
141+
"Minimum distance in chunks that must be maintained between a player claim and any WorldGuard region.",
142+
"Set to 0 to disable this gap restriction."
143+
})
100144
public int worldguardGap = 0;
145+
146+
@Comment({
147+
"Claim Adjacency Protection Gap",
148+
"Minimum distance in chunks that must be maintained between claims owned by different players.",
149+
"Set to 0 to allow players to claim chunks adjacent to other players' claims."
150+
})
101151
public int minClaimGap = 0;
102152

153+
@Comment("Interval in server ticks (20 ticks = 1 second) for updating the player action bar display (boundary titles, claim status, etc.).")
103154
public int actionbarUpdateInterval = 20;
104155

105-
@Comment("Default maximum warps per player (bypass with landclaim.warps.limit.X)")
156+
@Comment("Default maximum claim warps a player can set (can be bypassed with landclaim.warps.limit.X permission).")
106157
public int maxWarps = 3;
107158

108159
@Comment({
109-
"LuckPerms / Bukkit Permissions",
160+
"LuckPerms / Bukkit Permissions Bypass",
110161
"If true, separate permissions like landclaim.menu.<menu>, landclaim.menu.*, ",
111162
"and command-specific permissions (e.g., landclaim.unstuck) will be checked.",
112-
"If false, separate permissions are bypassed so you don't have to configure a permission system."
163+
"If false, these separate permissions are bypassed. This is ideal for friendly/vanilla SMP ",
164+
"servers where players don't want to set up an elaborate permission group system."
113165
})
114166
public boolean useSeparatePremission = false;
115167

tasks/todo.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@
1111
- [x] Document the new config option in `docs/CONFIGURATION.md` <!-- id: 7 -->
1212
- [x] Create logical git commits for the changes <!-- id: 8 -->
1313

14+
# Follow-up: Make config more understandable and remove unused things
15+
- [x] Clean up `PluginConfig.java` by removing unused fields (`claimWandItem`, `autoClaimDefault`, `autoUnclaimDefault`) <!-- id: 9 -->
16+
- [x] Add detailed, readable comments/descriptions to all configuration fields in `PluginConfig.java` <!-- id: 10 -->
17+
- [x] Remove unused settings from `docs/CONFIGURATION.md` and update documentation for clarity <!-- id: 11 -->
18+
- [x] Verify compilation succeeds with Maven <!-- id: 12 -->
19+
- [x] Commit the changes <!-- id: 13 -->
20+
1421
## Review
15-
- [x] Centralized checks correctly handle separate permissions or bypass them when disabled.
16-
- [x] Documentation is complete.
17-
- [x] Changes are committed.
22+
- [x] Unused configuration parameters are removed cleanly from source code and docs.
23+
- [x] Detailed Okaeri comments are added to all configuration fields.
24+
- [x] Project compiles and builds successfully.
25+
- [x] Changes are logically committed.

0 commit comments

Comments
 (0)