aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-06-23 15:01:12 -0700
committerGitHub <[email protected]>2024-06-23 15:01:12 -0700
commit897ece48d548f727c323ebadca0768f41c4be3b5 (patch)
tree171ae37e277e4db0c473f5923aa41c34dca64ff5 /patches/server
parent5ae4758c8be76f1f53957509a0399a9b28479665 (diff)
downloadPaper-897ece48d548f727c323ebadca0768f41c4be3b5.tar.gz
Paper-897ece48d548f727c323ebadca0768f41c4be3b5.zip
Call EntityPortalEnterEvent on endgateways and make cancellable (#10892)
Diffstat (limited to 'patches/server')
-rw-r--r--patches/server/0789-Improve-PortalEvents.patch50
-rw-r--r--patches/server/0794-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch2
-rw-r--r--patches/server/0824-Refresh-ProjectileSource-for-projectiles.patch2
-rw-r--r--patches/server/0839-Don-t-load-chunks-for-supporting-block-checks.patch2
-rw-r--r--patches/server/0851-Folia-scheduler-and-owned-region-API.patch6
-rw-r--r--patches/server/0874-Expand-Pose-API.patch2
-rw-r--r--patches/server/0881-Fix-inventory-desync.patch2
-rw-r--r--patches/server/0915-Don-t-fire-sync-events-during-worldgen.patch2
-rw-r--r--patches/server/0918-Restore-vanilla-entity-drops-behavior.patch2
-rw-r--r--patches/server/0950-Fix-DamageSource-API.patch2
-rw-r--r--patches/server/0991-Chunk-System-Starlight-from-Moonrise.patch10
-rw-r--r--patches/server/1000-Entity-Activation-Range-2.0.patch2
-rw-r--r--patches/server/1020-Properly-resend-entities.patch2
13 files changed, 66 insertions, 20 deletions
diff --git a/patches/server/0789-Improve-PortalEvents.patch b/patches/server/0789-Improve-PortalEvents.patch
index 6edad61a76..d9ad0225b3 100644
--- a/patches/server/0789-Improve-PortalEvents.patch
+++ b/patches/server/0789-Improve-PortalEvents.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Improve PortalEvents
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index f52d394c90bc326c2a58c4f623df632235e0c599..b58a83b9e7a7c9253b0091f271823bf821e90c19 100644
+index f52d394c90bc326c2a58c4f623df632235e0c599..ec386450f9808c724c1b2b97c6e14fc5292caafc 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -3528,7 +3528,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -3528,7 +3528,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity();
Location enter = bukkitEntity.getLocation();
@@ -17,6 +17,7 @@ index f52d394c90bc326c2a58c4f623df632235e0c599..b58a83b9e7a7c9253b0091f271823bf8
+ final org.bukkit.PortalType portalType = switch (cause) {
+ case END_PORTAL -> org.bukkit.PortalType.ENDER;
+ case NETHER_PORTAL -> org.bukkit.PortalType.NETHER;
++ case END_GATEWAY -> org.bukkit.PortalType.END_GATEWAY; // not actually used yet
+ default -> org.bukkit.PortalType.CUSTOM;
+ };
+ EntityPortalEvent event = new EntityPortalEvent(bukkitEntity, enter, exit, searchRadius, portalType);
@@ -24,3 +25,48 @@ index f52d394c90bc326c2a58c4f623df632235e0c599..b58a83b9e7a7c9253b0091f271823bf8
event.getEntity().getServer().getPluginManager().callEvent(event);
if (event.isCancelled() || event.getTo() == null || event.getTo().getWorld() == null || !entity.isAlive()) {
return null;
+diff --git a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
+index 11486419dd98a013c7387d3d73f322a95a18c574..3f5bb5c9ceb5b31fcc9ef0a7a6157e1e1cb2a09f 100644
+--- a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
++++ b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
+@@ -92,6 +92,10 @@ public class EndGatewayBlock extends BaseEntityBlock implements Portal {
+ protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
+ if (entity.canUsePortal(false)) {
++ // Paper start - call EntityPortalEnterEvent
++ org.bukkit.event.entity.EntityPortalEnterEvent event = new org.bukkit.event.entity.EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()), org.bukkit.PortalType.END_GATEWAY); // Paper - add portal type
++ if (!event.callEvent()) return;
++ // Paper end - call EntityPortalEnterEvent
+ BlockEntity tileentity = world.getBlockEntity(pos);
+
+ if (!world.isClientSide && tileentity instanceof TheEndGatewayBlockEntity) {
+diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
+index cff3e9869340f1ffb7093431cbe1ac5e67792a4e..01333f69b622141b2eb53441c6cbd69e4a059d55 100644
+--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
++++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
+@@ -66,8 +66,9 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
+ if (entity.canUsePortal(false) && Shapes.joinIsNotEmpty(Shapes.create(entity.getBoundingBox().move((double) (-pos.getX()), (double) (-pos.getY()), (double) (-pos.getZ()))), state.getShape(world, pos), BooleanOp.AND)) {
+ // CraftBukkit start - Entity in portal
+- EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
++ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()), org.bukkit.PortalType.ENDER); // Paper - add portal type
+ world.getCraftServer().getPluginManager().callEvent(event);
++ if (event.isCancelled()) return; // Paper - make cancellable
+ // CraftBukkit end
+ if (!world.isClientSide && world.dimension() == Level.END && entity instanceof ServerPlayer) {
+ ServerPlayer entityplayer = (ServerPlayer) entity;
+diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
+index a530276b0123dee5680d7e09ad3d2f0414909c91..ddab7de1d376e9e486e2f920174397ea8804aa29 100644
+--- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
++++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
+@@ -110,8 +110,9 @@ public class NetherPortalBlock extends Block implements Portal {
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
+ if (entity.canUsePortal(false)) {
+ // CraftBukkit start - Entity in portal
+- EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
++ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()), org.bukkit.PortalType.NETHER); // Paper - add portal type
+ world.getCraftServer().getPluginManager().callEvent(event);
++ if (event.isCancelled()) return; // Paper - make cancellable
+ // CraftBukkit end
+ entity.setAsInsidePortal(this, pos);
+ }
diff --git a/patches/server/0794-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch b/patches/server/0794-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch
index 8c02550140..1748503da4 100644
--- a/patches/server/0794-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch
+++ b/patches/server/0794-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 b58a83b9e7a7c9253b0091f271823bf821e90c19..deee2eebebb415115c5566057ac626f35e9472e1 100644
+index ec386450f9808c724c1b2b97c6e14fc5292caafc..011a869c2eac551fe15fca34eee11ff928af52e2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -943,6 +943,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
diff --git a/patches/server/0824-Refresh-ProjectileSource-for-projectiles.patch b/patches/server/0824-Refresh-ProjectileSource-for-projectiles.patch
index 73be64bd31..7388f355f9 100644
--- a/patches/server/0824-Refresh-ProjectileSource-for-projectiles.patch
+++ b/patches/server/0824-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 deee2eebebb415115c5566057ac626f35e9472e1..6d18b9a0b65c62de3f134d3d6dda6e4a988a64dc 100644
+index 011a869c2eac551fe15fca34eee11ff928af52e2..fa32b32fb5e6b546cb73b43e59db408404797cb5 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -391,6 +391,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
diff --git a/patches/server/0839-Don-t-load-chunks-for-supporting-block-checks.patch b/patches/server/0839-Don-t-load-chunks-for-supporting-block-checks.patch
index 73324c38d4..4d234a8fb3 100644
--- a/patches/server/0839-Don-t-load-chunks-for-supporting-block-checks.patch
+++ b/patches/server/0839-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 6d18b9a0b65c62de3f134d3d6dda6e4a988a64dc..33ecda938359e07607ceacd0b8e8fca7e33e2ee2 100644
+index fa32b32fb5e6b546cb73b43e59db408404797cb5..1d5d477b0b689167742c2f2edff263be40a991c8 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1186,7 +1186,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
diff --git a/patches/server/0851-Folia-scheduler-and-owned-region-API.patch b/patches/server/0851-Folia-scheduler-and-owned-region-API.patch
index e9f45ef6ab..02f361a409 100644
--- a/patches/server/0851-Folia-scheduler-and-owned-region-API.patch
+++ b/patches/server/0851-Folia-scheduler-and-owned-region-API.patch
@@ -1185,7 +1185,7 @@ index 2ea29c9491186d7a25ed3eed99ee4a488bcaa272..de96d7df65713f2fa7b8f2dd068856bb
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 33ecda938359e07607ceacd0b8e8fca7e33e2ee2..309dab6900543bf04ae371d7278bdf1b87a8a3c4 100644
+index 1d5d477b0b689167742c2f2edff263be40a991c8..aebe9cb97776bb833221a0f11285696c266b752b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -255,11 +255,23 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -1213,7 +1213,7 @@ index 33ecda938359e07607ceacd0b8e8fca7e33e2ee2..309dab6900543bf04ae371d7278bdf1b
@Override
public CommandSender getBukkitSender(CommandSourceStack wrapper) {
return this.getBukkitEntity();
-@@ -4484,6 +4496,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -4485,6 +4497,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
@@ -1221,7 +1221,7 @@ index 33ecda938359e07607ceacd0b8e8fca7e33e2ee2..309dab6900543bf04ae371d7278bdf1b
if (this.removalReason == null) {
this.removalReason = entity_removalreason;
}
-@@ -4494,12 +4507,28 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -4495,12 +4508,28 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.getPassengers().forEach(Entity::stopRiding);
this.levelCallback.onRemove(entity_removalreason);
diff --git a/patches/server/0874-Expand-Pose-API.patch b/patches/server/0874-Expand-Pose-API.patch
index 0813409267..b1ad16fc18 100644
--- a/patches/server/0874-Expand-Pose-API.patch
+++ b/patches/server/0874-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 309dab6900543bf04ae371d7278bdf1b87a8a3c4..d56d1426a9be2f22fac458f8302bad04b3f257c2 100644
+index aebe9cb97776bb833221a0f11285696c266b752b..80a29f4818cda4255c82fcd47f0da2235a02da23 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -426,6 +426,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
diff --git a/patches/server/0881-Fix-inventory-desync.patch b/patches/server/0881-Fix-inventory-desync.patch
index d1c6c09f04..d02feb84be 100644
--- a/patches/server/0881-Fix-inventory-desync.patch
+++ b/patches/server/0881-Fix-inventory-desync.patch
@@ -17,7 +17,7 @@ index 9d6c6a979fb1751ca90c9c1210ec52bbf12495f4..46d6fb2591f47c245446db210a00cbaa
this.containerMenu.findSlot(this.getInventory(), this.getInventory().selected).ifPresent(s -> {
this.containerSynchronizer.sendSlotChange(this.containerMenu, s, this.getMainHandItem());
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index d56d1426a9be2f22fac458f8302bad04b3f257c2..eebb2ad39c1363ab2c3bd6d1efbd5c70b4700f42 100644
+index 80a29f4818cda4255c82fcd47f0da2235a02da23..23442e0f887cec3c3a65b3dd3d0f4f40db0e54b1 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2639,8 +2639,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
diff --git a/patches/server/0915-Don-t-fire-sync-events-during-worldgen.patch b/patches/server/0915-Don-t-fire-sync-events-during-worldgen.patch
index 055ffead21..b115ced80b 100644
--- a/patches/server/0915-Don-t-fire-sync-events-during-worldgen.patch
+++ b/patches/server/0915-Don-t-fire-sync-events-during-worldgen.patch
@@ -31,7 +31,7 @@ index 8b5eabea1a0926c22b58ef8761caee3a06aa5ee0..53fdf4e104f36a2bd88fdf26d8c68cd3
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 eebb2ad39c1363ab2c3bd6d1efbd5c70b4700f42..fb1b19bb748a97465af2b9f1de89df9f5165b7cc 100644
+index 23442e0f887cec3c3a65b3dd3d0f4f40db0e54b1..24aacf9997c9ea0bd68ef3803f4a3ee4a920ab44 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -625,7 +625,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
diff --git a/patches/server/0918-Restore-vanilla-entity-drops-behavior.patch b/patches/server/0918-Restore-vanilla-entity-drops-behavior.patch
index 3c7976b082..5d48caea92 100644
--- a/patches/server/0918-Restore-vanilla-entity-drops-behavior.patch
+++ b/patches/server/0918-Restore-vanilla-entity-drops-behavior.patch
@@ -50,7 +50,7 @@ index 184f3c7a1304f4f9d2aaeae27172be9d853c30de..3cbb59df34156479d24a8251f2b3acbb
if (entityitem == null) {
return null;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index fb1b19bb748a97465af2b9f1de89df9f5165b7cc..bebb39beaba51bf19448d572b08efd25560c6e5a 100644
+index 24aacf9997c9ea0bd68ef3803f4a3ee4a920ab44..363fe1aff439983199f5137547cef9516fbab2a8 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2563,6 +2563,25 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
diff --git a/patches/server/0950-Fix-DamageSource-API.patch b/patches/server/0950-Fix-DamageSource-API.patch
index 0d5ee7376f..f25d5187b0 100644
--- a/patches/server/0950-Fix-DamageSource-API.patch
+++ b/patches/server/0950-Fix-DamageSource-API.patch
@@ -84,7 +84,7 @@ index caf1d79e2bbdd257a5439e2973653747e678805f..e34584e4780f343d6c946af5377088d5
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 bebb39beaba51bf19448d572b08efd25560c6e5a..e0a3efc65b407084bdf2ef5be2cea86572858435 100644
+index 363fe1aff439983199f5137547cef9516fbab2a8..2e2101274f3afebbae783fa119f5cae8104de45d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3263,7 +3263,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
diff --git a/patches/server/0991-Chunk-System-Starlight-from-Moonrise.patch b/patches/server/0991-Chunk-System-Starlight-from-Moonrise.patch
index ac742c7fa6..ab403a02d9 100644
--- a/patches/server/0991-Chunk-System-Starlight-from-Moonrise.patch
+++ b/patches/server/0991-Chunk-System-Starlight-from-Moonrise.patch
@@ -26830,7 +26830,7 @@ index ea72dcb064a35bc6245bc5c94d592efedd8faf41..87ee8e51dfa7657ed7d83fcbceef48bf
this.comparator = comparator;
if (initialCapacity < 0) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index e0a3efc65b407084bdf2ef5be2cea86572858435..02bb3dd944c97e035125f5f31d99690dbe950d0b 100644
+index 2e2101274f3afebbae783fa119f5cae8104de45d..a7deceb2b9caad47f7f641ba4302d622d7127651 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -167,7 +167,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
@@ -26920,7 +26920,7 @@ index e0a3efc65b407084bdf2ef5be2cea86572858435..02bb3dd944c97e035125f5f31d99690d
public Entity(EntityType<?> type, Level world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
-@@ -4396,6 +4467,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -4397,6 +4468,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) {
@@ -26936,7 +26936,7 @@ index e0a3efc65b407084bdf2ef5be2cea86572858435..02bb3dd944c97e035125f5f31d99690d
if (!checkPosition(this, x, y, z)) {
return;
}
-@@ -4527,6 +4607,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -4528,6 +4608,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@Override
public final void setRemoved(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) {
@@ -26949,7 +26949,7 @@ index e0a3efc65b407084bdf2ef5be2cea86572858435..02bb3dd944c97e035125f5f31d99690d
CraftEventFactory.callEntityRemoveEvent(this, cause);
// CraftBukkit end
final boolean alreadyRemoved = this.removalReason != null; // Paper - Folia schedulers
-@@ -4538,7 +4624,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -4539,7 +4625,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.stopRiding();
}
@@ -26958,7 +26958,7 @@ index e0a3efc65b407084bdf2ef5be2cea86572858435..02bb3dd944c97e035125f5f31d99690d
this.levelCallback.onRemove(entity_removalreason);
// Paper start - Folia schedulers
if (!(this instanceof ServerPlayer) && entity_removalreason != RemovalReason.CHANGED_DIMENSION && !alreadyRemoved) {
-@@ -4569,7 +4655,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -4570,7 +4656,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@Override
public boolean shouldBeSaved() {
diff --git a/patches/server/1000-Entity-Activation-Range-2.0.patch b/patches/server/1000-Entity-Activation-Range-2.0.patch
index 2d30820b62..01ffbd7cf4 100644
--- a/patches/server/1000-Entity-Activation-Range-2.0.patch
+++ b/patches/server/1000-Entity-Activation-Range-2.0.patch
@@ -111,7 +111,7 @@ index b65927095e36451c53cdae770701a33470eaadbc..19de709c25cfb5a7d1ed810f93d10022
} else {
passenger.stopRiding();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 02bb3dd944c97e035125f5f31d99690dbe950d0b..139a5cd05a167b3b3330aa94bd33d193dce19e2d 100644
+index a7deceb2b9caad47f7f641ba4302d622d7127651..5d7bc6470ab3818b0a189aab18ff26c0180e3912 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -419,6 +419,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
diff --git a/patches/server/1020-Properly-resend-entities.patch b/patches/server/1020-Properly-resend-entities.patch
index f0093b5b5e..de5a776d10 100644
--- a/patches/server/1020-Properly-resend-entities.patch
+++ b/patches/server/1020-Properly-resend-entities.patch
@@ -115,7 +115,7 @@ index 0d0b07c9199be9ca0d5ac3feb1d44f149ba69283..3d30427e75bdfb9cf453fb5cd2a34422
this.sendLevelInfo(player, worldserver1);
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 139a5cd05a167b3b3330aa94bd33d193dce19e2d..1a40128b06e70e39a82f170fc16dcae1e22c745c 100644
+index 5d7bc6470ab3818b0a189aab18ff26c0180e3912..2519c08a45ce3febcf51ac308ad98ac0e2657cf3 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -664,13 +664,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess