feat: 添加调试模式
This commit is contained in:
@@ -6,11 +6,13 @@ import cn.hamster3.mc.plugin.ball.common.api.BallAPI;
|
||||
import cn.hamster3.mc.plugin.ball.common.config.BallConfig;
|
||||
import cn.hamster3.mc.plugin.ball.common.entity.BallServerInfo;
|
||||
import cn.hamster3.mc.plugin.ball.common.entity.BallServerType;
|
||||
import cn.hamster3.mc.plugin.ball.common.listener.BallDebugListener;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class BallBukkitAPI extends BallAPI {
|
||||
public BallBukkitAPI(@NotNull BallConfig config) {
|
||||
@@ -45,6 +47,9 @@ public class BallBukkitAPI extends BallAPI {
|
||||
instance = new BallBukkitAPI(config);
|
||||
|
||||
instance.addListener(BallBukkitListener.INSTANCE);
|
||||
if (pluginConfig.getBoolean("debug", false)) {
|
||||
instance.addListener(BallDebugListener.INSTANCE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,4 +61,9 @@ public class BallBukkitAPI extends BallAPI {
|
||||
public void disable() throws SQLException, InterruptedException {
|
||||
super.disable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Logger getLogger() {
|
||||
return HamsterBallPlugin.getInstance().getLogger();
|
||||
}
|
||||
}
|
||||
|
@@ -1,3 +1,6 @@
|
||||
# 是否允许在控制台输出调试信息
|
||||
debug: false
|
||||
|
||||
ball-server:
|
||||
host: "ball.hamster3.cn"
|
||||
port: 58888
|
||||
|
Reference in New Issue
Block a user