feat: 添加管理员指令

This commit is contained in:
2024-08-08 04:46:07 +08:00
parent 518517a4e0
commit 4d3d93887d
14 changed files with 92 additions and 68 deletions

View File

@@ -100,8 +100,8 @@ public class HamsterBallPlugin {
return;
}
CommandMeta commandMeta = proxyServer.getCommandManager()
.metaBuilder("hamster-ball")
.aliases("ball")
.metaBuilder("hamster-velocity-ball")
.aliases("velocity-ball", "vball")
.plugin(this)
.build();
proxyServer.getCommandManager().register(commandMeta, VelocityBallCommand.INSTANCE);

View File

@@ -1,7 +1,6 @@
package cn.hamster3.mc.plugin.ball.velocity.listener;
import cn.hamster3.mc.plugin.ball.common.api.BallAPI;
import cn.hamster3.mc.plugin.ball.common.entity.BallServerType;
import cn.hamster3.mc.plugin.ball.common.event.operate.*;
import cn.hamster3.mc.plugin.ball.velocity.HamsterBallPlugin;
import cn.hamster3.mc.plugin.core.common.api.CoreAPI;
@@ -23,9 +22,6 @@ public class BallVelocityListener {
@Subscribe
public void onDispatchConsoleCommand(DispatchConsoleCommandEvent event) {
if (event.getType() != null && event.getType() != BallServerType.PROXY) {
return;
}
if (event.getServerID() != null && !BallAPI.getInstance().isLocalServer(event.getServerID())) {
return;
}
@@ -35,9 +31,6 @@ public class BallVelocityListener {
@Subscribe
public void onDispatchPlayerCommand(DispatchPlayerCommandEvent event) {
if (event.getType() != null && event.getType() != BallServerType.GAME) {
return;
}
ProxyServer server = HamsterBallPlugin.getInstance().getProxyServer();
if (event.getUuid() != null) {
Player player = server.getPlayer(event.getUuid()).orElse(null);