aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0781-Ensure-entity-passenger-world-matches-ridden-entity.patch
blob: 89d95d4c80d25643d4ecf4320028f9cf92ca4940 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 8f178446ee632ae2aad735cae2edf6db96250f43..3fc282f8211eb3a7a7d096cc22b1bdb6545d70fa 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2849,7 +2849,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
     }
 
     public boolean startRiding(Entity entity, boolean force) {
-        if (entity == this.vehicle) {
+        if (entity == this.vehicle || entity.level != this.level) { // Paper - check level
             return false;
         } else if (!entity.couldAcceptPassenger()) {
             return false;