mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-22 16:38:20 +01:00
Add new PROFILE_ACTIONS_ENUM type in Types for 1.21.2+
This commit is contained in:
parent
4573035aab
commit
e38b3f3824
@ -189,7 +189,9 @@ public final class Types {
|
||||
public static final Type<PlayerMessageSignature> OPTIONAL_PLAYER_MESSAGE_SIGNATURE = new PlayerMessageSignatureType.OptionalPlayerMessageSignatureType();
|
||||
public static final Type<PlayerMessageSignature[]> PLAYER_MESSAGE_SIGNATURE_ARRAY = new ArrayType<>(PLAYER_MESSAGE_SIGNATURE);
|
||||
|
||||
public static final BitSetType PROFILE_ACTIONS_ENUM = new BitSetType(6);
|
||||
public static final BitSetType PROFILE_ACTIONS_ENUM1_19_3 = new BitSetType(6);
|
||||
public static final BitSetType PROFILE_ACTIONS_ENUM1_21_2 = new BitSetType(7);
|
||||
|
||||
public static final ByteArrayType SIGNATURE_BYTES = new ByteArrayType(256);
|
||||
public static final BitSetType ACKNOWLEDGED_BIT_SET = new BitSetType(20);
|
||||
public static final ByteArrayType.OptionalByteArrayType OPTIONAL_SIGNATURE_BYTES = new ByteArrayType.OptionalByteArrayType(256);
|
||||
|
@ -116,7 +116,7 @@ public final class EntityPacketRewriter1_19_3 extends EntityRewriter<Clientbound
|
||||
set.set(action == 1 ? action + 1 : action + 2);
|
||||
}
|
||||
|
||||
wrapper.write(Types.PROFILE_ACTIONS_ENUM, set);
|
||||
wrapper.write(Types.PROFILE_ACTIONS_ENUM1_19_3, set);
|
||||
final int entries = wrapper.passthrough(Types.VAR_INT);
|
||||
for (int i = 0; i < entries; i++) {
|
||||
wrapper.passthrough(Types.UUID); // UUID
|
||||
|
@ -268,7 +268,7 @@ public final class Protocol1_20_2To1_20_3 extends AbstractProtocol<ClientboundPa
|
||||
}
|
||||
});
|
||||
registerClientbound(ClientboundPackets1_20_2.PLAYER_INFO_UPDATE, wrapper -> {
|
||||
final BitSet actions = wrapper.passthrough(Types.PROFILE_ACTIONS_ENUM);
|
||||
final BitSet actions = wrapper.passthrough(Types.PROFILE_ACTIONS_ENUM1_19_3);
|
||||
final int entries = wrapper.passthrough(Types.VAR_INT);
|
||||
for (int i = 0; i < entries; i++) {
|
||||
wrapper.passthrough(Types.UUID);
|
||||
|
@ -142,7 +142,7 @@ public class ComponentRewriter<C extends ClientboundPacketType> implements com.v
|
||||
|
||||
public void registerPlayerInfoUpdate1_20_3(final C packetType) {
|
||||
protocol.registerClientbound(packetType, wrapper -> {
|
||||
final BitSet actions = wrapper.passthrough(Types.PROFILE_ACTIONS_ENUM);
|
||||
final BitSet actions = wrapper.passthrough(Types.PROFILE_ACTIONS_ENUM1_19_3);
|
||||
if (!actions.get(5)) { // Update display name
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user