13
0
geforkt von Mirrors/Paper

Only log for passenger / vehicle world mismatch

Exception thrown may corrupt passenger/vehicle state
Dieser Commit ist enthalten in:
Spottedleaf 2022-05-07 08:48:29 -07:00
Ursprung 8c9d98e100
Commit b831784aed
2 geänderte Dateien mit 6 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -6,16 +6,17 @@ 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 8b57a24d4e8469dfbfb4eb2d11ca616e1db98598..26911884384d5e8afd1b43360494b793374f505f 100644
index 8b57a24d4e8469dfbfb4eb2d11ca616e1db98598..122fa578adbba8aa5e7c253c59f45cac6a0d2223 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2590,6 +2590,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2590,6 +2590,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
protected boolean addPassenger(Entity entity) { // CraftBukkit
+ // Paper start
+ if (entity.level != this.level) {
+ throw new IllegalArgumentException("Entity passenger world must match");
+ LOGGER.error("Entity passenger world must match, cannot add " + entity + " as passenger to " + this, new Throwable());
+ return false;
+ }
+ // Paper end
if (entity == this) throw new IllegalArgumentException("Entities cannot become a passenger of themselves"); // Paper - issue 572

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Guard against invalid entity positions
Anything not finite should be blocked and logged
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 26911884384d5e8afd1b43360494b793374f505f..49cf3601df7b145d49b1fe9a71ba0bc60c5394b3 100644
index 122fa578adbba8aa5e7c253c59f45cac6a0d2223..03ba63163650463040815562e4e76a92758f8661 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4090,11 +4090,33 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4091,11 +4091,33 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale);
}