9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-24 17:39:26 +00:00

Improve debugger

This commit is contained in:
XiaoMoMi
2024-09-15 14:35:51 +08:00
parent 530f82c627
commit bd23b33f03
2 changed files with 5 additions and 7 deletions

View File

@@ -252,7 +252,7 @@ public abstract class BukkitCustomCropsPlugin implements CustomCropsPlugin {
*
* @param message the message supplier to log
*/
public abstract void debug(Supplier<Object> message);
public abstract void debug(Supplier<String> message);
/**
* Retrieves the data folder for the plugin.

View File

@@ -74,7 +74,7 @@ public class BukkitCustomCropsPluginImpl extends BukkitCustomCropsPlugin {
private final PluginLogger logger;
private BukkitCommandManager commandManager;
private HologramManager hologramManager;
private Consumer<Object> debugger;
private Consumer<Supplier<String>> debugger = (supplier -> {});
private String buildByBit = "%%__BUILTBYBIT__%%";
private String polymart = "%%__POLYMART__%%";
private String time = "%%__TIMESTAMP__%%";
@@ -93,14 +93,12 @@ public class BukkitCustomCropsPluginImpl extends BukkitCustomCropsPlugin {
@Override
public void debug(Object message) {
if (this.debugger != null)
this.debugger.accept(message);
this.debugger.accept(message::toString);
}
@Override
public void debug(Supplier<Object> message) {
if (this.debugger != null)
this.debugger.accept(message.get());
public void debug(Supplier<String> message) {
this.debugger.accept(message);
}
@Override