Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-21 22:10:10 +01:00
Update Optimise general POI access (#7903)
Dieser Commit ist enthalten in:
Ursprung
172d260d67
Commit
d7cc306336
patches/server
0732-Optimise-general-POI-access.patch0733-Add-more-async-catchers.patch0734-Rewrite-entity-bounding-box-lookup-calls.patch0735-Optimise-chunk-tick-iteration.patch0736-Execute-chunk-tasks-mid-tick.patch0737-Do-not-copy-visible-chunks.patch0738-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch0739-Custom-table-implementation-for-blockstate-state-loo.patch0740-Detail-more-information-in-watchdog-dumps.patch0741-Manually-inline-methods-in-BlockPosition.patch0742-Distance-manager-tick-timings.patch0743-Name-craft-scheduler-threads-according-to-the-plugin.patch0744-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch0745-Add-packet-limiter-config.patch0746-Use-correct-LevelStem-registry-when-loading-default-.patch0747-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch0748-Consolidate-flush-calls-for-entity-tracker-packets.patch0749-Don-t-lookup-fluid-state-when-raytracing.patch0750-Time-scoreboard-search.patch0751-Send-full-pos-packets-for-hard-colliding-entities.patch0752-Do-not-run-raytrace-logic-for-AIR.patch0753-Oprimise-map-impl-for-tracked-players.patch0754-Optimise-BlockSoil-nearby-water-lookup.patch0755-Allow-removal-addition-of-entities-to-entity-ticklis.patch0756-Optimise-random-block-ticking.patch0757-Optimise-non-flush-packet-sending.patch0758-Optimise-nearby-player-lookups.patch0759-Optimise-WorldServer-notify.patch0760-Remove-streams-for-villager-AI.patch0761-Rewrite-dataconverter-system.patch0762-Use-Velocity-compression-and-cipher-natives.patch0763-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch0764-Do-not-process-entity-loads-in-CraftChunk-getEntitie.patch0765-Async-catch-modifications-to-critical-entity-state.patch0766-Fix-Bukkit-NamespacedKey-shenanigans.patch0767-Fix-merchant-inventory-not-closing-on-entity-removal.patch0768-Check-requirement-before-suggesting-root-nodes.patch0769-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch0770-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch0771-Ensure-valid-vehicle-status.patch0772-Prevent-softlocked-end-exit-portal-generation.patch0773-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch0774-Don-t-log-debug-logging-being-disabled.patch0775-fix-various-menus-with-empty-level-accesses.patch0776-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch0777-Preserve-overstacked-loot.patch0778-Update-head-rotation-in-missing-places.patch0779-prevent-unintended-light-block-manipulation.patch0780-Fix-CraftCriteria-defaults-map.patch0781-Fix-upstreams-block-state-factories.patch0782-Add-config-option-for-logging-player-ip-addresses.patch0783-Configurable-feature-seeds.patch0784-VanillaCommandWrapper-didnt-account-for-entity-sende.patch0785-Add-root-admin-user-detection.patch0786-Always-allow-item-changing-in-Fireball.patch0787-don-t-attempt-to-teleport-dead-entities.patch0788-Prevent-excessive-velocity-through-repeated-crits.patch0789-Remove-client-side-code-using-deprecated-for-removal.patch0790-Rewrite-the-light-engine.patch0791-Always-parse-protochunk-light-sources-unless-it-is-m.patch0792-Fix-removing-recipes-from-RecipeIterator.patch0793-Prevent-sending-oversized-item-data-in-equipment-and.patch0794-Hide-unnecessary-itemmeta-from-clients.patch0795-Fix-kelp-modifier-changing-growth-for-other-crops.patch0796-Prevent-ContainerOpenersCounter-openCount-from-going.patch0797-Add-PlayerItemFrameChangeEvent.patch0798-Add-player-health-update-API.patch0799-Optimize-HashMapPalette.patch0800-Allow-delegation-to-vanilla-chunk-gen.patch0801-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch0802-Optimise-collision-checking-in-player-move-packet-ha.patch0803-Actually-unload-POI-data.patch0804-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch0805-Update-Log4j.patch0806-Add-more-Campfire-API.patch0807-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch0808-Fix-tripwire-state-inconsistency.patch0809-Fix-fluid-logging-on-Block-breakNaturally.patch0810-Forward-CraftEntity-in-teleport-command.patch0811-Improve-scoreboard-entries.patch0812-Entity-powdered-snow-API.patch0813-Add-API-for-item-entity-health.patch0814-Fix-entity-type-tags-suggestions-in-selectors.patch0815-Configurable-max-block-light-for-monster-spawning.patch0816-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch0817-Load-effect-amplifiers-greater-than-127-correctly.patch0818-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch0819-Fix-bees-aging-inside-hives.patch0820-Bucketable-API.patch0821-Check-player-world-in-endPortalSoundRadius.patch0822-Validate-usernames.patch0823-Fix-saving-configs-with-more-long-comments.patch0824-Make-water-animal-spawn-height-configurable.patch0825-Expose-vanilla-BiomeProvider-from-WorldInfo.patch0826-Add-config-option-for-worlds-affected-by-time-cmd.patch0827-Add-new-overload-to-PersistentDataContainer-has.patch0828-Multiple-Entries-with-Scoreboards.patch0829-Reset-placed-block-on-exception.patch0830-Add-configurable-height-for-slime-spawn.patch0831-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch
@ -30,20 +30,20 @@ This patch also specifically optimises other areas of code to
|
|||||||
use PoiAccess. For example, some villager AI and portaling code
|
use PoiAccess. For example, some villager AI and portaling code
|
||||||
had to be specifically modified.
|
had to be specifically modified.
|
||||||
|
|
||||||
TODO: See two still conflicting hunks and two TODOs
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/util/PoiAccess.java b/src/main/java/io/papermc/paper/util/PoiAccess.java
|
diff --git a/src/main/java/io/papermc/paper/util/PoiAccess.java b/src/main/java/io/papermc/paper/util/PoiAccess.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..a2ea0ec9e25c0c1fc95ac5376d4ed2f6884e14df
|
index 0000000000000000000000000000000000000000..aaf94f0a47e09d9d23778df437820bc1556d7827
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/io/papermc/paper/util/PoiAccess.java
|
+++ b/src/main/java/io/papermc/paper/util/PoiAccess.java
|
||||||
@@ -0,0 +1,749 @@
|
@@ -0,0 +1,800 @@
|
||||||
+package io.papermc.paper.util;
|
+package io.papermc.paper.util;
|
||||||
+
|
+
|
||||||
|
+import com.mojang.datafixers.util.Pair;
|
||||||
+import it.unimi.dsi.fastutil.doubles.Double2ObjectMap;
|
+import it.unimi.dsi.fastutil.doubles.Double2ObjectMap;
|
||||||
+import it.unimi.dsi.fastutil.doubles.Double2ObjectRBTreeMap;
|
+import it.unimi.dsi.fastutil.doubles.Double2ObjectRBTreeMap;
|
||||||
+import it.unimi.dsi.fastutil.longs.LongArrayFIFOQueue;
|
+import it.unimi.dsi.fastutil.longs.LongArrayFIFOQueue;
|
||||||
+import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
|
+import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
|
||||||
|
+import java.util.function.BiPredicate;
|
||||||
+import net.minecraft.core.BlockPos;
|
+import net.minecraft.core.BlockPos;
|
||||||
+import net.minecraft.core.Holder;
|
+import net.minecraft.core.Holder;
|
||||||
+import net.minecraft.util.Mth;
|
+import net.minecraft.util.Mth;
|
||||||
@ -133,6 +133,24 @@ index 0000000000000000000000000000000000000000..a2ea0ec9e25c0c1fc95ac5376d4ed2f6
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ // only includes x/z axis
|
+ // only includes x/z axis
|
||||||
|
+ // finds the closest poi data by distance.
|
||||||
|
+ public static Pair<Holder<PoiType>, BlockPos> findClosestPoiDataTypeAndPosition(final PoiManager poiStorage,
|
||||||
|
+ final Predicate<Holder<PoiType>> villagePlaceType,
|
||||||
|
+ // position predicate must not modify chunk POI
|
||||||
|
+ final Predicate<BlockPos> positionPredicate,
|
||||||
|
+ final BlockPos sourcePosition,
|
||||||
|
+ final int range, // distance on x y z axis
|
||||||
|
+ final double maxDistance,
|
||||||
|
+ final PoiManager.Occupancy occupancy,
|
||||||
|
+ final boolean load) {
|
||||||
|
+ final PoiRecord ret = findClosestPoiDataRecord(
|
||||||
|
+ poiStorage, villagePlaceType, positionPredicate, sourcePosition, range, maxDistance, occupancy, load
|
||||||
|
+ );
|
||||||
|
+
|
||||||
|
+ return ret == null ? null : Pair.of(ret.getPoiType(), ret.getPos());
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // only includes x/z axis
|
||||||
+ // finds the closest poi data by distance. if multiple match the same distance, then they all are returned.
|
+ // finds the closest poi data by distance. if multiple match the same distance, then they all are returned.
|
||||||
+ public static void findClosestPoiDataPositions(final PoiManager poiStorage,
|
+ public static void findClosestPoiDataPositions(final PoiManager poiStorage,
|
||||||
+ final Predicate<Holder<PoiType>> villagePlaceType,
|
+ final Predicate<Holder<PoiType>> villagePlaceType,
|
||||||
@ -182,6 +200,24 @@ index 0000000000000000000000000000000000000000..a2ea0ec9e25c0c1fc95ac5376d4ed2f6
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ // only includes x/z axis
|
+ // only includes x/z axis
|
||||||
|
+ // finds the closest poi data by distance.
|
||||||
|
+ public static PoiRecord findClosestPoiDataRecord(final PoiManager poiStorage,
|
||||||
|
+ final Predicate<Holder<PoiType>> villagePlaceType,
|
||||||
|
+ // position predicate must not modify chunk POI
|
||||||
|
+ final BiPredicate<Holder<PoiType>, BlockPos> predicate,
|
||||||
|
+ final BlockPos sourcePosition,
|
||||||
|
+ final int range, // distance on x y z axis
|
||||||
|
+ final double maxDistance,
|
||||||
|
+ final PoiManager.Occupancy occupancy,
|
||||||
|
+ final boolean load) {
|
||||||
|
+ final List<PoiRecord> ret = new ArrayList<>();
|
||||||
|
+ findClosestPoiDataRecords(
|
||||||
|
+ poiStorage, villagePlaceType, predicate, sourcePosition, range, maxDistance, occupancy, load, ret
|
||||||
|
+ );
|
||||||
|
+ return ret.isEmpty() ? null : ret.get(0);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // only includes x/z axis
|
||||||
+ // finds the closest poi data by distance. if multiple match the same distance, then they all are returned.
|
+ // finds the closest poi data by distance. if multiple match the same distance, then they all are returned.
|
||||||
+ public static void findClosestPoiDataRecords(final PoiManager poiStorage,
|
+ public static void findClosestPoiDataRecords(final PoiManager poiStorage,
|
||||||
+ final Predicate<Holder<PoiType>> villagePlaceType,
|
+ final Predicate<Holder<PoiType>> villagePlaceType,
|
||||||
@ -193,6 +229,19 @@ index 0000000000000000000000000000000000000000..a2ea0ec9e25c0c1fc95ac5376d4ed2f6
|
|||||||
+ final PoiManager.Occupancy occupancy,
|
+ final PoiManager.Occupancy occupancy,
|
||||||
+ final boolean load,
|
+ final boolean load,
|
||||||
+ final List<PoiRecord> ret) {
|
+ final List<PoiRecord> ret) {
|
||||||
|
+ findClosestPoiDataRecords(poiStorage, villagePlaceType, (type, pos) -> positionPredicate.test(pos), sourcePosition, range, maxDistance, occupancy, load, ret);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public static void findClosestPoiDataRecords(final PoiManager poiStorage,
|
||||||
|
+ final Predicate<Holder<PoiType>> villagePlaceType,
|
||||||
|
+ // position predicate must not modify chunk POI
|
||||||
|
+ final BiPredicate<Holder<PoiType>, BlockPos> predicate,
|
||||||
|
+ final BlockPos sourcePosition,
|
||||||
|
+ final int range, // distance on x y z axis
|
||||||
|
+ final double maxDistance,
|
||||||
|
+ final PoiManager.Occupancy occupancy,
|
||||||
|
+ final boolean load,
|
||||||
|
+ final List<PoiRecord> ret) {
|
||||||
+ final Predicate<? super PoiRecord> occupancyFilter = occupancy.getTest();
|
+ final Predicate<? super PoiRecord> occupancyFilter = occupancy.getTest();
|
||||||
+
|
+
|
||||||
+ final List<PoiRecord> closestRecords = new ArrayList<>();
|
+ final List<PoiRecord> closestRecords = new ArrayList<>();
|
||||||
@ -302,7 +351,7 @@ index 0000000000000000000000000000000000000000..a2ea0ec9e25c0c1fc95ac5376d4ed2f6
|
|||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (positionPredicate != null && !positionPredicate.test(poiPosition)) {
|
+ if (predicate != null && !predicate.test(poiData.getPoiType(), poiPosition)) {
|
||||||
+ // filter by position
|
+ // filter by position
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
@ -383,7 +432,7 @@ index 0000000000000000000000000000000000000000..a2ea0ec9e25c0c1fc95ac5376d4ed2f6
|
|||||||
+ final PoiManager.Occupancy occupancy,
|
+ final PoiManager.Occupancy occupancy,
|
||||||
+ final boolean load,
|
+ final boolean load,
|
||||||
+ final int max,
|
+ final int max,
|
||||||
+ final List<BlockPos> ret) {
|
+ final List<Pair<Holder<PoiType>, BlockPos>> ret) {
|
||||||
+ final Set<BlockPos> positions = new HashSet<>();
|
+ final Set<BlockPos> positions = new HashSet<>();
|
||||||
+ // pos predicate is last thing that runs before adding to ret.
|
+ // pos predicate is last thing that runs before adding to ret.
|
||||||
+ final Predicate<BlockPos> newPredicate = (final BlockPos pos) -> {
|
+ final Predicate<BlockPos> newPredicate = (final BlockPos pos) -> {
|
||||||
@ -399,7 +448,7 @@ index 0000000000000000000000000000000000000000..a2ea0ec9e25c0c1fc95ac5376d4ed2f6
|
|||||||
+ );
|
+ );
|
||||||
+
|
+
|
||||||
+ for (final PoiRecord record : toConvert) {
|
+ for (final PoiRecord record : toConvert) {
|
||||||
+ ret.add(record.getPos());
|
+ ret.add(Pair.of(record.getPoiType(), record.getPos()));
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@ -665,7 +714,7 @@ index 0000000000000000000000000000000000000000..a2ea0ec9e25c0c1fc95ac5376d4ed2f6
|
|||||||
+ final PoiManager.Occupancy occupancy,
|
+ final PoiManager.Occupancy occupancy,
|
||||||
+ final boolean load,
|
+ final boolean load,
|
||||||
+ final int max,
|
+ final int max,
|
||||||
+ final List<BlockPos> ret) {
|
+ final List<Pair<Holder<PoiType>, BlockPos>> ret) {
|
||||||
+ final Set<BlockPos> positions = new HashSet<>();
|
+ final Set<BlockPos> positions = new HashSet<>();
|
||||||
+ // pos predicate is last thing that runs before adding to ret.
|
+ // pos predicate is last thing that runs before adding to ret.
|
||||||
+ final Predicate<BlockPos> newPredicate = (final BlockPos pos) -> {
|
+ final Predicate<BlockPos> newPredicate = (final BlockPos pos) -> {
|
||||||
@ -681,7 +730,7 @@ index 0000000000000000000000000000000000000000..a2ea0ec9e25c0c1fc95ac5376d4ed2f6
|
|||||||
+ );
|
+ );
|
||||||
+
|
+
|
||||||
+ for (final PoiRecord record : toConvert) {
|
+ for (final PoiRecord record : toConvert) {
|
||||||
+ ret.add(record.getPos());
|
+ ret.add(Pair.of(record.getPoiType(), record.getPos()));
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@ -788,43 +837,45 @@ index 0000000000000000000000000000000000000000..a2ea0ec9e25c0c1fc95ac5376d4ed2f6
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
index cf0df7e693ca8dabfde11616617efd97e986788e..63c997ba5e7194218e844480419c6b59a4d26e9a 100644
|
index 4f75f2be7070d49c2c60866ad7146da19ab61652..43243537b765a2d270be6de3f053fea77ff67d18 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
@@ -82,7 +82,11 @@ public class AcquirePoi extends Behavior<PathfinderMob> {
|
@@ -87,7 +87,11 @@ public class AcquirePoi extends Behavior<PathfinderMob> {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
- Set<BlockPos> set = poiManager.findAllClosestFirst(this.poiType.getPredicate(), predicate, entity.blockPosition(), 48, PoiManager.Occupancy.HAS_SPACE).limit(5L).collect(Collectors.toSet());
|
- Set<Pair<Holder<PoiType>, BlockPos>> set = poiManager.findAllClosestFirstWithType(this.poiType, predicate, entity.blockPosition(), 48, PoiManager.Occupancy.HAS_SPACE).limit(5L).collect(Collectors.toSet());
|
||||||
+ // Paper start - optimise POI access
|
+ // Paper start - optimise POI access
|
||||||
+ java.util.List<BlockPos> poiposes = new java.util.ArrayList<>();
|
+ java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
||||||
+ io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, this.poiType.getPredicate(), predicate, entity.blockPosition(), 48, 48*48, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes);
|
+ io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, this.poiType, predicate, entity.blockPosition(), 48, 48*48, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes);
|
||||||
+ Set<BlockPos> set = new java.util.HashSet<>(poiposes);
|
+ Set<Pair<Holder<PoiType>, BlockPos>> set = new java.util.HashSet<>(poiposes);
|
||||||
+ // Paper end - optimise POI access
|
+ // Paper end - optimise POI access
|
||||||
Path path = entity.getNavigation().createPath(set, this.poiType.getValidRange());
|
Path path = findPathToPois(entity, set);
|
||||||
if (path != null && path.canReach()) {
|
if (path != null && path.canReach()) {
|
||||||
BlockPos blockPos = path.getTarget();
|
BlockPos blockPos = path.getTarget();
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||||
index 0eea3e39616e40e15d1662b973c097cda3b2cee7..3ccc1421f4a5a08dadb9fe3c9fa3ac3131e6ba1e 100644
|
index 33fbf72b440e0d164ecd4fb0fdec72e2394d0a1e..8db20db72cd51046213625fac46c35854c59ec5d 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||||
@@ -49,8 +49,12 @@ public class NearestBedSensor extends Sensor<Mob> {
|
@@ -53,10 +53,12 @@ public class NearestBedSensor extends Sensor<Mob> {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
- Stream<BlockPos> stream = poiManager.findAll(PoiType.HOME.getPredicate(), predicate, entity.blockPosition(), 48, PoiManager.Occupancy.ANY);
|
- Set<Pair<Holder<PoiType>, BlockPos>> set = poiManager.findAllWithType((holder) -> {
|
||||||
- Path path = entity.getNavigation().createPath(stream, PoiType.HOME.getValidRange());
|
- return holder.is(PoiTypes.HOME);
|
||||||
|
- }, predicate, entity.blockPosition(), 48, PoiManager.Occupancy.ANY).collect(Collectors.toSet());
|
||||||
|
- Path path = AcquirePoi.findPathToPois(entity, set);
|
||||||
+ // Paper start - optimise POI access
|
+ // Paper start - optimise POI access
|
||||||
+ java.util.List<BlockPos> poiposes = new java.util.ArrayList<>();
|
+ java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
||||||
+ // don't ask me why it's unbounded. ask mojang.
|
+ // don't ask me why it's unbounded. ask mojang.
|
||||||
+ io.papermc.paper.util.PoiAccess.findAnyPoiPositions(poiManager, PoiType.HOME.getPredicate(), predicate, entity.blockPosition(), 48, PoiManager.Occupancy.ANY, false, Integer.MAX_VALUE, poiposes);
|
+ io.papermc.paper.util.PoiAccess.findAnyPoiPositions(poiManager, type -> type.is(PoiTypes.HOME), predicate, entity.blockPosition(), 48, PoiManager.Occupancy.ANY, false, Integer.MAX_VALUE, poiposes);
|
||||||
+ Path path = entity.getNavigation().createPath(new java.util.HashSet<>(poiposes), PoiType.HOME.getValidRange());
|
+ Path path = AcquirePoi.findPathToPois(entity, new java.util.HashSet<>(poiposes));
|
||||||
+ // Paper end - optimise POI access
|
+ // Paper end - optimise POI access
|
||||||
if (path != null && path.canReach()) {
|
if (path != null && path.canReach()) {
|
||||||
BlockPos blockPos = path.getTarget();
|
BlockPos blockPos = path.getTarget();
|
||||||
Optional<PoiType> optional = poiManager.getType(blockPos);
|
Optional<Holder<PoiType>> optional = poiManager.getType(blockPos);
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
|
||||||
index ab9bb440c8e91ecb49c1e14a427d35087a87ac80..96708500deb6cda561bad81956cfb8619a066ae0 100644
|
index ab9bb440c8e91ecb49c1e14a427d35087a87ac80..497a81e49d54380713c18523ae8f09f94c453721 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
|
||||||
@@ -40,7 +40,7 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
@@ -40,7 +40,7 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
||||||
@ -836,7 +887,7 @@ index ab9bb440c8e91ecb49c1e14a427d35087a87ac80..96708500deb6cda561bad81956cfb861
|
|||||||
|
|
||||||
public PoiManager(Path path, DataFixer dataFixer, boolean dsync, RegistryAccess registryManager, LevelHeightAccessor world) {
|
public PoiManager(Path path, DataFixer dataFixer, boolean dsync, RegistryAccess registryManager, LevelHeightAccessor world) {
|
||||||
super(path, PoiSection::codec, PoiSection::new, dataFixer, DataFixTypes.POI_CHUNK, dsync, registryManager, world);
|
super(path, PoiSection::codec, PoiSection::new, dataFixer, DataFixTypes.POI_CHUNK, dsync, registryManager, world);
|
||||||
@@ -113,16 +113,21 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
@@ -113,43 +113,62 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<BlockPos> find(Predicate<Holder<PoiType>> typePredicate, Predicate<BlockPos> posPredicate, BlockPos pos, int radius, PoiManager.Occupancy occupationStatus) {
|
public Optional<BlockPos> find(Predicate<Holder<PoiType>> typePredicate, Predicate<BlockPos> posPredicate, BlockPos pos, int radius, PoiManager.Occupancy occupationStatus) {
|
||||||
@ -852,17 +903,22 @@ index ab9bb440c8e91ecb49c1e14a427d35087a87ac80..96708500deb6cda561bad81956cfb861
|
|||||||
- return blockPos2.distSqr(pos);
|
- return blockPos2.distSqr(pos);
|
||||||
- }));
|
- }));
|
||||||
+ // Paper start - re-route to faster logic
|
+ // Paper start - re-route to faster logic
|
||||||
+ BlockPos ret = io.papermc.paper.util.PoiAccess.findClosestPoiDataPosition(this, typePredicate, null, pos, radius, radius*radius, occupationStatus, false);
|
+ BlockPos ret = io.papermc.paper.util.PoiAccess.findClosestPoiDataPosition(this, typePredicate, null, pos, radius, radius * radius, occupationStatus, false);
|
||||||
+ return Optional.ofNullable(ret);
|
+ return Optional.ofNullable(ret);
|
||||||
+ // Paper end - re-route to faster logic
|
+ // Paper end - re-route to faster logic
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<Pair<Holder<PoiType>, BlockPos>> findClosestWithType(Predicate<Holder<PoiType>> typePredicate, BlockPos pos, int radius, PoiManager.Occupancy occupationStatus) {
|
public Optional<Pair<Holder<PoiType>, BlockPos>> findClosestWithType(Predicate<Holder<PoiType>> typePredicate, BlockPos pos, int radius, PoiManager.Occupancy occupationStatus) {
|
||||||
+ //TODO re-route to faster logic
|
- return this.getInRange(typePredicate, pos, radius, occupationStatus).min(Comparator.comparingDouble((poi) -> {
|
||||||
return this.getInRange(typePredicate, pos, radius, occupationStatus).min(Comparator.comparingDouble((poi) -> {
|
- return poi.getPos().distSqr(pos);
|
||||||
return poi.getPos().distSqr(pos);
|
- })).map((poi) -> {
|
||||||
})).map((poi) -> {
|
- return Pair.of(poi.getPoiType(), poi.getPos());
|
||||||
@@ -131,12 +136,14 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
- });
|
||||||
|
+ // Paper start - re-route to faster logic
|
||||||
|
+ return Optional.ofNullable(io.papermc.paper.util.PoiAccess.findClosestPoiDataTypeAndPosition(
|
||||||
|
+ this, typePredicate, null, pos, radius, radius * radius, occupationStatus, false
|
||||||
|
+ ));
|
||||||
|
+ // Paper end - re-route to faster logic
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<BlockPos> findClosest(Predicate<Holder<PoiType>> typePredicate, Predicate<BlockPos> posPredicate, BlockPos pos, int radius, PoiManager.Occupancy occupationStatus) {
|
public Optional<BlockPos> findClosest(Predicate<Holder<PoiType>> typePredicate, Predicate<BlockPos> posPredicate, BlockPos pos, int radius, PoiManager.Occupancy occupationStatus) {
|
||||||
@ -876,11 +932,18 @@ index ab9bb440c8e91ecb49c1e14a427d35087a87ac80..96708500deb6cda561bad81956cfb861
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Optional<BlockPos> take(Predicate<Holder<PoiType>> typePredicate, BiPredicate<Holder<PoiType>, BlockPos> biPredicate, BlockPos pos, int radius) {
|
public Optional<BlockPos> take(Predicate<Holder<PoiType>> typePredicate, BiPredicate<Holder<PoiType>, BlockPos> biPredicate, BlockPos pos, int radius) {
|
||||||
+ //TODO re-route to faster logic
|
- return this.getInRange(typePredicate, pos, radius, PoiManager.Occupancy.HAS_SPACE).filter((poi) -> {
|
||||||
return this.getInRange(typePredicate, pos, radius, PoiManager.Occupancy.HAS_SPACE).filter((poi) -> {
|
- return biPredicate.test(poi.getPoiType(), poi.getPos());
|
||||||
return biPredicate.test(poi.getPoiType(), poi.getPos());
|
- }).findFirst().map((poi) -> {
|
||||||
}).findFirst().map((poi) -> {
|
+ // Paper start - re-route to faster logic
|
||||||
@@ -146,10 +153,21 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
+ final @javax.annotation.Nullable PoiRecord closest = io.papermc.paper.util.PoiAccess.findClosestPoiDataRecord(
|
||||||
|
+ this, typePredicate, biPredicate, pos, radius, radius * radius, Occupancy.HAS_SPACE, false
|
||||||
|
+ );
|
||||||
|
+ return Optional.ofNullable(closest).map(poi -> {
|
||||||
|
+ // Paper end - re-route to faster logic
|
||||||
|
poi.acquireTicket();
|
||||||
|
return poi.getPos();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<BlockPos> getRandom(Predicate<Holder<PoiType>> typePredicate, Predicate<BlockPos> positionPredicate, PoiManager.Occupancy occupationStatus, BlockPos pos, int radius, RandomSource random) {
|
public Optional<BlockPos> getRandom(Predicate<Holder<PoiType>> typePredicate, Predicate<BlockPos> positionPredicate, PoiManager.Occupancy occupationStatus, BlockPos pos, int radius, RandomSource random) {
|
||||||
@ -920,7 +983,7 @@ index bb2be6eea7a0cff4cc70bd43738b1ce213e43558..b71a4027a0eed467a3707c59315092dd
|
|||||||
private boolean isValid;
|
private boolean isValid;
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
||||||
index 80a7a1340908ae783a029912487485f7596bec5b..83d41596e53b3bd2e983561688c49399bdaa2095 100644
|
index 678bd36581ead3a225e3a6e24b78e5db4e42657b..9b2cec7528936a5d53a926c91063cb6e9ed7da1b 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
||||||
@@ -71,11 +71,11 @@ public class SectionStorage<R> extends RegionFileStorage implements AutoCloseabl
|
@@ -71,11 +71,11 @@ public class SectionStorage<R> extends RegionFileStorage implements AutoCloseabl
|
||||||
@ -938,10 +1001,10 @@ index 80a7a1340908ae783a029912487485f7596bec5b..83d41596e53b3bd2e983561688c49399
|
|||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
} else {
|
} else {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
|
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
|
||||||
index 504f5d98d4a3d6b5bbd0998b495196aa6b39f47a..436f31ab1450bb087e00bed2c6acd8d8833e0598 100644
|
index 1311d69bb2fa7b3617936e6ad6eb5236fedc260d..386a73f32f2504af81107852307dcd393d4d8a11 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
|
--- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
|
+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
|
||||||
@@ -51,18 +51,41 @@ public class PortalForcer {
|
@@ -51,18 +51,39 @@ public class PortalForcer {
|
||||||
// int i = flag ? 16 : 128;
|
// int i = flag ? 16 : 128;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@ -962,9 +1025,7 @@ index 504f5d98d4a3d6b5bbd0998b495196aa6b39f47a..436f31ab1450bb087e00bed2c6acd8d8
|
|||||||
+ java.util.List<PoiRecord> records = new java.util.ArrayList<>();
|
+ java.util.List<PoiRecord> records = new java.util.ArrayList<>();
|
||||||
+ io.papermc.paper.util.PoiAccess.findClosestPoiDataRecords(
|
+ io.papermc.paper.util.PoiAccess.findClosestPoiDataRecords(
|
||||||
+ villageplace,
|
+ villageplace,
|
||||||
+ (PoiType type) -> {
|
+ type -> type.is(PoiTypes.NETHER_PORTAL),
|
||||||
+ return type == PoiType.NETHER_PORTAL;
|
|
||||||
+ },
|
|
||||||
+ (BlockPos pos) -> {
|
+ (BlockPos pos) -> {
|
||||||
+ net.minecraft.world.level.chunk.ChunkAccess lowest = this.level.getChunk(pos.getX() >> 4, pos.getZ() >> 4, net.minecraft.world.level.chunk.ChunkStatus.EMPTY);
|
+ net.minecraft.world.level.chunk.ChunkAccess lowest = this.level.getChunk(pos.getX() >> 4, pos.getZ() >> 4, net.minecraft.world.level.chunk.ChunkStatus.EMPTY);
|
||||||
+ if (!lowest.getStatus().isOrAfter(net.minecraft.world.level.chunk.ChunkStatus.FULL)
|
+ if (!lowest.getStatus().isOrAfter(net.minecraft.world.level.chunk.ChunkStatus.FULL)
|
@ -914,7 +914,7 @@ index 0000000000000000000000000000000000000000..3ba094e640d7fe7803e2bbdab8ff3beb
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index a110acecd0459ff2731dbc5f10cc0d990afd4d5b..3ce6df8c6084cbc19a2e57e5934e1e6b944aa2fd 100644
|
index 4dc54c121b4e41cc7ef5da1313fa6a49e73de9e8..5518dc58647aae68b31dbe059cdbc669cfa73112 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -446,7 +446,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -446,7 +446,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
@ -1051,7 +1051,7 @@ index 1a3be6f0570c7c746eafa36544debe90d7629432..c0817ef8927f00e2fd3fbf3289f8041f
|
|||||||
|
|
||||||
<T extends Entity> List<T> getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate);
|
<T extends Entity> List<T> getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index e3efc697f0730703ec42aad79de004a476bd09b6..27e00259a3cec2205cce3e2b99f03a9e9ba45a1b 100644
|
index 91a36884e10c278f6e0efb4fbed1352492b38200..ff118d658d52a4ac5d261727c6e23a3b663ecae9 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -294,6 +294,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -294,6 +294,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@ -77,7 +77,7 @@ index a34f22cadc09e53ea4de787b04d050b99dddbcac..c8012de68b997d6270ba4a5d79bc93c0
|
|||||||
});
|
});
|
||||||
throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD;
|
throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD;
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index 78e2e9285b018aa52726cc61f7027e49e9dd9d68..6d1489332681d938a1c3db832ab967ba494f3b97 100644
|
index 0b3c4e43d5d9b13c963b1802cd85f099b4274c8c..61251596a16fc1e2aba735feca2c073a4db3a4a8 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -998,7 +998,26 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -998,7 +998,26 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@ -13,7 +13,7 @@ Paper recently reverted this optimisation, so it's been reintroduced
|
|||||||
here.
|
here.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index f87844acb092bedad5e742c8000a1a09759bdd6d..e07b094cf19bc94a4e3ef726f37973eaff7aaf6d 100644
|
index 0d41b56519db354b730527b28e0294469ff11db9..5e8d303133a2cd8b748c127e2b6aa4d279d4df4d 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -369,6 +369,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -369,6 +369,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@ -120,7 +120,7 @@ index 0000000000000000000000000000000000000000..16ca915c33e31b50d33336408b041e40
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index 6d1489332681d938a1c3db832ab967ba494f3b97..3ef55cb31b8d9a308fab3ac1e463e98a7dce726e 100644
|
index 61251596a16fc1e2aba735feca2c073a4db3a4a8..69ecceda441d9a228c1ae401688ea7333287b80c 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -662,6 +662,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -662,6 +662,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
@ -342,7 +342,7 @@ index 69c98c2cb2fd8f149a39bbddcbfe0c5c5adc3904..5575730aa6f77a91467c394fa8465c33
|
|||||||
|
|
||||||
public BlockPos getHomePos() {
|
public BlockPos getHomePos() {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index e07b094cf19bc94a4e3ef726f37973eaff7aaf6d..03f7eb8a56fd4e609bc7b1a00d18cad5586a41dd 100644
|
index 5e8d303133a2cd8b748c127e2b6aa4d279d4df4d..504455c626a9d22f552144a38861dc356fb02b99 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -1302,10 +1302,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -1302,10 +1302,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@ -105,7 +105,7 @@ index d2227b40aa6a5e49e30c1f33e407d8f25cf2be4e..1c5137be8c0935ae371d0b9e6a8f3d8b
|
|||||||
|
|
||||||
protected ChunkGenerator generator() {
|
protected ChunkGenerator generator() {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index 3ef55cb31b8d9a308fab3ac1e463e98a7dce726e..d292e4775cdf936bb294bba7c0320c8b97ad14a6 100644
|
index 69ecceda441d9a228c1ae401688ea7333287b80c..61964e73b020aa565a855d23f2f4da2da342c1e1 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -404,6 +404,83 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -404,6 +404,83 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
@ -226,7 +226,7 @@ index a49dfe4f81d449c5dd7ba5b8f9af7fec5c54f5de..3646b969fa51b9683ab4137e530c3a6f
|
|||||||
if (entityhuman != null) {
|
if (entityhuman != null) {
|
||||||
double d0 = entityhuman.distanceToSqr((Entity) this);
|
double d0 = entityhuman.distanceToSqr((Entity) this);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 03f7eb8a56fd4e609bc7b1a00d18cad5586a41dd..aba8e748123f70d48de638ea18afbbf5dfede504 100644
|
index 504455c626a9d22f552144a38861dc356fb02b99..13c4b7aee9b9802edbaf7e4df9e9355667e727bb 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -206,6 +206,69 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -206,6 +206,69 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@ -110,7 +110,7 @@ index 1c5137be8c0935ae371d0b9e6a8f3d8bccd85d31..8939d15bd413a2b743303d137fc797be
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index d292e4775cdf936bb294bba7c0320c8b97ad14a6..7e7edaebf146d8042e9b75f6088990069ca9021a 100644
|
index 61964e73b020aa565a855d23f2f4da2da342c1e1..81016748af10abc2b3ea15109e4d9bb32383cbc3 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -1113,6 +1113,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -1113,6 +1113,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@ -22882,7 +22882,7 @@ index de7afc737b1ab099edc29a4ef94baa76329c2947..2bc0384728f89b7c64a8beec78a1b77d
|
|||||||
|
|
||||||
public static int getVersion(CompoundTag chunkNbt) {
|
public static int getVersion(CompoundTag chunkNbt) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
||||||
index 678bd36581ead3a225e3a6e24b78e5db4e42657b..ff6b25fd21836a080d63f1051b6645ec3d262658 100644
|
index 9b2cec7528936a5d53a926c91063cb6e9ed7da1b..47cda78efcce597d3d7ba8fc93a2865e10cdc237 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
||||||
@@ -148,7 +148,14 @@ public class SectionStorage<R> extends RegionFileStorage implements AutoCloseabl
|
@@ -148,7 +148,14 @@ public class SectionStorage<R> extends RegionFileStorage implements AutoCloseabl
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index 7e7edaebf146d8042e9b75f6088990069ca9021a..0179e519c01897e373f6f9ed4af17dcf4469b762 100644
|
index 81016748af10abc2b3ea15109e4d9bb32383cbc3..edeafd4c671d686c96bffc095fa81b9a4a6723a6 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -2569,6 +2569,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -2569,6 +2569,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Don't log debug logging being disabled
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||||
index 0a53abd88f392fbb33485077aa24df825819d1f2..cd1228e1fbd2434b42df0fd6887d00b9bdb21516 100644
|
index edc5f195cc3de8885b839469656650ba465346be..5d162f59fc5ef9adf7fa762b137bbcfca745d9c5 100644
|
||||||
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
||||||
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||||
@@ -382,7 +382,7 @@ public class SpigotConfig
|
@@ -382,7 +382,7 @@ public class SpigotConfig
|
@ -55,7 +55,7 @@ index 169e2514c5d6942fe28f0deb84540bd4a50f0ece..e25423b46ced54dd6b270d45a3c4502a
|
|||||||
if (chunkHolder.protoChunk != null) {
|
if (chunkHolder.protoChunk != null) {
|
||||||
ProtoChunk protochunk = chunkHolder.protoChunk;
|
ProtoChunk protochunk = chunkHolder.protoChunk;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
|
||||||
index ab9bb440c8e91ecb49c1e14a427d35087a87ac80..400732788820a94acebccb1ad64789e0f6defdb1 100644
|
index 497a81e49d54380713c18523ae8f09f94c453721..210b0cdd4831421c8f43c3d823ac8e962b56bbbc 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
@ -87,7 +87,7 @@ index ab9bb440c8e91ecb49c1e14a427d35087a87ac80..400732788820a94acebccb1ad64789e0
|
|||||||
+ }
|
+ }
|
||||||
+ // Paper end - unload poi data
|
+ // Paper end - unload poi data
|
||||||
private final LongSet loadedChunks = new LongOpenHashSet();
|
private final LongSet loadedChunks = new LongOpenHashSet();
|
||||||
private final net.minecraft.server.level.ServerLevel world; // Paper
|
public final net.minecraft.server.level.ServerLevel world; // Paper // Paper public
|
||||||
|
|
||||||
public PoiManager(Path path, DataFixer dataFixer, boolean dsync, RegistryAccess registryManager, LevelHeightAccessor world) {
|
public PoiManager(Path path, DataFixer dataFixer, boolean dsync, RegistryAccess registryManager, LevelHeightAccessor world) {
|
||||||
super(path, PoiSection::codec, PoiSection::new, dataFixer, DataFixTypes.POI_CHUNK, dsync, registryManager, world);
|
super(path, PoiSection::codec, PoiSection::new, dataFixer, DataFixTypes.POI_CHUNK, dsync, registryManager, world);
|
||||||
@ -213,7 +213,7 @@ index ab9bb440c8e91ecb49c1e14a427d35087a87ac80..400732788820a94acebccb1ad64789e0
|
|||||||
public void add(BlockPos pos, Holder<PoiType> type) {
|
public void add(BlockPos pos, Holder<PoiType> type) {
|
||||||
this.getOrCreate(SectionPos.asLong(pos)).add(pos, type);
|
this.getOrCreate(SectionPos.asLong(pos)).add(pos, type);
|
||||||
}
|
}
|
||||||
@@ -182,8 +312,8 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
@@ -201,8 +331,8 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int sectionsToVillage(SectionPos pos) {
|
public int sectionsToVillage(SectionPos pos) {
|
||||||
@ -224,7 +224,7 @@ index ab9bb440c8e91ecb49c1e14a427d35087a87ac80..400732788820a94acebccb1ad64789e0
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean isVillageCenter(long pos) {
|
boolean isVillageCenter(long pos) {
|
||||||
@@ -198,7 +328,7 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
@@ -217,7 +347,7 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
||||||
@Override
|
@Override
|
||||||
public void tick(BooleanSupplier shouldKeepTicking) {
|
public void tick(BooleanSupplier shouldKeepTicking) {
|
||||||
// Paper start - async chunk io
|
// Paper start - async chunk io
|
||||||
@ -233,7 +233,7 @@ index ab9bb440c8e91ecb49c1e14a427d35087a87ac80..400732788820a94acebccb1ad64789e0
|
|||||||
ChunkPos chunkcoordintpair = SectionPos.of(this.dirty.firstLong()).chunk();
|
ChunkPos chunkcoordintpair = SectionPos.of(this.dirty.firstLong()).chunk();
|
||||||
|
|
||||||
net.minecraft.nbt.CompoundTag data;
|
net.minecraft.nbt.CompoundTag data;
|
||||||
@@ -208,19 +338,24 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
@@ -227,19 +357,24 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
||||||
com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE.scheduleSave(this.world,
|
com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE.scheduleSave(this.world,
|
||||||
chunkcoordintpair.x, chunkcoordintpair.z, data, null, com.destroystokyo.paper.io.PrioritizedTaskQueue.NORMAL_PRIORITY);
|
chunkcoordintpair.x, chunkcoordintpair.z, data, null, com.destroystokyo.paper.io.PrioritizedTaskQueue.NORMAL_PRIORITY);
|
||||||
}
|
}
|
||||||
@ -261,7 +261,7 @@ index ab9bb440c8e91ecb49c1e14a427d35087a87ac80..400732788820a94acebccb1ad64789e0
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void checkConsistencyWithBlocks(ChunkPos chunkPos, LevelChunkSection chunkSection) {
|
public void checkConsistencyWithBlocks(ChunkPos chunkPos, LevelChunkSection chunkSection) {
|
||||||
@@ -278,7 +413,7 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
@@ -297,7 +432,7 @@ public class PoiManager extends SectionStorage<PoiSection> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLevelFromSource(long id) {
|
protected int getLevelFromSource(long id) {
|
||||||
@ -271,7 +271,7 @@ index ab9bb440c8e91ecb49c1e14a427d35087a87ac80..400732788820a94acebccb1ad64789e0
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
||||||
index ff6b25fd21836a080d63f1051b6645ec3d262658..2646c420cb049ead697e1a973f7d023378903afa 100644
|
index 47cda78efcce597d3d7ba8fc93a2865e10cdc237..38287fad39d553a86370bbdc755c0a006615e0cf 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
|
||||||
@@ -58,6 +58,40 @@ public class SectionStorage<R> extends RegionFileStorage implements AutoCloseabl
|
@@ -58,6 +58,40 @@ public class SectionStorage<R> extends RegionFileStorage implements AutoCloseabl
|
Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren