diff --git a/patches/server/Do-not-let-the-server-load-chunks-from-newer-version.patch b/patches/server/Do-not-let-the-server-load-chunks-from-newer-version.patch index 3507317fd0..347e9fbe66 100644 --- a/patches/server/Do-not-let-the-server-load-chunks-from-newer-version.patch +++ b/patches/server/Do-not-let-the-server-load-chunks-from-newer-version.patch @@ -31,5 +31,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } // Paper end - ChunkPos chunkcoordintpair1 = new ChunkPos(nbt.getInt("xPos"), nbt.getInt("zPos")); + ChunkPos chunkcoordintpair1 = new ChunkPos(nbt.getInt("xPos"), nbt.getInt("zPos")); // Paper - diff on change, see ChunkSerializer#getChunkCoordinate diff --git a/patches/unapplied/server/Entity-load-save-limit-per-chunk.patch b/patches/server/Entity-load-save-limit-per-chunk.patch similarity index 100% rename from patches/unapplied/server/Entity-load-save-limit-per-chunk.patch rename to patches/server/Entity-load-save-limit-per-chunk.patch diff --git a/patches/unapplied/server/Guard-against-serializing-mismatching-chunk-coordina.patch b/patches/server/Guard-against-serializing-mismatching-chunk-coordina.patch similarity index 95% rename from patches/unapplied/server/Guard-against-serializing-mismatching-chunk-coordina.patch rename to patches/server/Guard-against-serializing-mismatching-chunk-coordina.patch index 3788aecc03..220b4c2e94 100644 --- a/patches/unapplied/server/Guard-against-serializing-mismatching-chunk-coordina.patch +++ b/patches/server/Guard-against-serializing-mismatching-chunk-coordina.patch @@ -29,8 +29,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static final class InProgressChunkHolder { @@ -0,0 +0,0 @@ public class ChunkSerializer { + public static InProgressChunkHolder loadChunk(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt, boolean distinguish) { - java.util.ArrayDeque tasksToExecuteOnMain = new java.util.ArrayDeque<>(); // Paper end - ChunkPos chunkcoordintpair1 = new ChunkPos(nbt.getInt("xPos"), nbt.getInt("zPos")); + ChunkPos chunkcoordintpair1 = new ChunkPos(nbt.getInt("xPos"), nbt.getInt("zPos")); // Paper - diff on change, see ChunkSerializer#getChunkCoordinate @@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Paper start - async chunk io public void write(ChunkPos chunkPos, CompoundTag nbt) throws IOException { + // Paper start -+ if (!chunkPos.equals(ChunkSerializer.getChunkCoordinate(nbt))) { ++ if (nbt != null && !chunkPos.equals(ChunkSerializer.getChunkCoordinate(nbt))) { + String world = (this instanceof net.minecraft.server.level.ChunkMap) ? ((net.minecraft.server.level.ChunkMap)this).level.getWorld().getName() : null; + throw new IllegalArgumentException("Chunk coordinate and serialized data do not have matching coordinates, trying to serialize coordinate " + chunkPos.toString() + + " but compound says coordinate is " + ChunkSerializer.getChunkCoordinate(nbt).toString() + (world == null ? " for an unknown world" : (" for world: " + world))); diff --git a/patches/unapplied/server/Lag-compensate-eating.patch b/patches/server/Lag-compensate-eating.patch similarity index 90% rename from patches/unapplied/server/Lag-compensate-eating.patch rename to patches/server/Lag-compensate-eating.patch index 5d376c0f44..ccc3076c9b 100644 --- a/patches/unapplied/server/Lag-compensate-eating.patch +++ b/patches/server/Lag-compensate-eating.patch @@ -21,17 +21,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private void updatingUsingItem() { if (this.isUsingItem()) { - if (ItemStack.isSame(this.getItemInHand(this.getUsedItemHand()), this.useItem)) { + if (ItemStack.isSameItem(this.getItemInHand(this.getUsedItemHand()), this.useItem)) { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { - if (this.shouldTriggerItemUseEffects()) { this.triggerItemUseEffects(stack, 5); } -- -- if (--this.useItemRemaining == 0 && !this.level.isClientSide && !stack.useOnRelease()) { + +- if (--this.useItemRemaining == 0 && !this.level().isClientSide && !stack.useOnRelease()) { + // Paper start - lag compensate eating + // we add 1 to the expected time to avoid lag compensating when we should not + boolean shouldLagCompensate = this.useItem.getItem().isEdible() && this.eatStartTime != -1 && (System.nanoTime() - this.eatStartTime) > ((1 + this.totalEatTimeTicks) * 50 * (1000 * 1000)); -+ if ((--this.useItemRemaining == 0 || shouldLagCompensate) && !this.level.isClientSide && !this.useItem.useOnRelease()) { ++ if ((--this.useItemRemaining == 0 || shouldLagCompensate) && !this.level().isClientSide && !stack.useOnRelease()) { + this.useItemRemaining = 0; + // Paper end this.completeUsingItem(); @@ -46,7 +45,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.useItemRemaining = this.totalEatTimeTicks = itemstack.getUseDuration(); + this.eatStartTime = System.nanoTime(); + // Paper end - if (!this.level.isClientSide) { + if (!this.level().isClientSide) { this.setLivingEntityFlag(1, true); this.setLivingEntityFlag(2, hand == InteractionHand.OFF_HAND); @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {