feat: 适配Core更新
This commit is contained in:
@@ -7,7 +7,7 @@ import cn.hamster3.mc.plugin.ball.common.entity.BallServerType;
|
||||
import cn.hamster3.mc.plugin.ball.common.listener.BallDebugListener;
|
||||
import cn.hamster3.mc.plugin.core.bungee.HamsterBallPlugin;
|
||||
import cn.hamster3.mc.plugin.core.bungee.listener.BallBungeeCordListener;
|
||||
import cn.hamster3.mc.plugin.core.bungee.util.BungeeCordUtils;
|
||||
import cn.hamster3.mc.plugin.core.bungee.util.CoreBungeeCordUtils;
|
||||
import net.md_5.bungee.config.Configuration;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class BallBungeeCordAPI extends BallAPI {
|
||||
return;
|
||||
}
|
||||
HamsterBallPlugin plugin = HamsterBallPlugin.getInstance();
|
||||
Configuration pluginConfig = BungeeCordUtils.getPluginConfig(plugin);
|
||||
Configuration pluginConfig = CoreBungeeCordUtils.getPluginConfig(plugin);
|
||||
BallConfig config = new BallConfig(
|
||||
new BallServerInfo(
|
||||
pluginConfig.getString("server-info.id"),
|
||||
|
@@ -7,6 +7,7 @@ import cn.hamster3.mc.plugin.core.common.api.CoreAPI;
|
||||
import cn.hamster3.mc.plugin.core.common.util.CoreUtils;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.connection.Server;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
@@ -16,7 +17,8 @@ public final class BallBungeeCordUtils {
|
||||
private BallBungeeCordUtils() {
|
||||
}
|
||||
|
||||
public static BallPlayerInfo getPlayerInfo(ProxiedPlayer player, boolean online) {
|
||||
@NotNull
|
||||
public static BallPlayerInfo getPlayerInfo(@NotNull ProxiedPlayer player, boolean online) {
|
||||
Server server = player.getServer();
|
||||
return new BallPlayerInfo(
|
||||
player.getUniqueId(),
|
||||
@@ -27,7 +29,7 @@ public final class BallBungeeCordUtils {
|
||||
);
|
||||
}
|
||||
|
||||
public static void uploadPlayerInfo(BallPlayerInfo playerInfo) {
|
||||
public static void uploadPlayerInfo(@NotNull BallPlayerInfo playerInfo) {
|
||||
CoreUtils.WORKER_EXECUTOR.execute(() -> {
|
||||
try (Connection connection = CoreAPI.getInstance().getConnection()) {
|
||||
PreparedStatement statement = connection.prepareStatement("REPLACE INTO `hamster_ball_player_info` VALUES(?, ?, ?, ?, ?);");
|
||||
|
Reference in New Issue
Block a user