mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-03 21:52:05 -07:00
Avoid duplicate poi entries from the first section (#9235)
This commit is contained in:
@@ -258,10 +258,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ final int centerX = sourcePosition.getX() >> 4;
|
+ final int centerX = sourcePosition.getX() >> 4;
|
||||||
+ final int centerY = Mth.clamp(sourcePosition.getY() >> 4, lowerY, upperY);
|
+ final int centerY = Mth.clamp(sourcePosition.getY() >> 4, lowerY, upperY);
|
||||||
+ final int centerZ = sourcePosition.getZ() >> 4;
|
+ final int centerZ = sourcePosition.getZ() >> 4;
|
||||||
|
+ final long centerKey = CoordinateUtils.getChunkSectionKey(centerX, centerY, centerZ);
|
||||||
+
|
+
|
||||||
+ final LongArrayFIFOQueue queue = new LongArrayFIFOQueue();
|
+ final LongArrayFIFOQueue queue = new LongArrayFIFOQueue();
|
||||||
+ queue.enqueue(CoordinateUtils.getChunkSectionKey(centerX, centerY, centerZ));
|
|
||||||
+ final LongOpenHashSet seen = new LongOpenHashSet();
|
+ final LongOpenHashSet seen = new LongOpenHashSet();
|
||||||
|
+ seen.add(centerKey);
|
||||||
|
+ queue.enqueue(centerKey);
|
||||||
+
|
+
|
||||||
+ while (!queue.isEmpty()) {
|
+ while (!queue.isEmpty()) {
|
||||||
+ final long key = queue.dequeueLong();
|
+ final long key = queue.dequeueLong();
|
||||||
@@ -315,7 +317,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ final PoiSection poiSection = poiSectionOptional.orElse(null);
|
+ final PoiSection poiSection = poiSectionOptional.get();
|
||||||
+
|
+
|
||||||
+ final Map<Holder<PoiType>, Set<PoiRecord>> sectionData = poiSection.getData();
|
+ final Map<Holder<PoiType>, Set<PoiRecord>> sectionData = poiSection.getData();
|
||||||
+ if (sectionData.isEmpty()) {
|
+ if (sectionData.isEmpty()) {
|
||||||
@@ -499,10 +501,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ final int centerX = sourcePosition.getX() >> 4;
|
+ final int centerX = sourcePosition.getX() >> 4;
|
||||||
+ final int centerY = Mth.clamp(sourcePosition.getY() >> 4, lowerY, upperY);
|
+ final int centerY = Mth.clamp(sourcePosition.getY() >> 4, lowerY, upperY);
|
||||||
+ final int centerZ = sourcePosition.getZ() >> 4;
|
+ final int centerZ = sourcePosition.getZ() >> 4;
|
||||||
|
+ final long centerKey = CoordinateUtils.getChunkSectionKey(centerX, centerY, centerZ);
|
||||||
+
|
+
|
||||||
+ final LongArrayFIFOQueue queue = new LongArrayFIFOQueue();
|
+ final LongArrayFIFOQueue queue = new LongArrayFIFOQueue();
|
||||||
+ queue.enqueue(CoordinateUtils.getChunkSectionKey(centerX, centerY, centerZ));
|
|
||||||
+ final LongOpenHashSet seen = new LongOpenHashSet();
|
+ final LongOpenHashSet seen = new LongOpenHashSet();
|
||||||
|
+ seen.add(centerKey);
|
||||||
|
+ queue.enqueue(centerKey);
|
||||||
+
|
+
|
||||||
+ while (!queue.isEmpty()) {
|
+ while (!queue.isEmpty()) {
|
||||||
+ final long key = queue.dequeueLong();
|
+ final long key = queue.dequeueLong();
|
||||||
@@ -557,7 +561,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ final PoiSection poiSection = poiSectionOptional.orElse(null);
|
+ final PoiSection poiSection = poiSectionOptional.get();
|
||||||
+
|
+
|
||||||
+ final Map<Holder<PoiType>, Set<PoiRecord>> sectionData = poiSection.getData();
|
+ final Map<Holder<PoiType>, Set<PoiRecord>> sectionData = poiSection.getData();
|
||||||
+ if (sectionData.isEmpty()) {
|
+ if (sectionData.isEmpty()) {
|
||||||
|
Reference in New Issue
Block a user