mirror of
https://github.com/lucko/LuckPerms.git
synced 2025-08-31 01:59:48 +02:00
Only form data buf once in Bukkit PluginMessage messenger
This commit is contained in:
@@ -69,6 +69,10 @@ public class PluginMessageMessenger implements Messenger, PluginMessageListener
|
||||
|
||||
@Override
|
||||
public void sendOutgoingMessage(@NonNull OutgoingMessage outgoingMessage) {
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeUTF(outgoingMessage.asEncodedString());
|
||||
byte[] data = out.toByteArray();
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -78,11 +82,6 @@ public class PluginMessageMessenger implements Messenger, PluginMessageListener
|
||||
return;
|
||||
}
|
||||
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeUTF(outgoingMessage.asEncodedString());
|
||||
|
||||
byte[] data = out.toByteArray();
|
||||
|
||||
p.sendPluginMessage(PluginMessageMessenger.this.plugin.getBootstrap(), CHANNEL, data);
|
||||
cancel();
|
||||
}
|
||||
|
Reference in New Issue
Block a user