misc: Some minor improvements

This commit is contained in:
4drian3d 2022-07-12 16:11:36 +00:00
parent cc3803307e
commit 01b41e47ae
3 changed files with 13 additions and 11 deletions

View File

@ -25,8 +25,8 @@ public class AuthMeListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST)
public void onLogin(LoginEvent event) {
final Player player = event.getPlayer();
PreSendLoginEvent preSendLoginEvent = new PreSendLoginEvent(player);
if(preSendLoginEvent.callEvent()){
if (new PreSendLoginEvent(player).callEvent()) {
plugin.sendMessageToProxy(player, MessageType.LOGIN, player.getName());
}
}

View File

@ -13,7 +13,10 @@ public class MessageListener implements PluginMessageListener {
@Override
public void onPluginMessageReceived(@NotNull String identifier, @NotNull Player player, @NotNull byte[] bytes) {
if(identifier.equals("authmevelocity")){
if (!identifier.equals("authmevelocity")) {
return;
}
ByteArrayDataInput input = ByteStreams.newDataInput(bytes);
String subchannel = input.readUTF();
if ("main".equals(subchannel)) {
@ -24,4 +27,3 @@ public class MessageListener implements PluginMessageListener {
}
}
}
}