mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 04:02:50 +01:00
20 lines
1.1 KiB
Diff
20 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 ad049687cd6c6c98bd08b512c6233b725c6ad9ab..156fb444061be556bbb1f230b239d5d2ce59b94b 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -2689,7 +2689,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;
|