PaperMC/Spigot-Server-Patches/0576-Fix-CME-on-adding-a-passenger-in-CreatureSpawnEvent.patch
Mariell Hoversholm 2db85c553f
fix: origin world can be unknown while knowing location
We will now store the world ID. It may not be used if the entity is
loaded before the world in question is, but it might be used later on,
should the entity come after the world.

Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>
2021-06-12 23:30:56 +01:00

19 lines
1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: jmp <jasonpenilla2@me.com>
Date: Sun, 4 Oct 2020 19:55:25 -0700
Subject: [PATCH] Fix CME on adding a passenger in CreatureSpawnEvent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 35b2e8dba3536febe997f3c562c56f0d5371a524..7f212d7471e96e91b990cc5432216b2c1e8fb01f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3187,7 +3187,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
}
public Stream<Entity> recursiveStream() {
- return Stream.concat(Stream.of(this), this.passengers.stream().flatMap(Entity::recursiveStream));
+ return Stream.concat(Stream.of(this), com.google.common.collect.ImmutableList.copyOf(this.passengers).stream().flatMap(Entity::recursiveStream)); // Paper
}
public boolean hasSinglePlayerPassenger() {