@@ -23697,7 +23697,7 @@ index 0000000000000000000000000000000000000000..8424cf9d4617b4732d44cc460d25b044
2369723697+
2369823698+}
2369923699diff --git a/net/minecraft/core/Direction.java b/net/minecraft/core/Direction.java
23700- index 4bacdaa64a88007cc81b54a6fdacbba65ec70b20..0759e882ef3fd136ef03058d7cdb9cb0ff9e10df 100644
23700+ index 3f516ffd7a76f1d17daaa865f7446803b8217bcc..240fb1346b721e4aaf8517b01fa205760cee4bbd 100644
2370123701--- a/net/minecraft/core/Direction.java
2370223702+++ b/net/minecraft/core/Direction.java
2370323703@@ -29,7 +29,7 @@ import org.joml.Vector3f;
@@ -23761,12 +23761,12 @@ index 4bacdaa64a88007cc81b54a6fdacbba65ec70b20..0759e882ef3fd136ef03058d7cdb9cb0
2376123761
2376223762 public Quaternionf getRotation() {
2376323763- return switch (this) {
23764- - case DOWN -> new Quaternionf().rotationX((float) Math .PI);
23764+ - case DOWN -> new Quaternionf().rotationX(Mth .PI);
2376523765- case UP -> new Quaternionf();
23766- - case NORTH -> new Quaternionf().rotationXYZ((float) (Math .PI / 2) , 0.0F, (float) Math .PI);
23767- - case SOUTH -> new Quaternionf().rotationX((float) (Math .PI / 2) );
23768- - case WEST -> new Quaternionf().rotationXYZ((float) (Math .PI / 2) , 0.0F, (float) (Math .PI / 2) );
23769- - case EAST -> new Quaternionf().rotationXYZ((float) (Math .PI / 2) , 0.0F, (float) (-Math .PI / 2) );
23766+ - case NORTH -> new Quaternionf().rotationXYZ(Mth .PI / 2.0F , 0.0F, Mth .PI);
23767+ - case SOUTH -> new Quaternionf().rotationX(Mth .PI / 2.0F );
23768+ - case WEST -> new Quaternionf().rotationXYZ(Mth .PI / 2.0F , 0.0F, Mth .PI / 2.0F );
23769+ - case EAST -> new Quaternionf().rotationXYZ(Mth .PI / 2.0F , 0.0F, -Mth .PI / 2.0F );
2377023770- };
2377123771+ // Paper start - optimise collisions
2377223772+ try {
@@ -24595,7 +24595,7 @@ index 60d7c6ddbd179ddaa75a9211bdf8902e4a44285c..3fa0f090edf4c5b4d96a3a9810d8a5ca
2459524595
2459624596 @FunctionalInterface
2459724597diff --git a/net/minecraft/server/level/ChunkLevel.java b/net/minecraft/server/level/ChunkLevel.java
24598- index efa1a630d8b63374d2b3f039700f2e8f761059b2..600f514d8c40230d963200e1c169c41b571839a6 100644
24598+ index 62290d63f44f4fb4e1eb02fb68ba9c34e051a50a..bbb7ca544df9342089d9630e3aa7e70050d3a947 100644
2459924599--- a/net/minecraft/server/level/ChunkLevel.java
2460024600+++ b/net/minecraft/server/level/ChunkLevel.java
2460124601@@ -8,7 +8,7 @@ import org.jspecify.annotations.Nullable;
@@ -28301,7 +28301,7 @@ index 40f97e3657a1672d3865ab915c7f36d3dbf88c6e..b075d7f68a263422cfa1f35b1f896038
2830128301
2830228302 public TicketType getType() {
2830328303diff --git a/net/minecraft/server/level/TicketType.java b/net/minecraft/server/level/TicketType.java
28304- index 6c415347331dc96f0680b5487ca0b2f0a4ad0ef3..5dd7804add1d67e91e6c3638fe20e095034cf2a7 100644
28304+ index 4de90a597bd5c5ac639fd228b3494e70a945d7ff..147cd0458d719be6679b6bac2b6617b48d98ce4c 100644
2830528305--- a/net/minecraft/server/level/TicketType.java
2830628306+++ b/net/minecraft/server/level/TicketType.java
2830728307@@ -7,7 +7,45 @@ import java.lang.annotation.Target;
@@ -28893,7 +28893,7 @@ index 1ceb7e4a3abd4d9de5133d182d3267d2164918f6..eb2fa32cff6824c14f865c8731df7d08
2889328893+ // Paper end - block counting
2889428894 }
2889528895diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
28896- index a480a35b23f38680598cb428bd09b7d1db07af6e..fe197ff989f084b563021ac62984e4710594402e 100644
28896+ index 3d7bc43e3e367a2328601ac6b74f99361b4be57e..f7b4da570ee28b7128b4d2cd1c67b89e3980bced 100644
2889728897--- a/net/minecraft/world/entity/Entity.java
2889828898+++ b/net/minecraft/world/entity/Entity.java
2889928899@@ -167,7 +167,7 @@ public abstract class Entity
@@ -29440,22 +29440,22 @@ index a480a35b23f38680598cb428bd09b7d1db07af6e..fe197ff989f084b563021ac62984e471
2944029440
2944129441 @Override
2944229442diff --git a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
29443- index 05e4a32b7d7fef586b1abd1384650839a0d5371b..99ee30e039636f7577532f5121bf8c89293c3656 100644
29443+ index 3325e7d4827067a65b176c5ba01aa491abd222a5..a8f2b22436ff0f4bff06b2c5cf01375da755cfde 100644
2944429444--- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
2944529445+++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
2944629446@@ -88,12 +88,16 @@ public class AcquirePoi {
2944729447 return true;
2944829448 }
2944929449 };
2945029450- Set<Pair<Holder<PoiType>, BlockPos>> poiPositions = poiManager.findAllClosestFirstWithType(
29451- - poiType, cacheTest, body.blockPosition(), 48 , PoiManager.Occupancy.HAS_SPACE
29451+ - poiType, cacheTest, body.blockPosition(), SCAN_RANGE , PoiManager.Occupancy.HAS_SPACE
2945229452- )
2945329453- .limit(5L)
2945429454- .filter(px -> validPoi.test(level, (BlockPos)px.getSecond()))
2945529455- .collect(Collectors.toSet());
2945629456+ // Paper start - optimise POI searches
2945729457+ java.util.List<Pair<Holder<PoiType>, BlockPos>> poiPositionsRaw = new java.util.ArrayList<>();
29458- + ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.findNearestPoiPositions(poiManager, poiType, cacheTest, body.blockPosition(), 48 , Double.MAX_VALUE, PoiManager.Occupancy.HAS_SPACE, ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.LOAD_FOR_SEARCHING, 5, poiPositionsRaw);
29458+ + ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.findNearestPoiPositions(poiManager, poiType, cacheTest, body.blockPosition(), SCAN_RANGE , Double.MAX_VALUE, PoiManager.Occupancy.HAS_SPACE, ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.LOAD_FOR_SEARCHING, 5, poiPositionsRaw);
2945929459+ Set<Pair<Holder<PoiType>, BlockPos>> poiPositions = new java.util.HashSet<>(poiPositionsRaw.size());
2946029460+ for (Pair<Holder<PoiType>, BlockPos> pair : poiPositionsRaw) {
2946129461+ if (validPoi.test(level, pair.getSecond())) {
@@ -30053,7 +30053,7 @@ index e07a7bda45146686a6ac2d20507df9fc8630514f..f84e651e2a34e76a0a71993332e4be1b
3005330053
3005430054 // Paper start - Affects Spawning API
3005530055diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
30056- index 16ca35249e2248500073bb2b12447d2a0e545b95..86b37a276b33a10efc950243787e85a657b93138 100644
30056+ index b014cb670dc089be42c8546afa2a86625a8c0a82..2569893356946511fc8c29b51220014519f7bad1 100644
3005730057--- a/net/minecraft/world/level/Level.java
3005830058+++ b/net/minecraft/world/level/Level.java
3005930059@@ -87,6 +87,7 @@ import net.minecraft.world.level.storage.LevelData;
@@ -31859,7 +31859,7 @@ index 9404f0b0b03dce54e2c9ad6ca2c36354888cc9f5..a0d7f6f8ecbc320267bdad27315fc2e2
3185931859
3186031860 public interface NoiseBiomeSource {
3186131861diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java
31862- index 63c745431fef5bdcf50f6698fc9594d063ccaf31..2aa2dc0e84401dffdabefa51060c4648e50a4f22 100644
31862+ index 7678701a578d2dc45b35da072a0bb2c027522043..41aab9a526be77b400bed7a74614eceec95345b5 100644
3186331863--- a/net/minecraft/world/level/block/Block.java
3186431864+++ b/net/minecraft/world/level/block/Block.java
3186531865@@ -366,7 +366,7 @@ public class Block extends BlockBehaviour implements ItemLike {
@@ -31872,10 +31872,10 @@ index 63c745431fef5bdcf50f6698fc9594d063ccaf31..2aa2dc0e84401dffdabefa51060c4648
3187231872
3187331873 public void animateTick(final BlockState state, final Level level, final BlockPos pos, final RandomSource random) {
3187431874diff --git a/net/minecraft/world/level/block/state/BlockBehaviour.java b/net/minecraft/world/level/block/state/BlockBehaviour.java
31875- index f212758a7ee7edf7a5a70d2730deccc92f9f101f..a489bc2ccf84040247c5a3e7118c1db7752e74a4 100644
31875+ index e66b04c89c5155f660e3274ebb205cfb72190b1b..ca77680b645c352456744b148e0ff4ac31b05aa2 100644
3187631876--- a/net/minecraft/world/level/block/state/BlockBehaviour.java
3187731877+++ b/net/minecraft/world/level/block/state/BlockBehaviour.java
31878- @@ -434 ,7 +434 ,7 @@ public abstract class BlockBehaviour implements FeatureElement {
31878+ @@ -435 ,7 +435 ,7 @@ public abstract class BlockBehaviour implements FeatureElement {
3187931879 return this.properties.destroyTime;
3188031880 }
3188131881
@@ -31884,7 +31884,7 @@ index f212758a7ee7edf7a5a70d2730deccc92f9f101f..a489bc2ccf84040247c5a3e7118c1db7
3188431884 private static final Direction[] DIRECTIONS = Direction.values();
3188531885 private static final VoxelShape[] EMPTY_OCCLUSION_SHAPES = Util.make(new VoxelShape[DIRECTIONS.length], s -> Arrays.fill(s, Shapes.empty()));
3188631886 private static final VoxelShape[] FULL_BLOCK_OCCLUSION_SHAPES = Util.make(new VoxelShape[DIRECTIONS.length], s -> Arrays.fill(s, Shapes.block()));
31887- @@ -469 ,6 +469 ,76 @@ public abstract class BlockBehaviour implements FeatureElement {
31887+ @@ -470 ,6 +470 ,76 @@ public abstract class BlockBehaviour implements FeatureElement {
3188831888 private boolean propagatesSkylightDown;
3188931889 private int lightDampening;
3189031890
@@ -31961,7 +31961,7 @@ index f212758a7ee7edf7a5a70d2730deccc92f9f101f..a489bc2ccf84040247c5a3e7118c1db7
3196131961 protected BlockStateBase(final Block owner, final Property<?>[] propertyKeys, final Comparable<?>[] propertyValues) {
3196231962 super(owner, propertyKeys, propertyValues);
3196331963 BlockBehaviour.Properties properties = owner.properties;
31964- @@ -546 ,6 +616 ,41 @@ public abstract class BlockBehaviour implements FeatureElement {
31964+ @@ -547 ,6 +617 ,41 @@ public abstract class BlockBehaviour implements FeatureElement {
3196531965
3196631966 this.propagatesSkylightDown = this.owner.propagatesSkylightDown(this.asState());
3196731967 this.lightDampening = this.owner.getLightDampening(this.asState());
0 commit comments