mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 04:02:06 -07:00
Add back more patches
This commit is contained in:
@@ -5056,6 +5056,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import java.util.Iterator;
|
||||
+import java.util.List;
|
||||
+import java.util.function.Predicate;
|
||||
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
+
|
||||
+public final class ChunkEntitySlices {
|
||||
+
|
||||
@@ -5176,12 +5177,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (entity.shouldBeSaved()) {
|
||||
+ entity.setRemoved(Entity.RemovalReason.UNLOADED_TO_CHUNK);
|
||||
+ entity.setRemoved(Entity.RemovalReason.UNLOADED_TO_CHUNK, EntityRemoveEvent.Cause.UNLOAD);
|
||||
+ if (entity.isVehicle()) {
|
||||
+ // we cannot assume that these entities are contained within this chunk, because entities can
|
||||
+ // desync - so we need to remove them all
|
||||
+ for (final Entity passenger : entity.getIndirectPassengers()) {
|
||||
+ passenger.setRemoved(Entity.RemovalReason.UNLOADED_TO_CHUNK);
|
||||
+ passenger.setRemoved(Entity.RemovalReason.UNLOADED_TO_CHUNK, EntityRemoveEvent.Cause.UNLOAD);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
Reference in New Issue
Block a user