Skip to content

Commit f918c49

Browse files
committed
Update to 26.3-pre-3
1 parent 837b4ff commit f918c49

9 files changed

Lines changed: 71 additions & 68 deletions

File tree

‎gradle.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group=io.papermc.paper
2-
mcVersion=26.3-pre-2
2+
mcVersion=26.3-pre-3
33
# This is the current API version for use in (paper-)plugin.yml files
44
# During snapshot cycles this should be the anticipated version of the release target
55
apiVersion=26.3

‎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.3-pre-2+build.2")
17+
mache("io.papermc:mache:26.3-pre-3+build.1")
1818
paperclip("io.papermc:paperclip:3.0.4")
1919
}
2020

‎paper-server/patches/sources/net/minecraft/server/level/ServerPlayerGameMode.java.patch‎

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@
9191
final BlockPos pos, final ServerboundPlayerActionPacket.Action action, final Direction direction, final int maxY, final int sequence
9292
) {
9393
if (!this.player.isWithinBlockInteractionRange(pos, 1.0)) {
94-
+ if (true) return; // Paper - Don't allow digging into unloaded chunks; Don't notify if unreasonably far away
95-
this.debugLogging(pos, false, sequence, "too far");
96-
} else if (pos.getY() > maxY) {
97-
this.player.connection.send(new ClientboundBlockUpdatePacket(pos, this.level.getBlockState(pos)));
98-
@@ -178,16 +_,35 @@
94+
+ if (true) return; // Paper - Don't allow digging into unloaded chunks; Don't notify if unreasonably far away // TODO - snapshot - revisit now that there is logic involved here
95+
if (this.isDestroyingBlock && action == ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK) {
96+
this.abortDestroyBlock(pos, sequence);
97+
}
98+
@@ -182,16 +_,35 @@
9999
}
100100

101101
if (!this.level.mayInteract(this.player, pos)) {
@@ -133,7 +133,7 @@
133133
if (this.player.blockActionRestricted(this.level, pos, this.gameModeForPlayer)) {
134134
this.player.connection.send(new ClientboundBlockUpdatePacket(pos, this.level.getBlockState(pos)));
135135
this.debugLogging(pos, false, sequence, "block action restricted");
136-
@@ -197,7 +_,7 @@
136+
@@ -201,7 +_,7 @@
137137
this.destroyProgressStart = this.gameTicks;
138138
float progress = 1.0F;
139139
BlockState blockState = this.level.getBlockState(pos);
@@ -142,7 +142,7 @@
142142
EnchantmentHelper.onHitBlock(
143143
this.level,
144144
this.player.getMainHandItem(),
145-
@@ -212,6 +_,23 @@
145+
@@ -216,6 +_,23 @@
146146
progress = blockState.getDestroyProgress(this.player, this.player.level(), pos);
147147
}
148148

@@ -166,32 +166,32 @@
166166
if (!blockState.isAir() && progress >= 1.0F) {
167167
this.destroyAndAck(pos, sequence, "insta mine");
168168
} else {
169-
@@ -255,14 +_,22 @@
170-
this.debugLogging(pos, true, sequence, "stopped destroying");
171-
} else if (action == ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK) {
172-
this.isDestroyingBlock = false;
173-
- if (!Objects.equals(this.destroyPos, pos)) {
174-
- LOGGER.warn("Mismatch in destroy block pos: {} {}", this.destroyPos, pos);
175-
+ // Paper start - Don't allow digging into unloaded chunks
176-
+ if (!Objects.equals(this.destroyPos, pos) && !BlockPos.ZERO.equals(this.destroyPos)) { // Paper
177-
+ ServerPlayerGameMode.LOGGER.debug("Mismatch in destroy block pos: {} {}", this.destroyPos, pos); // CraftBukkit - SPIGOT-5457 sent by client when interact event cancelled
178-
+ BlockState destroyState = this.level.getBlockStateIfLoaded(this.destroyPos); // Don't load unloaded chunks for stale records here
179-
+ if (destroyState != null) {
180-
this.level.destroyBlockProgress(this.player.getId(), this.destroyPos, -1);
181-
this.debugLogging(pos, true, sequence, "aborted mismatched destroying");
182-
+ }
183-
+ this.destroyPos = BlockPos.ZERO;
184-
+ // Paper end - Don't allow digging into unloaded chunks
185-
}
169+
@@ -265,14 +_,22 @@
186170

187-
this.level.destroyBlockProgress(this.player.getId(), pos, -1);
188-
this.debugLogging(pos, true, sequence, "aborted destroying");
189-
+
190-
+ org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDamageAbortEvent(this.player, pos, this.player.getInventory().getSelectedItem()); // CraftBukkit
191-
}
171+
private void abortDestroyBlock(final BlockPos pos, final int sequence) {
172+
this.isDestroyingBlock = false;
173+
- if (!Objects.equals(this.destroyPos, pos)) {
174+
- LOGGER.warn("Mismatch in destroy block pos: {} {}", this.destroyPos, pos);
175+
+ // Paper start - Don't allow digging into unloaded chunks
176+
+ if (!Objects.equals(this.destroyPos, pos) && !BlockPos.ZERO.equals(this.destroyPos)) { // Paper
177+
+ ServerPlayerGameMode.LOGGER.debug("Mismatch in destroy block pos: {} {}", this.destroyPos, pos); // CraftBukkit - SPIGOT-5457 sent by client when interact event cancelled
178+
+ BlockState destroyState = this.level.getBlockStateIfLoaded(this.destroyPos); // Don't load unloaded chunks for stale records here
179+
+ if (destroyState != null) {
180+
this.level.destroyBlockProgress(this.player.getId(), this.destroyPos, -1);
181+
this.debugLogging(pos, true, sequence, "aborted mismatched destroying");
182+
+ }
183+
+ this.destroyPos = BlockPos.ZERO;
184+
+ // Paper end - Don't allow digging into unloaded chunks
192185
}
186+
187+
this.level.destroyBlockProgress(this.player.getId(), pos, -1);
188+
this.debugLogging(pos, true, sequence, "aborted destroying");
189+
+
190+
+ org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDamageAbortEvent(this.player, pos, this.player.getInventory().getSelectedItem()); // CraftBukkit
193191
}
194-
@@ -278,13 +_,53 @@
192+
193+
public void destroyAndAck(final BlockPos pos, final int sequence, final String exitId) {
194+
@@ -286,13 +_,53 @@
195195

196196
public boolean destroyBlock(final BlockPos pos) {
197197
BlockState state = this.level.getBlockState(pos);
@@ -248,7 +248,7 @@
248248
this.level.sendBlockUpdated(pos, state, state, Block.UPDATE_ALL);
249249
return false;
250250
}
251-
@@ -293,6 +_,10 @@
251+
@@ -301,6 +_,10 @@
252252
return false;
253253
}
254254

@@ -259,7 +259,7 @@
259259
BlockState adjustedState = block.playerWillDestroy(this.level, pos, state, this.player);
260260
boolean changed = this.level.removeBlock(pos, false);
261261
if (SharedConstants.DEBUG_BLOCK_BREAK) {
262-
@@ -303,17 +_,38 @@
262+
@@ -311,17 +_,38 @@
263263
block.destroy(this.level, pos, adjustedState);
264264
}
265265

@@ -305,15 +305,15 @@
305305

306306
return true;
307307
}
308-
@@ -329,6 +_,7 @@
308+
@@ -337,6 +_,7 @@
309309

310310
int oldCount = itemStack.getCount();
311311
int oldDamage = itemStack.getDamageValue();
312312
+ final ItemStack stackBeforeUse = itemStack.copy(); // Paper - Store stack before use for interact prediction check
313313
InteractionResult result = itemStack.use(level, player, hand);
314314
ItemStack resultStack;
315315
if (result instanceof InteractionResult.Success success) {
316-
@@ -357,25 +_,70 @@
316+
@@ -365,25 +_,70 @@
317317
}
318318

319319
if (!player.isUsingItem()) {
@@ -387,7 +387,7 @@
387387
return InteractionResult.CONSUME;
388388
}
389389

390-
@@ -416,7 +_,7 @@
390+
@@ -424,7 +_,7 @@
391391
}
392392
}
393393

@@ -396,7 +396,7 @@
396396
UseOnContext context = new UseOnContext(player, hand, hitResult);
397397
InteractionResult result;
398398
if (player.hasInfiniteMaterials()) {
399-
@@ -439,6 +_,11 @@
399+
@@ -447,6 +_,11 @@
400400

401401
return result;
402402
} else {

‎paper-server/patches/sources/net/minecraft/util/Util.java.patch‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/net/minecraft/util/Util.java
22
+++ b/net/minecraft/util/Util.java
3-
@@ -104,9 +_,25 @@
3+
@@ -103,9 +_,25 @@
44
private static final int DEFAULT_MAX_THREADS = 255;
55
private static final int DEFAULT_SAFE_FILE_OPERATION_RETRIES = 10;
66
private static final String MAX_THREADS_SYSTEM_PROPERTY = "max.bg.threads";
@@ -28,15 +28,15 @@
2828
private static final DateTimeFormatter FILENAME_DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH.mm.ss", Locale.ROOT);
2929
public static final int LINEAR_LOOKUP_THRESHOLD = 8;
3030
private static final Set<String> ALLOWED_UNTRUSTED_LINK_PROTOCOLS = Set.of("http", "https");
31-
@@ -148,6 +_,7 @@
31+
@@ -147,6 +_,7 @@
3232
escaper.addEscape('\\', "\\\\");
3333
}).build();
3434
private static Consumer<String> thePauser = msg -> {};
3535
+ public static final double COLLISION_EPSILON = 1.0E-7; // Paper - Check distance in entity interactions
3636

3737
public static <K, V> Collector<Entry<? extends K, ? extends V>, ?, Map<K, V>> toMap() {
3838
return Collectors.toMap(Entry::getKey, Entry::getValue);
39-
@@ -183,7 +_,7 @@
39+
@@ -182,7 +_,7 @@
4040
}
4141

4242
public static long getNanos() {
@@ -45,7 +45,7 @@
4545
}
4646

4747
public static long getEpochMillis() {
48-
@@ -198,9 +_,10 @@
48+
@@ -197,9 +_,10 @@
4949
return FILENAME_DATE_TIME_FORMATTER.format(ZonedDateTime.now());
5050
}
5151

@@ -58,7 +58,7 @@
5858
if (threads <= 0) {
5959
executor = MoreExecutors.newDirectExecutorService();
6060
} else {
61-
@@ -225,16 +_,30 @@
61+
@@ -224,16 +_,30 @@
6262
super.onTermination(exception);
6363
}
6464
};
@@ -91,7 +91,7 @@
9191
}
9292

9393
private static int getMaxThreads() {
94-
@@ -283,6 +_,21 @@
94+
@@ -282,6 +_,21 @@
9595
return thread;
9696
}));
9797
}

‎paper-server/patches/sources/net/minecraft/util/datafix/DataFixers.java.patch‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/net/minecraft/util/datafix/DataFixers.java
22
+++ b/net/minecraft/util/datafix/DataFixers.java
3-
@@ -568,6 +_,24 @@
3+
@@ -569,6 +_,24 @@
44
Schema v1456 = fixerUpper.addSchema(1456, SAME_NAMESPACED);
55
fixerUpper.addFixer(new EntityItemFrameDirectionFix(v1456, false));
66
Schema v1458 = fixerUpper.addSchema(1458, V1458::new);

‎paper-server/patches/sources/net/minecraft/world/entity/item/FallingBlockEntity.java.patch‎

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
--- a/net/minecraft/world/entity/item/FallingBlockEntity.java
22
+++ b/net/minecraft/world/entity/item/FallingBlockEntity.java
3-
@@ -73,6 +_,7 @@
3+
@@ -74,6 +_,7 @@
44
public @Nullable CompoundTag blockData;
55
public boolean forceTickAfterTeleportToDuplicate;
66
protected static final EntityDataAccessor<BlockPos> DATA_START_POS = SynchedEntityData.defineId(FallingBlockEntity.class, EntityDataSerializers.BLOCK_POS);
77
+ public boolean autoExpire = true; // Paper - Expand FallingBlock API
88

99
public FallingBlockEntity(final EntityType<? extends FallingBlockEntity> type, final Level level) {
1010
super(type, level);
11-
@@ -98,6 +_,7 @@
11+
@@ -99,6 +_,7 @@
1212
pos.getZ() + 0.5,
1313
state.hasProperty(BlockStateProperties.WATERLOGGED) ? state.setValue(BlockStateProperties.WATERLOGGED, false) : state
1414
);
1515
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, state.getFluidState().createLegacyBlock())) return entity; // CraftBukkit
1616
level.setBlockAndUpdate(pos, state.getFluidState().createLegacyBlock());
1717
level.addFreshEntity(entity);
1818
return entity;
19-
@@ -148,13 +_,22 @@
19+
@@ -149,13 +_,22 @@
2020
@Override
2121
public void tick() {
2222
if (this.blockState.isAir()) {
@@ -40,7 +40,7 @@
4040
this.handlePortal();
4141
if (this.level() instanceof ServerLevel serverLevel && (this.isAlive() || this.forceTickAfterTeleportToDuplicate)) {
4242
BlockPos pos = this.blockPosition();
43-
@@ -175,12 +_,12 @@
43+
@@ -176,12 +_,12 @@
4444
}
4545

4646
if (!this.onGround() && !isStuckInWater) {
@@ -55,7 +55,7 @@
5555
}
5656
} else {
5757
BlockState currentState = this.level().getBlockState(pos);
58-
@@ -197,11 +_,17 @@
58+
@@ -198,6 +_,12 @@
5959
this.blockState = this.blockState.setValue(BlockStateProperties.WATERLOGGED, true);
6060
}
6161

@@ -68,13 +68,16 @@
6868
if (this.level().setBlockAndUpdate(pos, this.blockState)) {
6969
serverLevel.getChunkSource()
7070
.chunkMap
71-
.sendToTrackingPlayers(this, new ClientboundBlockUpdatePacket(pos, this.level().getBlockState(pos)));
71+
@@ -205,7 +_,7 @@
72+
serverLevel.getChunkSource()
73+
.chunkMap
74+
.sendToTrackingPlayers(this, new ClientboundAddTransientBlockPacket(pos, this.level().getBlockState(pos)));
7275
- this.discard();
7376
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
7477
if (block instanceof Fallable fallable) {
7578
fallable.onLand(this.level(), pos, this.blockState, currentState, this);
7679
}
77-
@@ -226,19 +_,19 @@
80+
@@ -230,19 +_,19 @@
7881
}
7982
}
8083
} else if (this.dropItem && serverLevel.getGameRules().get(GameRules.ENTITY_DROPS)) {
@@ -97,15 +100,15 @@
97100
this.callOnBrokenAfterFall(block, pos);
98101
}
99102
}
100-
@@ -299,6 +_,7 @@
103+
@@ -303,6 +_,7 @@
101104
}
102105

103106
output.putBoolean("CancelDrop", this.cancelDrop);
104107
+ if (!this.autoExpire) output.putBoolean("Paper.AutoExpire", false); // Paper - Expand FallingBlock API
105108
}
106109

107110
@Override
108-
@@ -310,8 +_,9 @@
111+
@@ -314,8 +_,9 @@
109112
this.fallDamagePerDistance = input.getFloatOr("FallHurtAmount", 0.0F);
110113
this.fallDamageMax = input.getIntOr("FallHurtMax", 40);
111114
this.dropItem = input.getBooleanOr("DropItem", true);
@@ -116,7 +119,7 @@
116119
}
117120

118121
public void setHurtsEntities(final float damagePerDistance, final int damageMax) {
119-
@@ -367,7 +_,7 @@
122+
@@ -371,7 +_,7 @@
120123
ResourceKey<Level> oldDimension = this.level().dimension();
121124
boolean fromOrToEnd = (oldDimension == Level.END || newDimension == Level.END) && oldDimension != newDimension;
122125
Entity newEntity = super.teleport(transition);

‎paper-server/patches/sources/net/minecraft/world/entity/npc/villager/Villager.java.patch‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
+ // CraftBukkit end
1414
}
1515

16-
this.resendOffersToTradingPlayer();
17-
@@ -401,7 +_,12 @@
16+
Player tradingPlayer = this.getTradingPlayer();
17+
@@ -390,7 +_,12 @@
1818
int missedUpdates = 2 - this.numberOfRestocksToday;
1919
if (missedUpdates > 0) {
2020
for (MerchantOffer offer : this.getOffers()) {
@@ -28,14 +28,14 @@
2828
}
2929
}
3030

31-
@@ -426,6 +_,7 @@
32-
boolean offersChanged = false;
31+
@@ -418,6 +_,7 @@
32+
MerchantOffers merchantOffers = this.getOffers();
3333

34-
for (MerchantOffer offer : this.getOffers()) {
34+
for (MerchantOffer offer : merchantOffers) {
3535
+ if (offer.ignoreDiscounts) continue; // Paper - Add ignore discounts API
3636
if (reputation != 0) {
3737
offer.addToSpecialPriceDiff(-Mth.floor(reputation * offer.getPriceMultiplier()));
38-
offersChanged = true;
38+
}
3939
@@ -562,14 +_,14 @@
4040
if (this.shouldIncreaseLevel()) {
4141
if (this.level() instanceof ServerLevel serverLevel) {
@@ -112,17 +112,17 @@
112112
if (SharedConstants.DEBUG_UNLOCK_ALL_TRADES && data.level() < 5) {
113113
this.increaseMerchantCareer(level);
114114
}
115-
@@ -818,7 +_,9 @@
115+
@@ -817,7 +_,9 @@
116+
if (tradingPlayer != null) {
116117
this.updateSpecialPrices(tradingPlayer);
117-
this.resendOffersToTradingPlayer();
118118
}
119119
+ return true; // Paper - More vanilla friendly methods to update trades
120120
}
121121
+ return false; // Paper - More vanilla friendly methods to update trades
122122
}
123123

124124
public void gossip(final ServerLevel level, final Villager target, final long timestamp) {
125-
@@ -855,7 +_,7 @@
125+
@@ -853,7 +_,7 @@
126126
.limit(5L)
127127
.toList();
128128
if (nearbyVillagersThatWantAGolem.size() >= villagersNeededToAgree) {
@@ -131,7 +131,7 @@
131131
EntityTypes.IRON_GOLEM,
132132
EntitySpawnReason.MOB_SUMMONED,
133133
level,
134-
@@ -864,9 +_,11 @@
134+
@@ -862,9 +_,11 @@
135135
8,
136136
6,
137137
SpawnUtil.Strategy.LEGACY_IRON_GOLEM,

‎paper-server/patches/sources/net/minecraft/world/inventory/MerchantResultSlot.java.patch‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/net/minecraft/world/inventory/MerchantResultSlot.java
22
+++ b/net/minecraft/world/inventory/MerchantResultSlot.java
3-
@@ -47,13 +_,34 @@
3+
@@ -59,13 +_,34 @@
44

55
@Override
66
public void onTake(final Player player, final ItemStack carried) {

‎paper-server/patches/sources/net/minecraft/world/level/block/CampfireBlock.java.patch‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/net/minecraft/world/level/block/CampfireBlock.java
22
+++ b/net/minecraft/world/level/block/CampfireBlock.java
3-
@@ -116,8 +_,9 @@
3+
@@ -117,8 +_,9 @@
44
final InsideBlockEffectApplier effectApplier,
55
final boolean isPrecise
66
) {
@@ -11,7 +11,7 @@
1111
}
1212

1313
super.entityInside(state, level, pos, entity, effectApplier, isPrecise);
14-
@@ -228,6 +_,11 @@
14+
@@ -229,6 +_,11 @@
1515
&& projectile.mayInteract(serverLevel, pos)
1616
&& !state.getValue(LIT)
1717
&& !state.getValue(WATERLOGGED)) {

0 commit comments

Comments
 (0)