Skip to content

Commit f9da803

Browse files
committed
update unpick definitions
1 parent 4d8d06c commit f9da803

61 files changed

Lines changed: 352 additions & 303 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

paper-server/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ plugins {
1414
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
1515

1616
dependencies {
17-
mache("io.papermc:mache:26.1.1+build.1")
17+
mache("io.papermc:mache:26.1.1+build.3")
1818
paperclip("io.papermc:paperclip:3.0.3")
1919
}
2020

paper-server/patches/features/0001-Moonrise-optimisation-patches.patch

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23697,7 +23697,7 @@ index 0000000000000000000000000000000000000000..8424cf9d4617b4732d44cc460d25b044
2369723697
+
2369823698
+}
2369923699
diff --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
2459724597
diff --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() {
2830328303
diff --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
}
2889528895
diff --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
2944229442
diff --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
3005530055
diff --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 {
3186131861
diff --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) {
3187431874
diff --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());

paper-server/patches/features/0003-Optimize-Connection-and-add-advanced-packet-support.patch

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ and then catch exceptions and close if they fire.
2828
Part of this commit was authored by: Spottedleaf, sandtechnology
2929

3030
diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java
31-
index b1ea3da2f37b247e6b7ebf37c821da27e374dfa6..b18fc4d6fe01db767068b8e05aadae251bc08fa8 100644
31+
index 0bc6ab5e498f82c5b3cbdf8dddfed6c8406ad511..9cd6ec17981da310be1d35054af080d6b33beff8 100644
3232
--- a/net/minecraft/network/Connection.java
3333
+++ b/net/minecraft/network/Connection.java
3434
@@ -65,7 +65,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -219,7 +219,7 @@ index b1ea3da2f37b247e6b7ebf37c821da27e374dfa6..b18fc4d6fe01db767068b8e05aadae25
219219
if (this.channel == null) {
220220
this.delayedDisconnect = details;
221221
}
222-
@@ -713,7 +806,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
222+
@@ -714,7 +807,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
223223
public void handleDisconnection() {
224224
if (this.channel != null && !this.channel.isOpen()) {
225225
if (this.disconnectionHandled) {
@@ -228,7 +228,7 @@ index b1ea3da2f37b247e6b7ebf37c821da27e374dfa6..b18fc4d6fe01db767068b8e05aadae25
228228
} else {
229229
this.disconnectionHandled = true;
230230
PacketListener packetListener = this.getPacketListener();
231-
@@ -724,7 +817,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
231+
@@ -725,7 +818,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
232232
);
233233
disconnectListener.onDisconnect(details);
234234
}
@@ -237,7 +237,7 @@ index b1ea3da2f37b247e6b7ebf37c821da27e374dfa6..b18fc4d6fe01db767068b8e05aadae25
237237
// Paper start - Add PlayerConnectionCloseEvent
238238
if (packetListener instanceof net.minecraft.server.network.ServerCommonPacketListenerImpl commonPacketListener) {
239239
/* Player was logged in, either game listener or configuration listener */
240-
@@ -759,4 +852,96 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
240+
@@ -760,4 +853,96 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
241241
public void setBandwidthLogger(final LocalSampleLogger bandwidthLogger) {
242242
this.bandwidthDebugMonitor = new BandwidthDebugMonitor(bandwidthLogger);
243243
}
@@ -372,10 +372,10 @@ index 1480d0db90f5797e3dee19503e52d1e783493ac3..f6cfce2ce30a426cd57a89f3f8ccf144
372372
+ // Paper end
373373
}
374374
diff --git a/net/minecraft/server/network/ServerConnectionListener.java b/net/minecraft/server/network/ServerConnectionListener.java
375-
index e72bd8239eed69be774373b49cdb05fbf0799030..22276be80b8729884c797b96c93bf0965ca9eed1 100644
375+
index b0445b4ad9adb6d2dec08537559d2ed243ca69bb..b266e4f7b437578356568d86910e3b428ee66523 100644
376376
--- a/net/minecraft/server/network/ServerConnectionListener.java
377377
+++ b/net/minecraft/server/network/ServerConnectionListener.java
378-
@@ -51,11 +51,13 @@ public class ServerConnectionListener {
378+
@@ -52,11 +52,13 @@ public class ServerConnectionListener {
379379

380380
// Paper start - prevent blocking on adding a new connection while the server is ticking
381381
private final java.util.Queue<Connection> pending = new java.util.concurrent.ConcurrentLinkedQueue<>();
@@ -389,11 +389,11 @@ index e72bd8239eed69be774373b49cdb05fbf0799030..22276be80b8729884c797b96c93bf096
389389
}
390390
}
391391
// Paper end - prevent blocking on adding a new connection while the server is ticking
392-
@@ -91,6 +93,7 @@ public class ServerConnectionListener {
392+
@@ -92,6 +94,7 @@ public class ServerConnectionListener {
393393
} catch (ChannelException var5) {
394394
}
395395

396396
+ if (!disableFlushConsolidation) channel.pipeline().addFirst(new io.netty.handler.flush.FlushConsolidationHandler()); // Paper - Optimize network
397-
ChannelPipeline pipeline = channel.pipeline().addLast("timeout", new ReadTimeoutHandler(30));
397+
ChannelPipeline pipeline = channel.pipeline().addLast(HandlerNames.TIMEOUT, new ReadTimeoutHandler(30));
398398
if (ServerConnectionListener.this.server.repliesToStatus()) {
399-
pipeline.addLast("legacy_query", new LegacyQueryHandler(ServerConnectionListener.this.getServer()));
399+
pipeline.addLast(HandlerNames.LEGACY_QUERY, new LegacyQueryHandler(ServerConnectionListener.this.getServer()));

0 commit comments

Comments
 (0)