Add in some patches

This commit is contained in:
Spottedleaf 2023-06-08 16:12:34 -07:00
parent cc491a396e
commit 619d7c93d8
634 changed files with 51 additions and 52 deletions
patches/server
0336-Guard-against-serializing-mismatching-chunk-coordina.patch0337-Entity-Activation-Range-2.0.patch0338-Implement-alternative-item-despawn-rate.patch0339-Lag-compensate-eating.patch0340-Tracking-Range-Improvements.patch0341-Fix-items-vanishing-through-end-portal.patch0342-implement-optional-per-player-mob-spawns.patch0343-Bees-get-gravity-in-void.-Fixes-MC-167279.patch0344-Improve-Block-breakNaturally-API.patch0345-Optimise-getChunkAt-calls-for-loaded-chunks.patch0346-Add-debug-for-sync-chunk-loads.patch0347-Remove-garbage-Java-version-check.patch0348-Add-ThrownEggHatchEvent.patch0349-Entity-Jump-API.patch0350-Add-option-to-nerf-pigmen-from-nether-portals.patch0351-Make-the-GUI-graph-fancier.patch0352-add-hand-to-BlockMultiPlaceEvent.patch0353-Validate-tripwire-hook-placement-before-update.patch0354-Add-option-to-allow-iron-golems-to-spawn-in-air.patch0355-Configurable-chance-of-villager-zombie-infection.patch0356-Optimise-Chunk-getFluid.patch0357-Set-spigots-verbose-world-setting-to-false-by-def.patch0358-Add-tick-times-API-and-mspt-command.patch0359-Expose-MinecraftServer-isRunning.patch0360-Add-Raw-Byte-ItemStack-Serialization.patch0361-Pillager-patrol-spawn-settings-and-per-player-option.patch0362-Remote-Connections-shouldn-t-hold-up-shutdown.patch0363-Do-not-allow-bees-to-load-chunks-for-beehives.patch0364-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch0365-Don-t-tick-dead-players.patch0366-Dead-Player-s-shouldn-t-be-able-to-move.patch0367-Optimize-Collision-to-not-load-chunks.patch0368-Don-t-move-existing-players-to-world-spawn.patch0369-Optimize-GoalSelector-Goal.Flag-Set-operations.patch0370-Improved-Watchdog-Support.patch0371-Optimize-Pathfinding.patch0372-Reduce-Either-Optional-allocation.patch0373-Reduce-memory-footprint-of-NBTTagCompound.patch0374-Prevent-opening-inventories-when-frozen.patch0375-Don-t-run-entity-collision-code-if-not-needed.patch0376-Implement-Player-Client-Options-API.patch0377-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch0378-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch0379-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch0380-Add-PlayerAttackEntityCooldownResetEvent.patch0381-Don-t-fire-BlockFade-on-worldgen-threads.patch0382-Add-phantom-creative-and-insomniac-controls.patch0383-Fix-numerous-item-duplication-issues-and-teleport-is.patch0384-Villager-Restocks-API.patch0385-Validate-PickItem-Packet-and-kick-for-invalid.patch0386-Expose-game-version.patch0387-Optimize-Voxel-Shape-Merging.patch0388-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch0389-misc-debugging-dumps.patch0390-Prevent-teleporting-dead-entities.patch0391-Deobfuscate-stacktraces-in-log-messages-crash-report.patch0392-Implement-Mob-Goal-API.patch0393-Add-villager-reputation-API.patch0394-Option-for-maximum-exp-value-when-merging-orbs.patch0395-ExperienceOrbMergeEvent.patch0396-Fix-PotionEffect-ignores-icon-flag.patch0397-Optimize-brigadier-child-sorting-performance.patch0398-Potential-bed-API.patch0399-Wait-for-Async-Tasks-during-shutdown.patch0400-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch0401-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch0402-Reduce-allocation-of-Vec3D-by-entity-tracker.patch0403-Ensure-safe-gateway-teleport.patch0404-Add-option-for-console-having-all-permissions.patch0405-Fix-villager-trading-demand-MC-163962.patch0406-Maps-shouldn-t-load-chunks.patch0407-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch0408-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch0409-Fix-piston-physics-inconsistency-MC-188840.patch0410-Fix-sand-duping.patch0411-Fix-missing-chunks-due-to-integer-overflow.patch0412-Prevent-position-desync-in-playerconnection-causing-.patch0413-Inventory-getHolder-method-without-block-snapshot.patch0414-Improve-Arrow-API.patch0415-Add-and-implement-PlayerRecipeBookClickEvent.patch0416-Hide-sync-chunk-writes-behind-flag.patch0417-Add-permission-for-command-blocks.patch0418-Ensure-Entity-AABB-s-are-never-invalid.patch0419-Fix-Per-World-Difficulty-Remembering-Difficulty.patch0420-Paper-dumpitem-command.patch0421-Improve-Legacy-Component-serialization-size.patch0422-Optimize-Bit-Operations-by-inlining.patch0423-Add-Plugin-Tickets-to-API-Chunk-Methods.patch0424-incremental-chunk-and-player-saving.patch0425-Support-old-UUID-format-for-NBT.patch0426-Clean-up-duplicated-GameProfile-Properties.patch0427-Convert-legacy-attributes-in-Item-Meta.patch0428-Remove-some-streams-from-structures.patch0429-Remove-streams-from-classes-related-villager-gossip.patch0430-Support-components-in-ItemMeta.patch0431-Improve-fix-EntityTargetLivingEntityEvent.patch0432-Add-entity-liquid-API.patch0433-Update-itemstack-legacy-name-and-lore.patch0434-Spawn-player-in-correct-world-on-login.patch0435-Add-PrepareResultEvent.patch

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Guard against serializing mismatching chunk coordinate
Should help if something dumb happens
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
index f9dd2d9312297a727344d43150c5cab74128cbca..b1c5e5ecf2488d1a6f0a5261d4ba8958de9659ae 100644
index a7ee469bb2880a78540b79ae691ea449dfe22ce4..0d8cfc0808a8f204d57cec40929b489099eca815 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
@@ -94,6 +94,18 @@ public class ChunkSerializer {
@ -28,9 +28,9 @@ index f9dd2d9312297a727344d43150c5cab74128cbca..b1c5e5ecf2488d1a6f0a5261d4ba8958
// Paper start
public static final class InProgressChunkHolder {
@@ -119,7 +131,7 @@ public class ChunkSerializer {
@@ -115,7 +127,7 @@ public class ChunkSerializer {
public static InProgressChunkHolder loadChunk(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt, boolean distinguish) {
java.util.ArrayDeque<Runnable> 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
@ -38,7 +38,7 @@ index f9dd2d9312297a727344d43150c5cab74128cbca..b1c5e5ecf2488d1a6f0a5261d4ba8958
if (!Objects.equals(chunkPos, chunkcoordintpair1)) {
ChunkSerializer.LOGGER.error("Chunk file at {} is in the wrong location; relocating. (Expected {}, got {})", new Object[]{chunkPos, chunkPos, chunkcoordintpair1});
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
index 35115f79825035ff28bdffa26ad4127fec8d05c1..10603eebf36caca7870e9cf087e99d529550ad3e 100644
index b4e7c9b317d532d4915932f8f79dfebf2b63ff16..e4b3a70ff9f906a10f2ba3c07642193ca3269db7 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
@@ -178,6 +178,13 @@ public class ChunkStorage implements AutoCloseable {
@ -46,7 +46,7 @@ index 35115f79825035ff28bdffa26ad4127fec8d05c1..10603eebf36caca7870e9cf087e99d52
// 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)));

View file

@ -7,10 +7,10 @@ When the server is lagging, players will wait longer when eating.
Change to also use a time check instead if it passes.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 5eaedecd2e53bcdc30defbf56d6a70a0c49f03ec..38a5d219713f7d3bb3d5ea73e4e6756a03128d01 100644
index a897ed99e7a643244fbe6f0ba1afc1bc15bb8d8d..a1c8558db314ea34ad483f7f6f70c1833b57b669 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3552,6 +3552,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3601,6 +3601,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 2) > 0 ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;
}
@ -21,23 +21,22 @@ index 5eaedecd2e53bcdc30defbf56d6a70a0c49f03ec..38a5d219713f7d3bb3d5ea73e4e6756a
+
private void updatingUsingItem() {
if (this.isUsingItem()) {
if (ItemStack.isSame(this.getItemInHand(this.getUsedItemHand()), this.useItem)) {
@@ -3569,8 +3574,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (this.shouldTriggerItemUseEffects()) {
if (ItemStack.isSameItem(this.getItemInHand(this.getUsedItemHand()), this.useItem)) {
@@ -3619,7 +3624,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
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();
}
@@ -3618,7 +3627,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3667,7 +3677,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (!itemstack.isEmpty() && !this.isUsingItem() || forceUpdate) { // Paper use override flag
this.useItem = itemstack;
@ -46,10 +45,10 @@ index 5eaedecd2e53bcdc30defbf56d6a70a0c49f03ec..38a5d219713f7d3bb3d5ea73e4e6756a
+ 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);
@@ -3643,7 +3655,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3692,7 +3705,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
} else if (!this.isUsingItem() && !this.useItem.isEmpty()) {
this.useItem = ItemStack.EMPTY;
@ -61,7 +60,7 @@ index 5eaedecd2e53bcdc30defbf56d6a70a0c49f03ec..38a5d219713f7d3bb3d5ea73e4e6756a
}
}
@@ -3777,7 +3792,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3825,7 +3841,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
this.useItem = ItemStack.EMPTY;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Entity Jump API
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index a897ed99e7a643244fbe6f0ba1afc1bc15bb8d8d..574f8db51202c6686e7703f3193d63a1a4fefb65 100644
index a1c8558db314ea34ad483f7f6f70c1833b57b669..55d8856e5fdeee4d38e49f5d4a252cf61212e5cb 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3262,8 +3262,10 @@ public abstract class LivingEntity extends Entity implements Attackable {

View file

@ -12,7 +12,7 @@ The entity's current team collision rule causes them to NEVER collide.
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 574f8db51202c6686e7703f3193d63a1a4fefb65..6fbd1209edf59dab9cc8b0f568f2d31846264457 100644
index 55d8856e5fdeee4d38e49f5d4a252cf61212e5cb..6bd0dcba534926716e26da6c171737ff1bc91ea7 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3377,10 +3377,24 @@ public abstract class LivingEntity extends Entity implements Attackable {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 6fbd1209edf59dab9cc8b0f568f2d31846264457..934c5246f43566a7277b77d0e74b38fc94c6836f 100644
index 6bd0dcba534926716e26da6c171737ff1bc91ea7..909ff425123228437cf3ab39c6733cd0a6dd2ef1 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2169,7 +2169,16 @@ public abstract class LivingEntity extends Entity implements Attackable {

View file

@ -80,7 +80,7 @@ index 997f73e86d62b546e363382a3126bc43b4b17b7f..909d0c96840724033bd907560db46d4c
public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 934c5246f43566a7277b77d0e74b38fc94c6836f..d9ee22bbd654a2f39c443262b4a11f997ed1559e 100644
index 909ff425123228437cf3ab39c6733cd0a6dd2ef1..258d055a368629154ab149813881e130fc51f698 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1688,9 +1688,9 @@ public abstract class LivingEntity extends Entity implements Attackable {

Some files were not shown because too many files have changed in this diff Show more