Skip to content

Commit

Permalink
Updated Via API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Oct 7, 2023
1 parent 533c084 commit c3b079a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public static PacketHandler handleJoinGame(final PacketHandler parentHandler) {
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));
}
};
}
Expand All @@ -61,7 +61,7 @@ public static PacketHandler handleRespawn(final PacketHandler parentHandler) {
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));
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@
@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);

Expand Down Expand Up @@ -125,12 +119,12 @@ public void register() {
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]);
}
}
Expand Down Expand Up @@ -169,7 +163,7 @@ public void register() {
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);
Expand Down

0 comments on commit c3b079a

Please sign in to comment.