+10
-3
@@ -20,7 +20,6 @@
|
|||||||
package com.velocitypowered.proxy.protocol.packet;
|
package com.velocitypowered.proxy.protocol.packet;
|
||||||
|
|
||||||
import com.velocitypowered.api.network.ProtocolVersion;
|
import com.velocitypowered.api.network.ProtocolVersion;
|
||||||
import com.velocitypowered.api.proxy.Player;
|
|
||||||
import com.velocitypowered.proxy.connection.MinecraftSessionHandler;
|
import com.velocitypowered.proxy.connection.MinecraftSessionHandler;
|
||||||
import com.velocitypowered.proxy.protocol.MinecraftPacket;
|
import com.velocitypowered.proxy.protocol.MinecraftPacket;
|
||||||
import com.velocitypowered.proxy.protocol.ProtocolUtils;
|
import com.velocitypowered.proxy.protocol.ProtocolUtils;
|
||||||
@@ -75,6 +74,8 @@ public class UpdateTeamsPacket implements MinecraftPacket {
|
|||||||
ProtocolUtils.writeString(byteBuf, name);
|
ProtocolUtils.writeString(byteBuf, name);
|
||||||
byteBuf.writeByte(mode.ordinal());
|
byteBuf.writeByte(mode.ordinal());
|
||||||
|
|
||||||
|
ProtocolUtils.writeString(byteBuf, name);
|
||||||
|
byteBuf.writeByte(mode.ordinal());
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case CREATE, UPDATE:
|
case CREATE, UPDATE:
|
||||||
new ComponentHolder(protocolVersion, displayName).write(byteBuf);
|
new ComponentHolder(protocolVersion, displayName).write(byteBuf);
|
||||||
@@ -82,9 +83,15 @@ public class UpdateTeamsPacket implements MinecraftPacket {
|
|||||||
new ComponentHolder(protocolVersion, prefix).write(byteBuf);
|
new ComponentHolder(protocolVersion, prefix).write(byteBuf);
|
||||||
new ComponentHolder(protocolVersion, suffix).write(byteBuf);
|
new ComponentHolder(protocolVersion, suffix).write(byteBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
byteBuf.writeByte(friendlyFlags);
|
byteBuf.writeByte(friendlyFlags);
|
||||||
ProtocolUtils.writeString(byteBuf, nameTagVisibility.getValue());
|
if (protocolVersion.noLessThan(ProtocolVersion.MINECRAFT_1_21_5)) {
|
||||||
ProtocolUtils.writeString(byteBuf, collisionRule.getValue());
|
ProtocolUtils.writeVarInt(byteBuf, nameTagVisibility.ordinal());
|
||||||
|
ProtocolUtils.writeVarInt(byteBuf, collisionRule.ordinal());
|
||||||
|
} else {
|
||||||
|
ProtocolUtils.writeString(byteBuf, nameTagVisibility.getValue());
|
||||||
|
ProtocolUtils.writeString(byteBuf, collisionRule.getValue());
|
||||||
|
}
|
||||||
if (protocolVersion.greaterThan(ProtocolVersion.MINECRAFT_1_12_2)) {
|
if (protocolVersion.greaterThan(ProtocolVersion.MINECRAFT_1_12_2)) {
|
||||||
ProtocolUtils.writeVarInt(byteBuf, color);
|
ProtocolUtils.writeVarInt(byteBuf, color);
|
||||||
new ComponentHolder(protocolVersion, prefix).write(byteBuf);
|
new ComponentHolder(protocolVersion, prefix).write(byteBuf);
|
||||||
|
|||||||
Reference in New Issue
Block a user