feat(hamster-ball-bridge): 支持新版仓鼠球
This commit is contained in:
@@ -2,5 +2,5 @@ org.gradle.jvmargs=-Xmx2G
|
|||||||
spigot_api_version=1.20.2-R0.1-SNAPSHOT
|
spigot_api_version=1.20.2-R0.1-SNAPSHOT
|
||||||
bungeecord_api_version=1.20-R0.1-SNAPSHOT
|
bungeecord_api_version=1.20-R0.1-SNAPSHOT
|
||||||
hamster_core_version=1.1.0
|
hamster_core_version=1.1.0
|
||||||
hamster_ball_version=1.3.0
|
hamster_ball_version=1.4.1
|
||||||
placeholder_api_version=2.11.2
|
placeholder_api_version=2.11.2
|
@@ -1,4 +1,4 @@
|
|||||||
version = '1.4.1'
|
version = '1.4.2'
|
||||||
setArchivesBaseName("HamsterBall-Bridge")
|
setArchivesBaseName("HamsterBall-Bridge")
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@@ -35,6 +35,6 @@ public class BallBridgePlugin extends JavaPlugin {
|
|||||||
getLogger().warning("未找到 PlaceholderAPI 插件, 取消注册占位符.");
|
getLogger().warning("未找到 PlaceholderAPI 插件, 取消注册占位符.");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
BallAPI.getInstance().subscribe("HamsterService");
|
BallAPI.getInstance().getSubConnection().sync().subscribe("HamsterService");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ public abstract class ServiceMessageAPI {
|
|||||||
* @param tag 标签
|
* @param tag 标签
|
||||||
*/
|
*/
|
||||||
public static void subscribeTag(String tag) {
|
public static void subscribeTag(String tag) {
|
||||||
BallAPI.getInstance().subscribe(tag);
|
BallAPI.getInstance().getSubConnection().sync().subscribe(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,7 +36,7 @@ public abstract class ServiceMessageAPI {
|
|||||||
* @param tag 标签
|
* @param tag 标签
|
||||||
*/
|
*/
|
||||||
public static void unsubscribeTag(String tag) {
|
public static void unsubscribeTag(String tag) {
|
||||||
BallAPI.getInstance().unsubscribe(tag);
|
BallAPI.getInstance().getSubConnection().sync().unsubscribe(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -46,7 +46,7 @@ public abstract class ServiceMessageAPI {
|
|||||||
* @param action 执行动作
|
* @param action 执行动作
|
||||||
*/
|
*/
|
||||||
public static void sendServiceMessage(String tag, String action) {
|
public static void sendServiceMessage(String tag, String action) {
|
||||||
BallAPI.getInstance().sendBallMessage(tag, action);
|
BallAPI.getInstance().sendBallMessage(tag, action, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -57,7 +57,7 @@ public abstract class ServiceMessageAPI {
|
|||||||
* @param content 附加参数
|
* @param content 附加参数
|
||||||
*/
|
*/
|
||||||
public static void sendServiceMessage(String tag, String action, String content) {
|
public static void sendServiceMessage(String tag, String action, String content) {
|
||||||
BallAPI.getInstance().sendBallMessage(tag, action, content);
|
BallAPI.getInstance().sendBallMessage(tag, action, content, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -70,7 +70,7 @@ public abstract class ServiceMessageAPI {
|
|||||||
* @see String#format(String, Object...)
|
* @see String#format(String, Object...)
|
||||||
*/
|
*/
|
||||||
public static void sendServiceMessage(String tag, String action, String content, Object... args) {
|
public static void sendServiceMessage(String tag, String action, String content, Object... args) {
|
||||||
BallAPI.getInstance().sendBallMessage(tag, action, new JsonPrimitive(String.format(content, args)));
|
BallAPI.getInstance().sendBallMessage(tag, action, String.format(content, args), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,7 +81,7 @@ public abstract class ServiceMessageAPI {
|
|||||||
* @param content 附加参数
|
* @param content 附加参数
|
||||||
*/
|
*/
|
||||||
public static void sendServiceMessage(String tag, String action, JsonElement content) {
|
public static void sendServiceMessage(String tag, String action, JsonElement content) {
|
||||||
BallAPI.getInstance().sendBallMessage(tag, new BallMessage(action, content), false);
|
BallAPI.getInstance().sendBallMessage(tag, new BallMessage(action, content), false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,7 +98,7 @@ public abstract class ServiceMessageAPI {
|
|||||||
info.getAction(),
|
info.getAction(),
|
||||||
info.getContent()
|
info.getContent()
|
||||||
);
|
);
|
||||||
BallAPI.getInstance().sendBallMessage(info.getTag(), message, block);
|
BallAPI.getInstance().sendBallMessage(info.getTag(), message, false, block);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -22,6 +22,6 @@ public class BallBridgePlugin extends Plugin {
|
|||||||
BallAPI.getInstance().getEventBus().register(BridgeListener.INSTANCE);
|
BallAPI.getInstance().getEventBus().register(BridgeListener.INSTANCE);
|
||||||
ProxyServer.getInstance().getPluginManager().registerListener(this, ServiceMainListener.INSTANCE);
|
ProxyServer.getInstance().getPluginManager().registerListener(this, ServiceMainListener.INSTANCE);
|
||||||
ProxyServer.getInstance().getPluginManager().registerCommand(this, ServiceCommand.INSTANCE);
|
ProxyServer.getInstance().getPluginManager().registerCommand(this, ServiceCommand.INSTANCE);
|
||||||
BallAPI.getInstance().subscribe("HamsterService");
|
BallAPI.getInstance().getSubConnection().sync().subscribe("HamsterService");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user