mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-26 09:42:06 -07:00
Copy thrown pearls list for removal (#12840)
This commit is contained in:
@@ -420,8 +420,9 @@
|
|||||||
|
|
||||||
player.unRide();
|
player.unRide();
|
||||||
|
|
||||||
for (ThrownEnderpearl thrownEnderpearl : player.getEnderPearls()) {
|
- for (ThrownEnderpearl thrownEnderpearl : player.getEnderPearls()) {
|
||||||
- thrownEnderpearl.setRemoved(Entity.RemovalReason.UNLOADED_WITH_PLAYER);
|
- thrownEnderpearl.setRemoved(Entity.RemovalReason.UNLOADED_WITH_PLAYER);
|
||||||
|
+ for (ThrownEnderpearl thrownEnderpearl : new java.util.ArrayList<>(player.getEnderPearls())) { // Paper - copy, setOwner will remove from list;
|
||||||
+ // Paper start - Allow using old ender pearl behavior
|
+ // Paper start - Allow using old ender pearl behavior
|
||||||
+ if (!thrownEnderpearl.level().paperConfig().misc.legacyEnderPearlBehavior) {
|
+ if (!thrownEnderpearl.level().paperConfig().misc.legacyEnderPearlBehavior) {
|
||||||
+ thrownEnderpearl.setRemoved(Entity.RemovalReason.UNLOADED_WITH_PLAYER, org.bukkit.event.entity.EntityRemoveEvent.Cause.PLAYER_QUIT); // CraftBukkit - add Bukkit remove cause
|
+ thrownEnderpearl.setRemoved(Entity.RemovalReason.UNLOADED_WITH_PLAYER, org.bukkit.event.entity.EntityRemoveEvent.Cause.PLAYER_QUIT); // CraftBukkit - add Bukkit remove cause
|
||||||
|
Reference in New Issue
Block a user