diff options
author | Jake Potrebic <[email protected]> | 2024-12-18 18:54:31 -0800 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-12-18 18:54:31 -0800 |
commit | 15ad7cc156039cbcb2b3db0b861eb2d68c1e79a9 (patch) | |
tree | 30d08334f87cc2a37ca2bd7f7a4fa9519b8158c5 /paper-server | |
parent | 49f715fdda850619be57eeb621d9d80d7a3086c4 (diff) | |
download | Paper-15ad7cc156039cbcb2b3db0b861eb2d68c1e79a9.tar.gz Paper-15ad7cc156039cbcb2b3db0b861eb2d68c1e79a9.zip |
improve comment and better local var name
Diffstat (limited to 'paper-server')
-rw-r--r-- | paper-server/patches/sources/net/minecraft/core/Holder.java.patch | 2 | ||||
-rw-r--r-- | paper-server/patches/sources/net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket.java.patch | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/paper-server/patches/sources/net/minecraft/core/Holder.java.patch b/paper-server/patches/sources/net/minecraft/core/Holder.java.patch index 51a81bf5f3..c1d6d57ceb 100644 --- a/paper-server/patches/sources/net/minecraft/core/Holder.java.patch +++ b/paper-server/patches/sources/net/minecraft/core/Holder.java.patch @@ -5,7 +5,7 @@ void bindTags(Collection<TagKey<T>> tags) { - this.tags = Set.copyOf(tags); -+ this.tags = java.util.Collections.unmodifiableSet(new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(tags)); // Paper ++ this.tags = it.unimi.dsi.fastutil.objects.ReferenceSets.unmodifiable(new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(tags)); // Paper - use reference set because TagKey are interned } @Override diff --git a/paper-server/patches/sources/net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket.java.patch b/paper-server/patches/sources/net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket.java.patch index 9596254f44..40b8fdbc78 100644 --- a/paper-server/patches/sources/net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket.java.patch +++ b/paper-server/patches/sources/net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket.java.patch @@ -7,9 +7,9 @@ - return readUnknownPayload(buffer); + // Paper start - MC Utils - default query payloads + FriendlyByteBuf buf = buffer.readNullable((buf2) -> { -+ int i = buf2.readableBytes(); -+ if (i >= 0 && i <= MAX_PAYLOAD_SIZE) { -+ return new FriendlyByteBuf(buf2.readBytes(i)); ++ int readableBytes = buf2.readableBytes(); ++ if (readableBytes >= 0 && readableBytes <= MAX_PAYLOAD_SIZE) { ++ return new FriendlyByteBuf(buf2.readBytes(readableBytes)); + } else { + throw new IllegalArgumentException("Payload may not be larger than " + MAX_PAYLOAD_SIZE + " bytes"); + } |