3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/Spigot-Server-Patches/0579-Fix-CME-on-adding-a-passenger-in-CreatureSpawnEvent.patch
2021-01-11 01:44:06 +00:00

20 Zeilen
972 B
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/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 81ff0fd4587d0220f49573c393c8412e2b55d115..50669b68ae130ec43ea52d2e62d55d633eecb042 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -3085,7 +3085,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
public Stream<Entity> cp() {
- return Stream.concat(Stream.of(this), this.passengers.stream().flatMap(Entity::cp));
+ return Stream.concat(Stream.of(this), com.google.common.collect.ImmutableList.copyOf(this.passengers).stream().flatMap(Entity::cp)); // Paper
}
public boolean hasSinglePlayerPassenger() {