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