Fix possible error with sending plugin message without a player name

This commit is contained in:
ajgeiss0702
2023-03-11 10:25:49 -07:00
parent 5343a31683
commit a0f5903862
3 changed files with 8 additions and 3 deletions
@@ -41,8 +41,10 @@ public class VelocityMethods implements PlatformMethods {
if(player == null) return;
Player velocityPlayer = ((VelocityPlayer) player).getHandle();
@SuppressWarnings("UnstableApiUsage") ByteArrayDataOutput out = ByteStreams.newDataOutput();
String playerName = player.getName();
if(playerName == null) return;
out.writeUTF( channel );
out.writeUTF(player.getName());
out.writeUTF(playerName);
for(String s : data) {
out.writeUTF( s );
}