feat: 支持仓鼠球 1.5+

This commit is contained in:
2024-03-11 19:36:44 +08:00
commit debdcb40e0
45 changed files with 3525 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
package cn.hamster3.service.bungee.event;
import net.md_5.bungee.api.plugin.Event;
/**
* 服务连接事件
*/
@SuppressWarnings("unused")
public class ServiceConnectEvent extends Event {
private final boolean success;
private final Throwable cause;
public ServiceConnectEvent() {
success = true;
cause = null;
}
public ServiceConnectEvent(Throwable cause) {
success = false;
this.cause = cause;
}
/**
* 是否成功连接到服务中心
*
* @return true代表成功
*/
public boolean isSuccess() {
return success;
}
/**
* 如果连接失败了,则返回失败原因
* <p>
* 如果连接成功了则返回null
*
* @return 失败原因
*/
public Throwable getCause() {
return cause;
}
}