+ * Partly forked from Lucene tag releases/lucene-solr/8.5.1
+ */
+public interface Accountable {
+ /**
+ * Allocated memory estimation
+ *
+ * @return Ram allocated in bytes
+ */
+ long ramBytesAllocated();
+
+ /**
+ * Bytes that is actually been used
+ *
+ * @return Ram used in bytes
+ */
+ long ramBytesUsed();
+}
diff --git a/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/HPPC.java b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/HPPC.java
new file mode 100644
index 0000000..ef2bee9
--- /dev/null
+++ b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/HPPC.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2025 lax1dude. All Rights Reserved.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+package net.lax1dude.eaglercraft.backend.server.api.collect;
+
+import javax.annotation.Nonnull;
+
+public interface HPPC {
+
+ int getDefaultExpectedElements();
+
+ @Nonnull
+ IntIndexedContainer createIntArrayList();
+
+ @Nonnull
+ IntIndexedContainer createIntArrayList(int expectedElements);
+
+ @Nonnull
+ IntIndexedContainer createIntArrayList(@Nonnull IntContainer source);
+
+ @Nonnull
+ IntSet createIntHashSet();
+
+ @Nonnull
+ IntSet createIntHashSet(int expectedElements);
+
+ @Nonnull
+ IntSet createIntHashSet(@Nonnull IntContainer source);
+
+ @Nonnull
+
+ * The iterator is implemented as a cursor and it returns the same cursor
+ * instance on every call to {@link Iterator#next()} (to avoid boxing of
+ * primitive types). To read the current list's value (or index in the list) use
+ * the cursor's public fields. An example is shown below.
+ *
+ *
+ * The returned array is always a copy, regardless of the storage used by the
+ * container.
+ */
+ public int[] toArray();
+
+ /**
+ * Applies a
+ * The
+ * The iteration is continued as long as the predicate returns
+ *
+ * The semantics of "indexes" are not strictly defined. Indexes may (and
+ * typically won't be) contiguous.
+ *
+ *
+ * The index is valid only between map modifications (it will not be affected by
+ * read-only operations like iteration or value retrievals).
+ *
+ * @see #indexExists
+ * @see #indexGet
+ * @see #indexInsert
+ * @see #indexReplace
+ * @param key The key to locate in the map.
+ * @return A non-negative value of the logical "index" of the key in the map or
+ * a negative value if the key did not exist.
+ */
+ public int indexOf(int key);
+
+ /**
+ * @see #indexOf
+ * @param index The index of a given key, as returned from {@link #indexOf}.
+ * @return Returns
+ * The e from this collection.
+ *
+ * @param e Element to be removed from this collection, if present.
+ * @return The number of removed elements as a result of this call.
+ */
+ public int removeAll(int e);
+
+ /**
+ * Removes all elements in this collection that are present in c.
+ *
+ * @return Returns the number of removed elements.
+ */
+ public int removeAll(IntLookupContainer c);
+
+ /**
+ * Removes all elements in this collection for which the given predicate returns
+ * true .
+ *
+ * @return Returns the number of removed elements.
+ */
+ public int removeAll(IntPredicate predicate);
+
+ /**
+ * Keeps all elements in this collection that are present in c.
+ * Runs in time proportional to the number of elements in this collection.
+ * Equivalent of sets intersection.
+ *
+ * @return Returns the number of removed elements.
+ */
+ public int retainAll(IntLookupContainer c);
+
+ /**
+ * Keeps all elements in this collection for which the given predicate returns
+ * true.
+ *
+ * @return Returns the number of removed elements.
+ */
+ public int retainAll(IntPredicate predicate);
+
+ /**
+ * Removes all elements from this collection.
+ *
+ * @see #release()
+ */
+ public void clear();
+
+ /**
+ * Removes all elements from the collection and additionally releases any
+ * internal buffers. Typically, if the object is to be reused, a simple
+ * {@link #clear()} should be a better alternative since it'll avoid
+ * reallocation.
+ *
+ * @see #clear()
+ */
+ public void release();
+}
diff --git a/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntContainer.java b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntContainer.java
new file mode 100644
index 0000000..5607942
--- /dev/null
+++ b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntContainer.java
@@ -0,0 +1,89 @@
+/*
+ * HPPC
+ *
+ * Copyright (C) 2010-2024 Carrot Search s.c. and contributors
+ * All rights reserved.
+ *
+ * Refer to the full license file "LICENSE.txt":
+ * https://github.com/carrotsearch/hppc/blob/master/LICENSE.txt
+ */
+package net.lax1dude.eaglercraft.backend.server.api.collect;
+
+import java.util.Iterator;
+
+/** A generic container holding ints. */
+public interface IntContainer extends Iterable
+ * for (IntCursor<int> c : container) {
+ * System.out.println("index=" + c.index + " value=" + c.value);
+ * }
+ *
+ */
+ public Iteratortrue if this container has an element equal to
+ * e.
+ */
+ public boolean contains(int e);
+
+ /**
+ * Return the current number of elements in this container. The time for
+ * calculating the container's size may take O(n) time, although
+ * implementing classes should try to maintain the current size and return in
+ * constant time.
+ */
+ public int size();
+
+ /** Shortcut for size() == 0. */
+ public boolean isEmpty();
+
+ /**
+ * Copies all elements of this container to an array.
+ *
+ * procedure to all container elements. Returns the
+ * argument (any subclass of {@link IntProcedure}. This lets the caller to call
+ * methods of the argument by chaining the call (even if the argument is an
+ * anonymous type) to retrieve computed values, for example (IntContainer):
+ *
+ *
+ * int count = container.forEach(new IntProcedure() {
+ * int count; // this is a field declaration in an anonymous class.
+ *
+ * public void apply(int value) {
+ * count++;
+ * }
+ * }).count;
+ *
+ */
+ public predicate to container elements as long, as the
+ * predicate returns
+ * true. The iteration is interrupted otherwise.
+ */
+ public ints. */
+public final class IntCursor {
+ /**
+ * The current value's index in the container this cursor belongs to. The
+ * meaning of this index is defined by the container (usually it will be an
+ * index in the underlying storage buffer).
+ */
+ public int index;
+
+ /** The current value. */
+ public int value;
+
+ @Override
+ public String toString() {
+ return "[cursor, index: " + index + ", value: " + value + "]";
+ }
+}
diff --git a/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntIndexedContainer.java b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntIndexedContainer.java
new file mode 100644
index 0000000..8d29873
--- /dev/null
+++ b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntIndexedContainer.java
@@ -0,0 +1,109 @@
+/*
+ * HPPC
+ *
+ * Copyright (C) 2010-2024 Carrot Search s.c. and contributors
+ * All rights reserved.
+ *
+ * Refer to the full license file "LICENSE.txt":
+ * https://github.com/carrotsearch/hppc/blob/master/LICENSE.txt
+ */
+package net.lax1dude.eaglercraft.backend.server.api.collect;
+
+import java.util.RandomAccess;
+import java.util.stream.IntStream;
+
+/**
+ * An indexed container provides random access to elements based on an
+ * index. Indexes are zero-based.
+ */
+public interface IntIndexedContainer extends IntCollection, RandomAccess {
+ /**
+ * Removes the first element that equals e1, returning whether an
+ * element has been removed.
+ */
+ public boolean removeElement(int e1);
+
+ /**
+ * Removes the first element that equals e1, returning its deleted
+ * position or
+ * -1 if the element was not found.
+ */
+ public int removeFirst(int e1);
+
+ /**
+ * Removes the last element that equals e1, returning its deleted
+ * position or
+ * -1 if the element was not found.
+ */
+ public int removeLast(int e1);
+
+ /**
+ * Returns the index of the first occurrence of the specified element in this
+ * list, or -1 if this list does not contain the element.
+ */
+ public int indexOf(int e1);
+
+ /**
+ * Returns the index of the last occurrence of the specified element in this
+ * list, or -1 if this list does not contain the element.
+ */
+ public int lastIndexOf(int e1);
+
+ /**
+ * Adds an element to the end of this container (the last index is incremented
+ * by one).
+ */
+ public void add(int e1);
+
+ /**
+ * Inserts the specified element at the specified position in this list.
+ *
+ * @param index The index at which the element should be inserted, shifting any
+ * existing and subsequent elements to the right.
+ */
+ public void insert(int index, int e1);
+
+ /**
+ * Replaces the element at the specified position in this list with the
+ * specified element.
+ *
+ * @return Returns the previous value in the list.
+ */
+ public int set(int index, int e1);
+
+ /**
+ * @return Returns the element at index index from the list.
+ */
+ public int get(int index);
+
+ /**
+ * Removes the element at the specified position in this container and returns
+ * it.
+ *
+ * @see #removeFirst
+ * @see #removeLast
+ * @see #removeAll
+ */
+ public int removeAt(int index);
+
+ /**
+ * Removes and returns the last element of this container. This container must
+ * not be empty.
+ */
+ public int removeLast();
+
+ /**
+ * Removes from this container all of the elements with indexes between
+ * fromIndex, inclusive, and toIndex, exclusive.
+ */
+ public void removeRange(int fromIndex, int toIndex);
+
+ /** Returns this container elements as a stream. */
+ public IntStream stream();
+
+ /** Sorts the elements in this container and returns this container. */
+ public IntIndexedContainer sort();
+
+ /** Reverses the elements in this container and returns this container. */
+ public IntIndexedContainer reverse();
+}
diff --git a/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntIntAssociativeContainer.java b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntIntAssociativeContainer.java
new file mode 100644
index 0000000..9551ea4
--- /dev/null
+++ b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntIntAssociativeContainer.java
@@ -0,0 +1,123 @@
+/*
+ * HPPC
+ *
+ * Copyright (C) 2010-2024 Carrot Search s.c. and contributors
+ * All rights reserved.
+ *
+ * Refer to the full license file "LICENSE.txt":
+ * https://github.com/carrotsearch/hppc/blob/master/LICENSE.txt
+ */
+package net.lax1dude.eaglercraft.backend.server.api.collect;
+
+import java.util.Iterator;
+
+/**
+ * An associative container from keys to (one or possibly more) values.
+ *
+ * @see IntContainer
+ */
+public interface IntIntAssociativeContainer extends Iterable
+ * for (IntShortCursor c : intShortMap) {
+ * System.out.println("index=" + c.index + " key=" + c.key + " value=" + c.value);
+ * }
+ *
+ *
+ * index field inside the cursor gives the internal index
+ * inside the container's implementation. The interpretation of this index
+ * depends on to the container.
+ */
+ @Override
+ public Iteratortrue if this container has an association to a value for
+ * the given key.
+ */
+ public boolean containsKey(int key);
+
+ /**
+ * @return Returns the current size (number of assigned keys) in the container.
+ */
+ public int size();
+
+ /**
+ * @return Return true if this hash map contains no assigned keys.
+ */
+ public boolean isEmpty();
+
+ /**
+ * Removes all keys (and associated values) present in a given container. An
+ * alias to:
+ *
+ *
+ * keys().removeAll(container)
+ *
+ *
+ * but with no additional overhead.
+ *
+ * @return Returns the number of elements actually removed as a result of this
+ * call.
+ */
+ public int removeAll(IntContainer container);
+
+ /**
+ * Removes all keys (and associated values) for which the predicate returns
+ * true.
+ *
+ * @return Returns the number of elements actually removed as a result of this
+ * call.
+ */
+ public int removeAll(IntPredicate predicate);
+
+ /**
+ * Removes all keys (and associated values) for which the predicate returns
+ * true.
+ *
+ * @return Returns the number of elements actually removed as a result of this
+ * call.
+ */
+ public int removeAll(IntIntPredicate predicate);
+
+ /**
+ * Applies a given procedure to all keys-value pairs in this container. Returns
+ * the argument (any subclass of {@link IntIntProcedure}. This lets the caller
+ * call methods of the argument by chaining the call (even if the argument is an
+ * anonymous type) to retrieve computed values.
+ */
+ public true.
+ */
+ public key exists, putValue is inserted into the map,
+ * otherwise any existing value is incremented by additionValue.
+ *
+ * @param key The key of the value to adjust.
+ * @param putValue The value to put if key does not exist.
+ * @param incrementValue The value to add to the existing value if
+ * key exists.
+ * @return Returns the current value associated with key (after
+ * changes).
+ */
+ public int putOrAdd(int key, int putValue, int incrementValue);
+
+ /**
+ * An equivalent of calling
+ *
+ *
+ * putOrAdd(key, additionValue, additionValue);
+ *
+ *
+ * @param key The key of the value to adjust.
+ * @param additionValue The value to put or add to the existing value if
+ * key exists.
+ * @return Returns the current value associated with key (after
+ * changes).
+ */
+ public int addTo(int key, int additionValue);
+
+ /**
+ * Remove all values at the given key. The default value for the key type is
+ * returned if the value does not exist in the map.
+ */
+ public int remove(int key);
+
+ /**
+ * Compares the specified object with this set for equality. Returns
+ * {@code true} if and only if the specified object is also a {@link IntIntMap}
+ * and both objects contains exactly the same key-value pairs.
+ */
+ public boolean equals(Object obj);
+
+ /**
+ * @return A hash code of elements stored in the map. The hash code is defined
+ * as a sum of hash codes of keys and values stored within the set).
+ * Because sum is commutative, this ensures that different order of
+ * elements in a set does not affect the hash code.
+ */
+ public int hashCode();
+
+ /**
+ * Returns a logical "index" of a given key that can be used to speed up
+ * follow-up value setters or getters in certain scenarios (conditional logic).
+ *
+ * true if the index corresponds to an existing key
+ * or false otherwise. This is equivalent to checking whether the index
+ * is a positive value (existing keys) or a negative value (non-existing
+ * keys).
+ */
+ public boolean indexExists(int index);
+
+ /**
+ * Returns the value associated with an existing key.
+ *
+ * @see #indexOf
+ * @param index The index of an existing key.
+ * @return Returns the value currently associated with the key.
+ * @throws AssertionError If assertions are enabled and the index does not
+ * correspond to an existing key.
+ */
+ public int indexGet(int index);
+
+ /**
+ * Replaces the value associated with an existing key and returns any previous
+ * value stored for that key.
+ *
+ * @see #indexOf
+ * @param index The index of an existing key.
+ * @return Returns the previous value associated with the key.
+ * @throws AssertionError If assertions are enabled and the index does not
+ * correspond to an existing key.
+ */
+ public int indexReplace(int index, int newValue);
+
+ /**
+ * Inserts a key-value pair for a key that is not present in the map. This
+ * method may help in avoiding double recalculation of the key's hash.
+ *
+ * @see #indexOf
+ * @param index The index of a previously non-existing key, as returned from
+ * {@link #indexOf}.
+ * @throws AssertionError If assertions are enabled and the index corresponds to
+ * an existing key.
+ */
+ public void indexInsert(int index, int key, int value);
+
+ /**
+ * Removes a key-value pair at an index previously acquired from
+ * {@link #indexOf}.
+ *
+ * @see #indexOf
+ * @param index The index of the key to remove, as returned from
+ * {@link #indexOf}.
+ * @return Returns the previous value associated with the key.
+ * @throws AssertionError If assertions are enabled and the index does not
+ * correspond to an existing key.
+ */
+ public int indexRemove(int index);
+
+ /**
+ * Clear all keys and values in the container.
+ *
+ * @see #release()
+ */
+ public void clear();
+
+ /**
+ * Removes all elements from the collection and additionally releases any
+ * internal buffers. Typically, if the object is to be reused, a simple
+ * {@link #clear()} should be a better alternative since it'll avoid
+ * reallocation.
+ *
+ * @see #clear()
+ */
+ public void release();
+
+ /**
+ * Visually depict the distribution of keys.
+ *
+ * @param characters The number of characters to "squeeze" the entire buffer
+ * into.
+ * @return Returns a sequence of characters where '.' depicts an empty fragment
+ * of the internal buffer and 'X' depicts full or nearly full capacity
+ * within the buffer's range and anything between 1 and 9 is between.
+ */
+ public String visualizeKeyDistribution(int characters);
+}
diff --git a/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntIntPredicate.java b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntIntPredicate.java
new file mode 100644
index 0000000..d2c557f
--- /dev/null
+++ b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntIntPredicate.java
@@ -0,0 +1,15 @@
+/*
+ * HPPC
+ *
+ * Copyright (C) 2010-2024 Carrot Search s.c. and contributors
+ * All rights reserved.
+ *
+ * Refer to the full license file "LICENSE.txt":
+ * https://github.com/carrotsearch/hppc/blob/master/LICENSE.txt
+ */
+package net.lax1dude.eaglercraft.backend.server.api.collect;
+
+/** A predicate that applies to int, int pairs. */
+public interface IntIntPredicate {
+ public boolean apply(int key, int value);
+}
diff --git a/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntIntProcedure.java b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntIntProcedure.java
new file mode 100644
index 0000000..3e4bce4
--- /dev/null
+++ b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntIntProcedure.java
@@ -0,0 +1,15 @@
+/*
+ * HPPC
+ *
+ * Copyright (C) 2010-2024 Carrot Search s.c. and contributors
+ * All rights reserved.
+ *
+ * Refer to the full license file "LICENSE.txt":
+ * https://github.com/carrotsearch/hppc/blob/master/LICENSE.txt
+ */
+package net.lax1dude.eaglercraft.backend.server.api.collect;
+
+/** A procedure that applies to int, int pairs. */
+public interface IntIntProcedure {
+ public void apply(int key, int value);
+}
diff --git a/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntLookupContainer.java b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntLookupContainer.java
new file mode 100644
index 0000000..75832df
--- /dev/null
+++ b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntLookupContainer.java
@@ -0,0 +1,19 @@
+/*
+ * HPPC
+ *
+ * Copyright (C) 2010-2024 Carrot Search s.c. and contributors
+ * All rights reserved.
+ *
+ * Refer to the full license file "LICENSE.txt":
+ * https://github.com/carrotsearch/hppc/blob/master/LICENSE.txt
+ */
+package net.lax1dude.eaglercraft.backend.server.api.collect;
+
+/**
+ * Marker interface for containers that can check if they contain a given object
+ * in at least time O(log n) and ideally in amortized constant time
+ * O(1).
+ */
+public interface IntLookupContainer extends IntContainer {
+ public boolean contains(int e);
+}
diff --git a/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntObjectAssociativeContainer.java b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntObjectAssociativeContainer.java
new file mode 100644
index 0000000..ef62a68
--- /dev/null
+++ b/eaglerxserver/files/api/src/main/java/net/lax1dude/eaglercraft/backend/server/api/collect/IntObjectAssociativeContainer.java
@@ -0,0 +1,123 @@
+/*
+ * HPPC
+ *
+ * Copyright (C) 2010-2024 Carrot Search s.c. and contributors
+ * All rights reserved.
+ *
+ * Refer to the full license file "LICENSE.txt":
+ * https://github.com/carrotsearch/hppc/blob/master/LICENSE.txt
+ */
+package net.lax1dude.eaglercraft.backend.server.api.collect;
+
+import java.util.Iterator;
+
+/**
+ * An associative container from keys to (one or possibly more) values.
+ *
+ * @see IntContainer
+ */
+public interface IntObjectAssociativeContainer
+ * for (IntShortCursor c : intShortMap) {
+ * System.out.println("index=" + c.index + " key=" + c.key + " value=" + c.value);
+ * }
+ *
+ *
+ *