mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
improve comment and better local var name
This commit is contained in:
parent
49f715fdda
commit
15ad7cc156
2 changed files with 4 additions and 4 deletions
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
void bindTags(Collection<TagKey<T>> tags) {
|
void bindTags(Collection<TagKey<T>> tags) {
|
||||||
- this.tags = Set.copyOf(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
|
@Override
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
- return readUnknownPayload(buffer);
|
- return readUnknownPayload(buffer);
|
||||||
+ // Paper start - MC Utils - default query payloads
|
+ // Paper start - MC Utils - default query payloads
|
||||||
+ FriendlyByteBuf buf = buffer.readNullable((buf2) -> {
|
+ FriendlyByteBuf buf = buffer.readNullable((buf2) -> {
|
||||||
+ int i = buf2.readableBytes();
|
+ int readableBytes = buf2.readableBytes();
|
||||||
+ if (i >= 0 && i <= MAX_PAYLOAD_SIZE) {
|
+ if (readableBytes >= 0 && readableBytes <= MAX_PAYLOAD_SIZE) {
|
||||||
+ return new FriendlyByteBuf(buf2.readBytes(i));
|
+ return new FriendlyByteBuf(buf2.readBytes(readableBytes));
|
||||||
+ } else {
|
+ } else {
|
||||||
+ throw new IllegalArgumentException("Payload may not be larger than " + MAX_PAYLOAD_SIZE + " bytes");
|
+ throw new IllegalArgumentException("Payload may not be larger than " + MAX_PAYLOAD_SIZE + " bytes");
|
||||||
+ }
|
+ }
|
||||||
|
|
Loading…
Reference in a new issue