Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
d0508f6610 |
@@ -4,7 +4,7 @@ import cn.hamster3.mc.plugin.ball.common.api.BallAPI;
|
||||
import cn.hamster3.mc.plugin.ball.common.entity.BallPlayerInfo;
|
||||
import cn.hamster3.mc.plugin.ball.common.event.BallActions;
|
||||
import cn.hamster3.mc.plugin.ball.common.event.server.ServerOnlineEvent;
|
||||
import cn.hamster3.mc.plugin.ball.velocity.api.CoreVelocityAPI;
|
||||
import cn.hamster3.mc.plugin.ball.velocity.api.BallVelocityAPI;
|
||||
import cn.hamster3.mc.plugin.ball.velocity.command.VelocityBallCommand;
|
||||
import cn.hamster3.mc.plugin.ball.velocity.listener.BallVelocityListener;
|
||||
import cn.hamster3.mc.plugin.ball.velocity.listener.BallVelocityMainListener;
|
||||
@@ -77,7 +77,7 @@ public class HamsterBallPlugin {
|
||||
);
|
||||
}
|
||||
config = YamlConfig.load(configFile);
|
||||
CoreVelocityAPI.init(config);
|
||||
BallVelocityAPI.init(config);
|
||||
slf4jLogger.info("已初始化 BallAPI");
|
||||
} catch (Exception e) {
|
||||
slf4jLogger.error("BallAPI 初始化失败", e);
|
||||
@@ -92,7 +92,7 @@ public class HamsterBallPlugin {
|
||||
long start = System.currentTimeMillis();
|
||||
slf4jLogger.info("仓鼠球正在启动");
|
||||
try {
|
||||
CoreVelocityAPI.getInstance().enable();
|
||||
BallVelocityAPI.getInstance().enable();
|
||||
} catch (Exception e) {
|
||||
slf4jLogger.error("仓鼠球启动失败", e);
|
||||
slf4jLogger.info("由于仓鼠球启动失败,服务器将立即关闭");
|
||||
@@ -144,7 +144,7 @@ public class HamsterBallPlugin {
|
||||
long start = System.currentTimeMillis();
|
||||
slf4jLogger.info("仓鼠球正在关闭");
|
||||
try {
|
||||
CoreVelocityAPI.getInstance().disable();
|
||||
BallVelocityAPI.getInstance().disable();
|
||||
} catch (Exception e) {
|
||||
slf4jLogger.error("关闭仓鼠球时遇到了一个异常", e);
|
||||
}
|
||||
|
@@ -13,20 +13,20 @@ import java.sql.SQLException;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class CoreVelocityAPI extends BallAPI {
|
||||
public CoreVelocityAPI(@NotNull ConfigSection config) {
|
||||
public final class BallVelocityAPI extends BallAPI {
|
||||
public BallVelocityAPI(@NotNull ConfigSection config) {
|
||||
super(config, BallServerType.PROXY);
|
||||
}
|
||||
|
||||
public static CoreVelocityAPI getInstance() {
|
||||
return (CoreVelocityAPI) instance;
|
||||
public static BallVelocityAPI getInstance() {
|
||||
return (BallVelocityAPI) instance;
|
||||
}
|
||||
|
||||
public static void init(@NotNull YamlConfig config) {
|
||||
if (instance != null) {
|
||||
return;
|
||||
}
|
||||
instance = new CoreVelocityAPI(config);
|
||||
instance = new BallVelocityAPI(config);
|
||||
}
|
||||
|
||||
@Override
|
Reference in New Issue
Block a user