mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-25 12:25:22 +01:00
Updated Via API usage
This commit is contained in:
parent
533c0844ef
commit
c3b079a055
@ -47,10 +47,10 @@ public class ClassicWorldHeightInjection {
|
||||
if (wrapper.isCancelled()) return;
|
||||
|
||||
if (ProtocolHack.getTargetVersion(wrapper.user().getChannel()).isOlderThanOrEqualTo(VersionEnum.c0_28toc0_30)) {
|
||||
for (Tag dimension : wrapper.get(Type.NBT, 0).<CompoundTag>get("minecraft:dimension_type").<ListTag>get("value")) {
|
||||
for (Tag dimension : wrapper.get(Type.NAMED_COMPOUND_TAG, 0).<CompoundTag>get("minecraft:dimension_type").<ListTag>get("value")) {
|
||||
changeDimensionTagHeight(wrapper.user(), ((CompoundTag) dimension).get("element"));
|
||||
}
|
||||
changeDimensionTagHeight(wrapper.user(), wrapper.get(Type.NBT, 1));
|
||||
changeDimensionTagHeight(wrapper.user(), wrapper.get(Type.NAMED_COMPOUND_TAG, 1));
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -61,7 +61,7 @@ public class ClassicWorldHeightInjection {
|
||||
if (wrapper.isCancelled()) return;
|
||||
|
||||
if (ProtocolHack.getTargetVersion(wrapper.user().getChannel()).isOlderThanOrEqualTo(VersionEnum.c0_28toc0_30)) {
|
||||
changeDimensionTagHeight(wrapper.user(), wrapper.get(Type.NBT, 0));
|
||||
changeDimensionTagHeight(wrapper.user(), wrapper.get(Type.NAMED_COMPOUND_TAG, 0));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -49,12 +49,6 @@ import java.util.UUID;
|
||||
@Mixin(value = Protocol1_19_3To1_19_1.class, remap = false)
|
||||
public class MixinProtocol1_19_3To1_19_1 extends AbstractProtocol<ClientboundPackets1_19_1, ClientboundPackets1_19_3, ServerboundPackets1_19_1, ServerboundPackets1_19_3> {
|
||||
|
||||
@Unique
|
||||
private final static ByteArrayType.OptionalByteArrayType OPTIONAL_MESSAGE_SIGNATURE_BYTES_TYPE = new ByteArrayType.OptionalByteArrayType(256);
|
||||
|
||||
@Unique
|
||||
private final static ByteArrayType MESSAGE_SIGNATURE_BYTES_TYPE = new ByteArrayType(256);
|
||||
|
||||
@Unique
|
||||
private final static BitSetType ACKNOWLEDGED_BIT_SET_TYPE = new BitSetType(20);
|
||||
|
||||
@ -125,12 +119,12 @@ public class MixinProtocol1_19_3To1_19_1 extends AbstractProtocol<ClientboundPac
|
||||
for (int i = 0; i < signatures; i++) {
|
||||
if (signingEnabled) {
|
||||
wrapper.read(Type.STRING); // Argument name
|
||||
wrapper.read(MESSAGE_SIGNATURE_BYTES_TYPE); // Signature
|
||||
wrapper.read(Type.SIGNATURE_BYTES); // Signature
|
||||
} else {
|
||||
wrapper.passthrough(Type.STRING); // Argument name
|
||||
|
||||
// Signature
|
||||
wrapper.read(MESSAGE_SIGNATURE_BYTES_TYPE);
|
||||
wrapper.read(Type.SIGNATURE_BYTES);
|
||||
wrapper.write(Type.BYTE_ARRAY_PRIMITIVE, new byte[0]);
|
||||
}
|
||||
}
|
||||
@ -169,7 +163,7 @@ public class MixinProtocol1_19_3To1_19_1 extends AbstractProtocol<ClientboundPac
|
||||
map(Type.STRING); // Command
|
||||
map(Type.LONG); // Timestamp
|
||||
map(Type.LONG); // Salt
|
||||
read(OPTIONAL_MESSAGE_SIGNATURE_BYTES_TYPE); // Signature
|
||||
read(Type.OPTIONAL_SIGNATURE_BYTES); // Signature
|
||||
handler(wrapper -> {
|
||||
final ChatSession1_19_2 chatSession1192 = wrapper.user().get(ChatSession1_19_2.class);
|
||||
final ReceivedMessagesStorage messagesStorage = wrapper.user().get(ReceivedMessagesStorage.class);
|
||||
|
Loading…
Reference in New Issue
Block a user