diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/QuadTree.java b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/QuadTree.java index faec92af1..8a2a359ae 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/QuadTree.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/objects/quadTree/QuadTree.java @@ -31,6 +31,7 @@ import com.seibel.distanthorizons.core.util.gridList.MovableGridRingList; import it.unimi.dsi.fastutil.longs.LongArrayFIFOQueue; import it.unimi.dsi.fastutil.longs.LongIterator; import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.Nullable; import java.util.*; import java.util.function.Consumer; @@ -96,8 +97,10 @@ public class QuadTree //=====================// /** @return the node at the given section position */ + @Nullable public final QuadNode getNode(long pos) throws IndexOutOfBoundsException { return this.getOrSetNode(pos, false, null, true); } /** @return the value at the given section position */ + @Nullable public final T getValue(long pos) throws IndexOutOfBoundsException { QuadNode node = this.getNode(pos); @@ -109,6 +112,7 @@ public class QuadTree } /** @return the value that was previously in the given position, null if nothing */ + @Nullable public final T setValue(long pos, T value) throws IndexOutOfBoundsException { T previousValue = this.getValue(pos); @@ -117,6 +121,7 @@ public class QuadTree } /** @param runBoundaryChecks should only ever be set to true internally for removing out of bound nodes */ + @Nullable protected final QuadNode getOrSetNode(long pos, boolean setNewValue, T newValue, boolean runBoundaryChecks) throws IndexOutOfBoundsException { if (runBoundaryChecks && !this.isSectionPosInBounds(pos))