p a t c h e s

This commit is contained in:
Jason Penilla
2021-11-24 03:06:34 -08:00
parent 70bec0e28e
commit 3b7830d806
18 changed files with 96 additions and 2136 deletions

View File

@@ -1957,6 +1957,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+package com.destroystokyo.paper.util.set;
+
+import java.util.Collection;
+import java.util.function.Consumer;
+import java.util.function.Predicate;
+
+/**
+ * @author Spottedleaf <Spottedleaf@users.noreply.github.com>
@@ -2020,6 +2022,29 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public boolean hasCommonElements(final OptimizedSmallEnumSet<E> other) {
+ return (other.backingSet & this.backingSet) != 0;
+ }
+
+ public void forEach(final E[] values, final Consumer<E> action) {
+ long iterator = this.getBackingSet();
+ int wrappedGoalSize = this.size();
+ for (int i = 0; i < wrappedGoalSize; ++i) {
+ final E type = values[Long.numberOfTrailingZeros(iterator)];
+ iterator ^= io.papermc.paper.util.IntegerUtil.getTrailingBit(iterator);
+ action.accept(type);
+ }
+ }
+
+ public boolean anyMatch(final E[] values, final Predicate<E> predicate) {
+ long iterator = this.getBackingSet();
+ int wrappedGoalSize = this.size();
+ for (int i = 0; i < wrappedGoalSize; ++i) {
+ final E type = values[Long.numberOfTrailingZeros(iterator)];
+ iterator ^= io.papermc.paper.util.IntegerUtil.getTrailingBit(iterator);
+ if (predicate.test(type)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/io/papermc/paper/chunk/SingleThreadChunkRegionManager.java b/src/main/java/io/papermc/paper/chunk/SingleThreadChunkRegionManager.java
new file mode 100644