Cache resource keys and optimize reference Holder tags set
TagKeys are always interned, so we can use a reference hash set for them
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/core/Holder.java
|
||||
+++ b/net/minecraft/core/Holder.java
|
||||
@@ -230,7 +230,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
|
||||
}
|
||||
|
||||
@Override
|
||||
Reference in New Issue
Block a user