Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-24 23:30:22 +01:00
Use the correct plugin message packet. Thanks, Camo
Dieser Commit ist enthalten in:
Ursprung
db583135eb
Commit
209a4ffc42
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
package org.geysermc.connector.utils;
|
package org.geysermc.connector.utils;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.packet.ingame.server.ServerPluginMessagePacket;
|
import com.github.steveice10.mc.protocol.packet.ingame.client.ClientPluginMessagePacket;
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
import org.geysermc.connector.GeyserConnector;
|
import org.geysermc.connector.GeyserConnector;
|
||||||
import org.geysermc.connector.network.session.GeyserSession;
|
import org.geysermc.connector.network.session.GeyserSession;
|
||||||
@ -74,12 +74,7 @@ public class PluginMessageUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void sendMessage(GeyserSession session, String channel, byte[] data) {
|
public static void sendMessage(GeyserSession session, String channel, byte[] data) {
|
||||||
byte[] finalData =
|
session.sendDownstreamPacket(new ClientPluginMessagePacket(channel, data));
|
||||||
ByteBuffer.allocate(data.length + getVarIntLength(data.length))
|
|
||||||
.put(writeVarInt(data.length))
|
|
||||||
.put(data)
|
|
||||||
.array();
|
|
||||||
session.sendDownstreamPacket(new ServerPluginMessagePacket(channel, finalData));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static byte[] writeVarInt(int value) {
|
private static byte[] writeVarInt(int value) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren