Skip to content

Commit fce6266

Browse files
authored
fixed some debug issues
added more proper checks for debug messages
1 parent b2f5145 commit fce6266

File tree

9 files changed

+20
-55
lines changed

9 files changed

+20
-55
lines changed

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ conditions:
3131
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3232
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3333
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
34-
DEALINGS IN THE SOFTWARE.
34+
DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,10 @@ This project is licensed under the **Open Contribution License (MIT + Non-Commer
563563
See the [LICENSE.txt](LICENSE.txt) file for the full legal text.
564564
565565
### 🔎 TL;DR
566-
- ✅ Free to use, share, and modify.
567-
- 🚫 Not allowed for commercial use (no selling, no paid forks, no bundling into paid products).
568-
- 🔄 If you change or improve things, you must license your changes under the same terms and contribute them back (e.g. via a pull request or patch).
569-
- 📝 Keep the copyright & license notice in all copies.
566+
- ✅ Free to use, share, and modify.
567+
- 🚫 Not allowed for commercial use (no selling, no paid forks, no bundling into paid products).
568+
- 🔄 If you change or improve things, you must license your changes under the same terms and contribute them back (e.g. via a pull request or patch).
569+
- 📝 Keep the copyright & license notice in all copies.
570570
- ⚠️ No warranty.
571571
572572
## 🙏 Acknowledgments
@@ -585,3 +585,4 @@ See the [LICENSE.txt](LICENSE.txt) file for the full legal text.
585585
586586
*Built with ❤️ for the Minecraft community*
587587
588+

dependency-reduced-pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@
8080
<version>1.21.1-R0.1-SNAPSHOT</version>
8181
<scope>provided</scope>
8282
</dependency>
83-
<dependency>
84-
<groupId>mysql</groupId>
85-
<artifactId>mysql-connector-java</artifactId>
86-
<version>8.0.33</version>
87-
<scope>compile</scope>
88-
</dependency>
8983
<dependency>
9084
<groupId>me.clip</groupId>
9185
<artifactId>placeholderapi</artifactId>

src/main/java/me/wethink/weGuardian/WeGuardian.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ public void onEnable() {
5454
foliaLib = new FoliaLib(this);
5555
boolean isFolia = foliaLib.isFolia();
5656
String platform = isFolia ? "Folia" : "Paper/Spigot/Bukkit";
57-
getLogger().info("Starting WeGuardian on " + platform + " platform");
57+
debug("Starting WeGuardian on " + platform + " platform");
5858
int threadPoolSize = isFolia ? 4 : 2;
5959
executorService = Executors.newScheduledThreadPool(threadPoolSize);
6060
if (isFolia) {
61-
getLogger().info("Folia detected - Using region-based scheduling optimizations");
61+
debug("Folia detected - Using region-based scheduling optimizations");
6262
}
6363
loadConfigurations();
6464
saveDefaultConfig();
@@ -112,16 +112,16 @@ private void initializeDatabase() {
112112
boolean useMySQL = getConfig().getBoolean("database.mysql.enabled", false);
113113

114114
if (useMySQL && "mysql".equals(databaseType)) {
115-
getLogger().info("Initializing MySQL database connection...");
115+
debug("Initializing MySQL database connection...");
116116
this.databaseManager = new HikariDatabaseManager(this);
117117
} else {
118-
getLogger().info("Initializing YAML file storage...");
118+
debug("Initializing YAML file storage...");
119119
this.databaseManager = new YamlDatabaseManager(this);
120120
}
121121

122122
try {
123123
this.databaseManager.initialize().get();
124-
getLogger().info("Database initialized successfully! Type: " + (useMySQL ? "MySQL" : "YAML"));
124+
debug("Database initialized successfully! Type: " + (useMySQL ? "MySQL" : "YAML"));
125125
} catch (Exception e) {
126126
getLogger().severe("Failed to initialize database: " + e.getMessage());
127127
e.printStackTrace();
@@ -290,7 +290,7 @@ private void loadMessagesConfig() {
290290
saveResource("messages.yml", false);
291291
}
292292
messagesConfig = YamlConfiguration.loadConfiguration(messagesFile);
293-
getLogger().info("Loaded messages configuration with " + messagesConfig.getKeys(true).size() + " message keys");
293+
debug("Loaded messages configuration with " + messagesConfig.getKeys(true).size() + " message keys");
294294
}
295295

296296
private void loadGuiConfigs() {
@@ -320,15 +320,15 @@ private void loadGuiConfigs() {
320320
}
321321
}
322322
reasonsConfig = YamlConfiguration.loadConfiguration(reasonsFile);
323-
getLogger().info("Loaded GUI configurations - Menu: " + guiConfig.getKeys(false).size() +
323+
debug("Loaded GUI configurations - Menu: " + guiConfig.getKeys(false).size() +
324324
" sections, Reasons loaded with " + reasonsConfig.getKeys(false).size() + " categories");
325325
}
326326

327327
public void reloadConfigurations() {
328328
reloadConfig();
329329
loadConfigurations();
330330
clearMessageCache();
331-
getLogger().info("§aConfigurations reloaded successfully!");
331+
debug("§aConfigurations reloaded successfully!");
332332
}
333333

334334
public String getMessage(String path) {

src/main/java/me/wethink/weGuardian/gui/GUIConfigLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private void loadAllGUIConfigs() {
3939
try {
4040
FileConfiguration config = YamlConfiguration.loadConfiguration(guiFile);
4141
guiConfigs.put(guiName, config);
42-
plugin.getLogger().info("Loaded GUI config: " + fileName);
42+
plugin.debug("Loaded GUI config: " + fileName);
4343
} catch (Exception e) {
4444
plugin.getLogger().severe("Failed to load GUI config " + fileName + ": " + e.getMessage());
4545
}

src/main/java/me/wethink/weGuardian/listeners/PlayerListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public void onAsyncPlayerPreLogin(AsyncPlayerPreLoginEvent event) {
9999
}
100100

101101
@EventHandler
102-
public void onPlayerJoin(PlayerJoinEvent event) {
102+
public void onPlayeJoin(PlayerJoinEvent event) {
103103
CompletableFuture.runAsync(() -> {
104104
try {
105105
List<Punishment> punishments = databaseManager.getActivePunishments(event.getPlayer().getUniqueId()).join();

src/main/java/me/wethink/weGuardian/managers/MessageManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ private void loadMessagesConfig() {
2727

2828
if (!messagesFile.exists()) {
2929
plugin.saveResource("messages.yml", false);
30-
plugin.getLogger().info("Created default messages.yml file");
30+
plugin.debug("Created default messages.yml file");
3131
}
3232

3333
messagesConfig = YamlConfiguration.loadConfiguration(messagesFile);
3434
countLoadedMessages();
3535

36-
plugin.getLogger().info("Loaded " + loadedMessagesCount + " messages from messages.yml");
36+
plugin.debug("Loaded " + loadedMessagesCount + " messages from messages.yml");
3737

3838
} catch (Exception e) {
3939
plugin.getLogger().log(Level.SEVERE, "Failed to load messages.yml", e);
@@ -61,7 +61,7 @@ private void countSection(String section) {
6161

6262
public void reloadMessages() {
6363
loadMessagesConfig();
64-
plugin.getLogger().info("Messages configuration reloaded");
64+
plugin.debug("Messages configuration reloaded");
6565
}
6666

6767
public String getMessage(String path) {

src/main/java/me/wethink/weGuardian/services/TemplateService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private void loadTemplates() {
4747
}
4848
}
4949

50-
plugin.getLogger().info("Loaded " + templates.size() + " punishment templates");
50+
plugin.debug("Loaded " + templates.size() + " punishment templates");
5151
}
5252

5353
private void loadTemplate(String name, ConfigurationSection section) {

src/main/resources/config.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# ===========================================
2-
# DATABASE CONFIGURATION
3-
# ===========================================
41
database:
52
type: "yaml"
63

@@ -17,9 +14,6 @@ database:
1714
username: "root"
1815
password: ""
1916

20-
# ===========================================
21-
# PERFORMANCE OPTIMIZATION
22-
# ===========================================
2317
performance:
2418
thread_pool_size: 4
2519
max_concurrent_operations: 50
@@ -34,9 +28,6 @@ performance:
3428
async:
3529
worker_threads: 2
3630

37-
# ===========================================
38-
# NOTIFICATIONS
39-
# ===========================================
4031
notifications:
4132
chat:
4233
enabled: true
@@ -45,9 +36,6 @@ notifications:
4536
actionbar_updates: true
4637
actionbar_interval: 30
4738

48-
# ===========================================
49-
# CROSS-SERVER SYNCHRONIZATION
50-
# ===========================================
5139
cross_server:
5240
enabled: false
5341
sync_interval: 30
@@ -68,9 +56,6 @@ cross_server:
6856
port: 25566
6957
enabled: true
7058

71-
# ===========================================
72-
# CONSOLE COMMANDS
73-
# ===========================================
7459
console_commands:
7560
enabled: false
7661

@@ -98,9 +83,6 @@ console_commands:
9883
on_unmute:
9984
- "broadcast &a{player} has been unmuted by {staff}"
10085

101-
# ===========================================
102-
# DISCORD INTEGRATION
103-
# ===========================================
10486
discord:
10587
enabled: false
10688
webhook_url: "https://discord.com/api/webhooks/YOUR_WEBHOOK_URL"
@@ -118,30 +100,18 @@ discord:
118100
unban: true
119101
unmute: true
120102

121-
# ===========================================
122-
# DEBUG & LOGGING
123-
# ===========================================
124103
debug:
125104
enabled: false
126105
log_performance_metrics: false
127106
log_cache_statistics: false
128107

129-
# ===========================================
130-
# FEATURES
131-
# ===========================================
132108
features:
133109
placeholderapi_integration: true
134110
metrics: true
135111

136-
# ===========================================
137-
# SERVER CONFIGURATION
138-
# ===========================================
139112
appeal_url: "your-server.com/appeals"
140113
server_name: "Unknown"
141114

142-
# ===========================================
143-
# MENU CONFIGURATION
144-
# ===========================================
145115
menus:
146116
validation:
147117
enabled: true

0 commit comments

Comments
 (0)