Paper/patches/server/0689-Ensure-entity-passenger-world-matches-ridden-entity.patch
Spottedleaf 694b120d0b Remove Entity tracker field
Now the only tracker field is from the entity tracker
optimisations.
2024-07-28 15:28:52 -07:00

21 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Thu, 31 Mar 2022 05:11:37 -0700
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 d3971bc8a1cedaaffa89bb6eedb45742aa7c1d34..76182523c12f885cb42af1efa82f8e251e901195 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2687,7 +2687,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public boolean startRiding(Entity entity, boolean force) {
- if (entity == this.vehicle) {
+ if (entity == this.vehicle || entity.level != this.level) { // Paper - Ensure entity passenger world matches ridden entity (bad plugins)
return false;
} else if (!entity.couldAcceptPassenger()) {
return false;