perf: 优化性能
This commit is contained in:
@@ -5,12 +5,10 @@ import cn.hamster3.mc.plugin.ball.bukkit.data.BukkitLocation;
|
||||
import cn.hamster3.mc.plugin.ball.common.api.BallAPI;
|
||||
import cn.hamster3.mc.plugin.ball.common.data.BallMessageInfo;
|
||||
import cn.hamster3.mc.plugin.ball.common.entity.BallServerType;
|
||||
import cn.hamster3.mc.plugin.ball.common.event.operate.DispatchConsoleCommandEvent;
|
||||
import cn.hamster3.mc.plugin.ball.common.event.operate.DispatchPlayerCommandEvent;
|
||||
import cn.hamster3.mc.plugin.ball.common.event.operate.SendPlayerToLocationEvent;
|
||||
import cn.hamster3.mc.plugin.ball.common.event.operate.SendPlayerToPlayerEvent;
|
||||
import cn.hamster3.mc.plugin.ball.common.event.operate.*;
|
||||
import cn.hamster3.mc.plugin.ball.common.listener.BallListener;
|
||||
import cn.hamster3.mc.plugin.core.bukkit.api.CoreBukkitAPI;
|
||||
import cn.hamster3.mc.plugin.core.common.api.CoreAPI;
|
||||
import cn.hamster3.mc.plugin.core.common.constant.CoreConstantObjects;
|
||||
import cn.hamster3.mc.plugin.core.common.data.DisplayMessage;
|
||||
import cn.hamster3.mc.plugin.core.common.util.Pair;
|
||||
@@ -44,6 +42,13 @@ public class BallBukkitListener implements Listener, BallListener {
|
||||
@Override
|
||||
public void onMessageReceived(@NotNull BallMessageInfo info) {
|
||||
switch (info.getAction()) {
|
||||
case BroadcastPlayerMessageEvent.ACTION: {
|
||||
BroadcastPlayerMessageEvent event = CoreConstantObjects.GSON.fromJson(info.getContent(), BroadcastPlayerMessageEvent.class);
|
||||
DisplayMessage message = event.getMessage();
|
||||
Audience audience = CoreAPI.getInstance().getAudienceProvider().all();
|
||||
message.show(audience);
|
||||
break;
|
||||
}
|
||||
case DispatchConsoleCommandEvent.ACTION: {
|
||||
DispatchConsoleCommandEvent event = CoreConstantObjects.GSON.fromJson(info.getContent(), DispatchConsoleCommandEvent.class);
|
||||
if (event.getType() != null && event.getType() != BallServerType.GAME) {
|
||||
|
Reference in New Issue
Block a user