Paper/Spigot-Server-Patches/0579-Fix-CME-on-adding-a-passenger-in-CreatureSpawnEvent.patch
jmp 1718f61bf8 Updated Upstream (CraftBukkit/Spigot)
Doesn't compile yet.

CraftBukkit Changes:
90d6905b Repackage NMS
69cf961d Repackage patches

Spigot Changes:
79d53c28 Repackage NMS
2021-03-18 18:03:22 +01:00

20 Zeilen
1.0 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 e45af93ddb67361a5b67a79f4bc9b66bbdb3a14b..8d37f9b3880d3e456b82f4a03197cf2868714e09 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3170,7 +3170,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() {