diff options
author | Nassim Jahnke <[email protected]> | 2024-10-29 22:35:10 +0100 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2024-10-29 22:35:10 +0100 |
commit | fe2f3d46933c9f3dc0e4bda238e5af34b01d2a48 (patch) | |
tree | 2a43f0ab3e7e2019b5229f16f182202a58bcfcfb | |
parent | 1196ab550520c50ea6b9cb173385b8dee57d18de (diff) | |
download | Paper-fe2f3d46933c9f3dc0e4bda238e5af34b01d2a48.tar.gz Paper-fe2f3d46933c9f3dc0e4bda238e5af34b01d2a48.zip |
Fix portal exit resulting in bad teleport transition
27 files changed, 49 insertions, 46 deletions
diff --git a/patches/server/0578-Add-back-EntityPortalExitEvent.patch b/patches/server/0578-Add-back-EntityPortalExitEvent.patch index 2ddd256c17..a082311306 100644 --- a/patches/server/0578-Add-back-EntityPortalExitEvent.patch +++ b/patches/server/0578-Add-back-EntityPortalExitEvent.patch @@ -5,26 +5,28 @@ Subject: [PATCH] Add back EntityPortalExitEvent diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index fe9cdd104d6203233a90068b55e0876be4964afe..8dc2684a748e19e14c3efedf58be5efba99a45b4 100644 +index fe9cdd104d6203233a90068b55e0876be4964afe..96d73407edd440c16d41c8a586797ade30792f46 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3491,7 +3491,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3491,7 +3491,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess if (!this.isRemoved()) { // CraftBukkit start PositionMoveRotation absolutePosition = PositionMoveRotation.calculateAbsolute(PositionMoveRotation.of(this), PositionMoveRotation.of(teleportTarget), teleportTarget.relatives()); - Location to = CraftLocation.toBukkit(absolutePosition.position(), teleportTarget.newLevel().getWorld(), absolutePosition.yRot(), absolutePosition.xRot()); ++ Vec3 velocity = absolutePosition.deltaMovement(); // Paper + Location to = CraftLocation.toBukkit(absolutePosition.position(), teleportTarget.newLevel().getWorld(), absolutePosition.yRot(), this.getXRot()); // Paper - use getXRot (doesn't respect DimensionTransition pitch) // Why? // Paper start - gateway-specific teleport event final EntityTeleportEvent teleEvent; if (this.portalProcess != null && this.portalProcess.isSamePortal(((net.minecraft.world.level.block.EndGatewayBlock) net.minecraft.world.level.block.Blocks.END_GATEWAY)) && this.level.getBlockEntity(this.portalProcess.getEntryPosition()) instanceof net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity theEndGatewayBlockEntity) { -@@ -3508,6 +3508,27 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3507,7 +3508,29 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + if (!to.equals(teleEvent.getTo())) { to = teleEvent.getTo(); teleportTarget = new TeleportTransition(((CraftWorld) to.getWorld()).getHandle(), CraftLocation.toVec3D(to), Vec3.ZERO, to.getYaw(), to.getPitch(), teleportTarget.missingRespawnBlock(), teleportTarget.asPassenger(), Set.of(), teleportTarget.postTeleportTransition(), teleportTarget.cause()); ++ // Paper start - Call EntityPortalExitEvent ++ velocity = Vec3.ZERO; } -+ // Paper start - Call EntityPortalExitEvent + if (this.portalProcess != null) { // if in a portal + CraftEntity bukkitEntity = this.getBukkitEntity(); -+ Vec3 velocity = teleportTarget.deltaMovement(); + org.bukkit.event.entity.EntityPortalExitEvent event = new org.bukkit.event.entity.EntityPortalExitEvent( + bukkitEntity, + bukkitEntity.getLocation(), to.clone(), @@ -32,11 +34,12 @@ index fe9cdd104d6203233a90068b55e0876be4964afe..8dc2684a748e19e14c3efedf58be5efb + ); + event.callEvent(); + -+ if (!event.isCancelled() && event.getTo() != null) { ++ // Only change the target if actually needed, since we reset relative flags ++ if (!event.isCancelled() && event.getTo() != null && (!event.getTo().equals(event.getFrom()) || !event.getAfter().equals(event.getBefore()))) { + to = event.getTo().clone(); + velocity = org.bukkit.craftbukkit.util.CraftVector.toNMS(event.getAfter()); ++ teleportTarget = new TeleportTransition(((CraftWorld) to.getWorld()).getHandle(), CraftLocation.toVec3D(to), velocity, to.getYaw(), to.getPitch(), teleportTarget.missingRespawnBlock(), teleportTarget.asPassenger(), Set.of(), teleportTarget.postTeleportTransition(), teleportTarget.cause()); + } -+ teleportTarget = new TeleportTransition(((CraftWorld) to.getWorld()).getHandle(), CraftLocation.toVec3D(to), velocity, to.getYaw(), to.getPitch(), teleportTarget.missingRespawnBlock(), teleportTarget.asPassenger(), Set.of(), teleportTarget.postTeleportTransition(), teleportTarget.cause()); + } + if (this.isRemoved()) { + return null; diff --git a/patches/server/0589-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0589-Add-Raw-Byte-Entity-Serialization.patch index 0b866c52fb..24a102b9d6 100644 --- a/patches/server/0589-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/server/0589-Add-Raw-Byte-Entity-Serialization.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Add Raw Byte Entity Serialization public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 8dc2684a748e19e14c3efedf58be5efba99a45b4..11b3a0ece27cb2c01b908a9ac0c3d75f407f5ed0 100644 +index 96d73407edd440c16d41c8a586797ade30792f46..66b1711a4e05270f15703229459f4bebb2fb19b7 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2260,6 +2260,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0615-Update-head-rotation-in-missing-places.patch b/patches/server/0615-Update-head-rotation-in-missing-places.patch index c1f529129d..d24623bdc1 100644 --- a/patches/server/0615-Update-head-rotation-in-missing-places.patch +++ b/patches/server/0615-Update-head-rotation-in-missing-places.patch @@ -8,7 +8,7 @@ This is because bukkit uses a separate head rotation field for yaw. This issue only applies to players. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 11b3a0ece27cb2c01b908a9ac0c3d75f407f5ed0..7b01d1cd5db771a1b6ee030664070ffb75579a4c 100644 +index 66b1711a4e05270f15703229459f4bebb2fb19b7..58949beb5fcdc1618674f206feb90d0f5335c67f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1914,6 +1914,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0621-don-t-attempt-to-teleport-dead-entities.patch b/patches/server/0621-don-t-attempt-to-teleport-dead-entities.patch index 89c8f26c2c..7963ba88c5 100644 --- a/patches/server/0621-don-t-attempt-to-teleport-dead-entities.patch +++ b/patches/server/0621-don-t-attempt-to-teleport-dead-entities.patch @@ -5,7 +5,7 @@ Subject: [PATCH] don't attempt to teleport dead entities diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7b01d1cd5db771a1b6ee030664070ffb75579a4c..34cbb7c48535da774527b40f2e99f6f1d31c377d 100644 +index 58949beb5fcdc1618674f206feb90d0f5335c67f..1cb02ee453133f6f019887ec02d2d2aca958a959 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -713,7 +713,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0631-Forward-CraftEntity-in-teleport-command.patch b/patches/server/0631-Forward-CraftEntity-in-teleport-command.patch index 908c465129..2571079836 100644 --- a/patches/server/0631-Forward-CraftEntity-in-teleport-command.patch +++ b/patches/server/0631-Forward-CraftEntity-in-teleport-command.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Forward CraftEntity in teleport command diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 34cbb7c48535da774527b40f2e99f6f1d31c377d..3df8cfccba9bc4420b37dcbdfc4a12c720b51205 100644 +index 1cb02ee453133f6f019887ec02d2d2aca958a959..f2dbeb6b1bdcd447b24fb06279301bcbca489511 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -3480,6 +3480,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -22,7 +22,7 @@ index 34cbb7c48535da774527b40f2e99f6f1d31c377d..3df8cfccba9bc4420b37dcbdfc4a12c7 CompoundTag nbttagcompound = original.saveWithoutId(new CompoundTag()); nbttagcompound.remove("Dimension"); -@@ -3615,8 +3622,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3617,8 +3624,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess entity.restoreFrom(this); this.removeAfterChangingDimensions(); // CraftBukkit start - Forward the CraftEntity to the new entity diff --git a/patches/server/0650-Freeze-Tick-Lock-API.patch b/patches/server/0650-Freeze-Tick-Lock-API.patch index f658b3b299..c882f88035 100644 --- a/patches/server/0650-Freeze-Tick-Lock-API.patch +++ b/patches/server/0650-Freeze-Tick-Lock-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Freeze Tick Lock API diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3df8cfccba9bc4420b37dcbdfc4a12c720b51205..4f9ebf7a577223d85ceaad0babd2d0b4f492b6df 100644 +index f2dbeb6b1bdcd447b24fb06279301bcbca489511..954c70b45a0d96d16332424a7d31e4241088601f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -414,6 +414,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0680-Ensure-entity-passenger-world-matches-ridden-entity.patch b/patches/server/0680-Ensure-entity-passenger-world-matches-ridden-entity.patch index 62372a6087..184e75059a 100644 --- a/patches/server/0680-Ensure-entity-passenger-world-matches-ridden-entity.patch +++ b/patches/server/0680-Ensure-entity-passenger-world-matches-ridden-entity.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Ensure entity passenger world matches ridden entity Bad plugins doing this would cause some obvious problems... diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 4f9ebf7a577223d85ceaad0babd2d0b4f492b6df..a4a07dc11edf3738698deed929cc224ff7114684 100644 +index 954c70b45a0d96d16332424a7d31e4241088601f..47e7405db3f8cfd674ec7704e8d40b628e94678b 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2802,7 +2802,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0701-Prevent-entity-loading-causing-async-lookups.patch b/patches/server/0701-Prevent-entity-loading-causing-async-lookups.patch index 97d528c05a..3d298a96af 100644 --- a/patches/server/0701-Prevent-entity-loading-causing-async-lookups.patch +++ b/patches/server/0701-Prevent-entity-loading-causing-async-lookups.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent entity loading causing async lookups diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index a4a07dc11edf3738698deed929cc224ff7114684..73428cefa737e430c3c8c0d59e1fa763114b8c5a 100644 +index 47e7405db3f8cfd674ec7704e8d40b628e94678b..f13b9050c4de9ddc7a8620b89478df20bccafe06 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -724,6 +724,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0713-Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/0713-Add-various-missing-EntityDropItemEvent-calls.patch index 8e1fc7a091..758e8905c2 100644 --- a/patches/server/0713-Add-various-missing-EntityDropItemEvent-calls.patch +++ b/patches/server/0713-Add-various-missing-EntityDropItemEvent-calls.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add various missing EntityDropItemEvent calls diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 73428cefa737e430c3c8c0d59e1fa763114b8c5a..619879bc0a05e16d450b4f7bb766b371e986193c 100644 +index f13b9050c4de9ddc7a8620b89478df20bccafe06..73882f5b5a25779841b3a8fe507bbb92cf113691 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2672,6 +2672,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0754-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch b/patches/server/0754-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch index ab6fac6da3..231d47c34b 100644 --- a/patches/server/0754-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch +++ b/patches/server/0754-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix EntityCombustEvent cancellation cant fully prevent diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 619879bc0a05e16d450b4f7bb766b371e986193c..8aabd17178543eab0724a05226e4741ead85ea87 100644 +index 73882f5b5a25779841b3a8fe507bbb92cf113691..eeefe0a8f36618d6df513d9ea5443e222ae8826e 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -3320,6 +3320,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0767-Player-Entity-Tracking-Events.patch b/patches/server/0767-Player-Entity-Tracking-Events.patch index 5b5c2566a0..fd7aeb4e06 100644 --- a/patches/server/0767-Player-Entity-Tracking-Events.patch +++ b/patches/server/0767-Player-Entity-Tracking-Events.patch @@ -21,10 +21,10 @@ index 51a6735b35e73175680e61c2d67d4adbedf305c9..8b5d11aceb77135c917c3581f4db792e } else if (this.seenBy.remove(player.connection)) { this.serverEntity.removePairing(player); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 8aabd17178543eab0724a05226e4741ead85ea87..47a2cd3ea7c88681929351c6db9090149e2c4f2e 100644 +index eeefe0a8f36618d6df513d9ea5443e222ae8826e..149852c5ed532c1bbb4f647c0988d282915fa43d 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4069,7 +4069,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4071,7 +4071,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public void startSeenByPlayer(ServerPlayer player) {} diff --git a/patches/server/0774-Improve-PortalEvents.patch b/patches/server/0774-Improve-PortalEvents.patch index a4cf96f882..dc475e1825 100644 --- a/patches/server/0774-Improve-PortalEvents.patch +++ b/patches/server/0774-Improve-PortalEvents.patch @@ -18,10 +18,10 @@ index 25b1e8bec23465f0e9a17f156bdff7fe716db84c..f05a9fd321a4af28e9771bbf39d73f80 // Paper start - gateway-specific teleport event if (this.portalProcess != null && this.portalProcess.isSamePortal(((net.minecraft.world.level.block.EndGatewayBlock) net.minecraft.world.level.block.Blocks.END_GATEWAY)) && this.serverLevel().getBlockEntity(this.portalProcess.getEntryPosition()) instanceof net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity theEndGatewayBlockEntity) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 47a2cd3ea7c88681929351c6db9090149e2c4f2e..37419819758574631486886307f3133a8a3c1c36 100644 +index 149852c5ed532c1bbb4f647c0988d282915fa43d..4ad6ba0b5f7b53943643be2abb0590748222e984 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3740,7 +3740,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3742,7 +3742,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity(); Location enter = bukkitEntity.getLocation(); diff --git a/patches/server/0779-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch b/patches/server/0779-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch index c08dab2b2d..8b27b7a489 100644 --- a/patches/server/0779-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch +++ b/patches/server/0779-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Expose pre-collision moving velocity to diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 37419819758574631486886307f3133a8a3c1c36..0e52f67f0185cba47838f0a99a97b4d70314c8fa 100644 +index 4ad6ba0b5f7b53943643be2abb0590748222e984..19c200743c4b5384f2b43554cfe29eafcea9b227 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -968,6 +968,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0809-Refresh-ProjectileSource-for-projectiles.patch b/patches/server/0809-Refresh-ProjectileSource-for-projectiles.patch index eee4855e6b..dcbbac97e1 100644 --- a/patches/server/0809-Refresh-ProjectileSource-for-projectiles.patch +++ b/patches/server/0809-Refresh-ProjectileSource-for-projectiles.patch @@ -14,7 +14,7 @@ clearing the owner. Co-authored-by: Warrior <[email protected]> diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 0e52f67f0185cba47838f0a99a97b4d70314c8fa..e126f1d5117a5826c5bfec20719633d7ca5f2870 100644 +index 19c200743c4b5384f2b43554cfe29eafcea9b227..2397f88634aef5abce427c0cd751bdbfc6455b38 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -393,6 +393,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0823-Don-t-load-chunks-for-supporting-block-checks.patch b/patches/server/0823-Don-t-load-chunks-for-supporting-block-checks.patch index 5f0cc11546..d55a98cf81 100644 --- a/patches/server/0823-Don-t-load-chunks-for-supporting-block-checks.patch +++ b/patches/server/0823-Don-t-load-chunks-for-supporting-block-checks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't load chunks for supporting block checks diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index e126f1d5117a5826c5bfec20719633d7ca5f2870..3444b1a2da80b85e2b1928d69ff0dd980c5fb34f 100644 +index 2397f88634aef5abce427c0cd751bdbfc6455b38..72cb4a97188596db49e69fd2a332fea907d10456 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1228,7 +1228,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0835-Folia-scheduler-and-owned-region-API.patch b/patches/server/0835-Folia-scheduler-and-owned-region-API.patch index 3ff79fb2c6..ae8d94eb47 100644 --- a/patches/server/0835-Folia-scheduler-and-owned-region-API.patch +++ b/patches/server/0835-Folia-scheduler-and-owned-region-API.patch @@ -1185,7 +1185,7 @@ index cbba549176b3acfc25ec42c2935b31ab2176e0fa..4ac0bb0ec3222ebdd3fa386696dcb072 this.players.remove(entityplayer); this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3444b1a2da80b85e2b1928d69ff0dd980c5fb34f..463dd4f91212318b51174c5d2f4d25ba95c25f50 100644 +index 72cb4a97188596db49e69fd2a332fea907d10456..8695e003e20912840d4968adf81c17cb8b545096 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -262,10 +262,21 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -1211,7 +1211,7 @@ index 3444b1a2da80b85e2b1928d69ff0dd980c5fb34f..463dd4f91212318b51174c5d2f4d25ba // CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir() public int getDefaultMaxAirSupply() { -@@ -4674,6 +4685,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4676,6 +4687,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public final void setRemoved(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) { CraftEventFactory.callEntityRemoveEvent(this, cause); // CraftBukkit end @@ -1219,7 +1219,7 @@ index 3444b1a2da80b85e2b1928d69ff0dd980c5fb34f..463dd4f91212318b51174c5d2f4d25ba if (this.removalReason == null) { this.removalReason = entity_removalreason; } -@@ -4685,12 +4697,28 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4687,12 +4699,28 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.getPassengers().forEach(Entity::stopRiding); this.levelCallback.onRemove(entity_removalreason); this.onRemoval(entity_removalreason); diff --git a/patches/server/0858-Expand-Pose-API.patch b/patches/server/0858-Expand-Pose-API.patch index 47312a8635..836f4405e5 100644 --- a/patches/server/0858-Expand-Pose-API.patch +++ b/patches/server/0858-Expand-Pose-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expand Pose API diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 463dd4f91212318b51174c5d2f4d25ba95c25f50..eadea35bcb9c2a8d65789e09dbabe7cb4a126542 100644 +index 8695e003e20912840d4968adf81c17cb8b545096..5c1ee438e85167ab6382f18421f14e2a1ea0acf1 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -427,6 +427,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0865-Fix-slot-desync.patch b/patches/server/0865-Fix-slot-desync.patch index 7c1808398c..089eb53892 100644 --- a/patches/server/0865-Fix-slot-desync.patch +++ b/patches/server/0865-Fix-slot-desync.patch @@ -40,7 +40,7 @@ index b840f7aac9c830b8aa0aa133bf43f87dfc598b2c..0cb0d2f863efb86bb589b30bae61ac57 if (event.isCancelled()) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index eadea35bcb9c2a8d65789e09dbabe7cb4a126542..c0539c8826a60cbe25855319cc174fb1520798c0 100644 +index 5c1ee438e85167ab6382f18421f14e2a1ea0acf1..18147e93d99417e696cbb24603fec2aa0a1057e3 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2752,8 +2752,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0899-Don-t-fire-sync-events-during-worldgen.patch b/patches/server/0899-Don-t-fire-sync-events-during-worldgen.patch index f530a9f4e7..a45762da8f 100644 --- a/patches/server/0899-Don-t-fire-sync-events-during-worldgen.patch +++ b/patches/server/0899-Don-t-fire-sync-events-during-worldgen.patch @@ -31,7 +31,7 @@ index 7cecbac43f1cd2d9516034ea9d2633c0c76e61f4..7a985c30a973efacf3e8b70e7163c550 if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on {}", entity, new Throwable()); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index c0539c8826a60cbe25855319cc174fb1520798c0..02b9d280486a23d8eef650566dfaa10ac0b96c9c 100644 +index 18147e93d99417e696cbb24603fec2aa0a1057e3..d495c20f337594507114cde436d759c9a81451b4 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -631,7 +631,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0902-Restore-vanilla-entity-drops-behavior.patch b/patches/server/0902-Restore-vanilla-entity-drops-behavior.patch index c19f1327f4..489f9a4c1a 100644 --- a/patches/server/0902-Restore-vanilla-entity-drops-behavior.patch +++ b/patches/server/0902-Restore-vanilla-entity-drops-behavior.patch @@ -37,7 +37,7 @@ index 419fcb4cd97cf10a2601e02024b999a51a0ff952..df21cd1bd2a3dda7169edbea18bbfdf0 loot.addAll(this.drops); this.drops.clear(); // SPIGOT-5188: make sure to clear diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 02b9d280486a23d8eef650566dfaa10ac0b96c9c..cdc5ea3dd9559c076049c86a9fdb4e8bf85ff6c0 100644 +index d495c20f337594507114cde436d759c9a81451b4..189bc1bcd902a37f684a980088578c19ba66ceb5 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2678,19 +2678,45 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0934-Fix-DamageSource-API.patch b/patches/server/0934-Fix-DamageSource-API.patch index 113d204bee..c8083b4624 100644 --- a/patches/server/0934-Fix-DamageSource-API.patch +++ b/patches/server/0934-Fix-DamageSource-API.patch @@ -84,7 +84,7 @@ index fddbdb7322a2063996a28c5c3d93c265188b1256..be87cb3cfa15a7d889118cdc4b87232e public DamageSource sonicBoom(Entity attacker) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index cdc5ea3dd9559c076049c86a9fdb4e8bf85ff6c0..23095ace5a6aa6fd6cc1d5defa4a783ccb637b1d 100644 +index 189bc1bcd902a37f684a980088578c19ba66ceb5..51dc99e367e8b9d6b2373d1f8e01dfa3ed34a283 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -3388,7 +3388,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0978-Entity-Activation-Range-2.0.patch b/patches/server/0978-Entity-Activation-Range-2.0.patch index a4edc8e8a0..e2e0609b44 100644 --- a/patches/server/0978-Entity-Activation-Range-2.0.patch +++ b/patches/server/0978-Entity-Activation-Range-2.0.patch @@ -88,7 +88,7 @@ index ce148cf5930cdcf0163c7f6416cbbd89e4d22720..75c388a5c9de26f0053015619e6c19bc } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 23095ace5a6aa6fd6cc1d5defa4a783ccb637b1d..9a37a898eba0cd9ab18ec5ee241cf054c8a71b32 100644 +index 51dc99e367e8b9d6b2373d1f8e01dfa3ed34a283..2cc92228d48b78e8318c106bfe49e06f56256927 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -420,6 +420,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0981-Optimize-Collision-to-not-load-chunks.patch b/patches/server/0981-Optimize-Collision-to-not-load-chunks.patch index 27b03b47bf..0a4446e68f 100644 --- a/patches/server/0981-Optimize-Collision-to-not-load-chunks.patch +++ b/patches/server/0981-Optimize-Collision-to-not-load-chunks.patch @@ -26,7 +26,7 @@ index 7097d87dead028c8dd44cefc97694bada93f608b..751fc4b0fe60c6d26ea0f768f3d66031 if (teleporttransition.missingRespawnBlock()) { entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F)); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 9a37a898eba0cd9ab18ec5ee241cf054c8a71b32..aa7d3383c773d3537335e449636f33d69cde12bb 100644 +index 2cc92228d48b78e8318c106bfe49e06f56256927..0a26653eb6d72b646bedeba3839868241851c1c9 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -258,6 +258,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0992-Properly-resend-entities.patch b/patches/server/0992-Properly-resend-entities.patch index 3b68910eac..5487d9a3b1 100644 --- a/patches/server/0992-Properly-resend-entities.patch +++ b/patches/server/0992-Properly-resend-entities.patch @@ -134,7 +134,7 @@ index 751fc4b0fe60c6d26ea0f768f3d66031a4bad963..700ab5ef2f8ab1466c4f659cd34679dc } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index aa7d3383c773d3537335e449636f33d69cde12bb..6a0472eaae9ad890692862590b8d23110e48536d 100644 +index 0a26653eb6d72b646bedeba3839868241851c1c9..28d4c6d308f2c69b22d21302e4fa505162a1d782 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -598,13 +598,45 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/1032-Void-damage-configuration-API.patch b/patches/server/1032-Void-damage-configuration-API.patch index 0bebf02515..d14c243177 100644 --- a/patches/server/1032-Void-damage-configuration-API.patch +++ b/patches/server/1032-Void-damage-configuration-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Void damage configuration API diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 6a0472eaae9ad890692862590b8d23110e48536d..7d16f9935407931823ad3e420f336c7ec69528b2 100644 +index 28d4c6d308f2c69b22d21302e4fa505162a1d782..fc958b43ce0972362eb3be76ec6b9f7388f45f22 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -853,8 +853,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/1038-Moonrise-optimisation-patches.patch b/patches/server/1038-Moonrise-optimisation-patches.patch index a6bd51f78b..529aeae168 100644 --- a/patches/server/1038-Moonrise-optimisation-patches.patch +++ b/patches/server/1038-Moonrise-optimisation-patches.patch @@ -28416,7 +28416,7 @@ index 50040c497a819cd1229042ab3cb057d34a32cacc..1f9c436a632e4f110be61cf76fcfc3b7 + // Paper end - block counting } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7d16f9935407931823ad3e420f336c7ec69528b2..b36a915e6d337d7ec3f797bf1773b14c5b231d76 100644 +index fc958b43ce0972362eb3be76ec6b9f7388f45f22..288f9cdf57bb9356a048d8d3d795e9a7a1b3a216 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -175,7 +175,7 @@ import org.bukkit.event.player.PlayerTeleportEvent; @@ -28808,7 +28808,7 @@ index 7d16f9935407931823ad3e420f336c7ec69528b2..b36a915e6d337d7ec3f797bf1773b14c } public InteractionResult interact(Player player, InteractionHand hand) { -@@ -4269,14 +4546,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4271,14 +4548,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public Iterable<Entity> getIndirectPassengers() { @@ -28833,7 +28833,7 @@ index 7d16f9935407931823ad3e420f336c7ec69528b2..b36a915e6d337d7ec3f797bf1773b14c } private Iterable<Entity> getIndirectPassengers_old() { // Paper end - Optimize indirect passenger iteration -@@ -4405,82 +4685,136 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4407,82 +4687,136 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return Mth.lerp(delta, this.yRotO, this.yRot); } @@ -29028,7 +29028,7 @@ index 7d16f9935407931823ad3e420f336c7ec69528b2..b36a915e6d337d7ec3f797bf1773b14c public boolean touchingUnloadedChunk() { AABB axisalignedbb = this.getBoundingBox().inflate(1.0D); -@@ -4632,6 +4966,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4634,6 +4968,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.setPosRaw(x, y, z, false); } public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) { @@ -29044,7 +29044,7 @@ index 7d16f9935407931823ad3e420f336c7ec69528b2..b36a915e6d337d7ec3f797bf1773b14c if (!checkPosition(this, x, y, z)) { return; } -@@ -4761,6 +5104,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4763,6 +5106,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @Override public final void setRemoved(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) { @@ -29057,7 +29057,7 @@ index 7d16f9935407931823ad3e420f336c7ec69528b2..b36a915e6d337d7ec3f797bf1773b14c CraftEventFactory.callEntityRemoveEvent(this, cause); // CraftBukkit end final boolean alreadyRemoved = this.removalReason != null; // Paper - Folia schedulers -@@ -4772,7 +5121,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4774,7 +5123,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.stopRiding(); } @@ -29066,7 +29066,7 @@ index 7d16f9935407931823ad3e420f336c7ec69528b2..b36a915e6d337d7ec3f797bf1773b14c this.levelCallback.onRemove(entity_removalreason); this.onRemoval(entity_removalreason); // Paper start - Folia schedulers -@@ -4804,7 +5153,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4806,7 +5155,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @Override public boolean shouldBeSaved() { diff --git a/patches/server/1043-Detail-more-information-in-watchdog-dumps.patch b/patches/server/1043-Detail-more-information-in-watchdog-dumps.patch index 46e97e3b0d..e23f02def3 100644 --- a/patches/server/1043-Detail-more-information-in-watchdog-dumps.patch +++ b/patches/server/1043-Detail-more-information-in-watchdog-dumps.patch @@ -121,7 +121,7 @@ index 9af879115a24145ec290ac200565004e49ee7b0b..c9d7ea8fbaf8858564282b42f6f6dda3 private void tickPassenger(Entity vehicle, Entity passenger, boolean isActive) { // Paper - EAR 2 diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index b36a915e6d337d7ec3f797bf1773b14c5b231d76..6817015f0cf39df03029e36cd845d590618031dc 100644 +index 288f9cdf57bb9356a048d8d3d795e9a7a1b3a216..bc81faf083e2a5455a7da0ba7cc18eae5e014a7a 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1171,8 +1171,43 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -182,7 +182,7 @@ index b36a915e6d337d7ec3f797bf1773b14c5b231d76..6817015f0cf39df03029e36cd845d590 } private void applyMovementEmissionAndPlaySound(Entity.MovementEmission moveEffect, Vec3 movement, BlockPos landingPos, BlockState landingState) { -@@ -4884,7 +4926,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4886,7 +4928,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public void setDeltaMovement(Vec3 velocity) { @@ -192,7 +192,7 @@ index b36a915e6d337d7ec3f797bf1773b14c5b231d76..6817015f0cf39df03029e36cd845d590 } public void addDeltaMovement(Vec3 velocity) { -@@ -4990,7 +5034,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4992,7 +5036,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } // Paper end - Fix MC-4 if (this.position.x != x || this.position.y != y || this.position.z != z) { |