mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Add comment and check for null when removing passengers
This commit is contained in:
parent
da96a5b19c
commit
a7fbe995f8
1 changed files with 3 additions and 2 deletions
|
@ -146,9 +146,10 @@ public class Entity {
|
|||
public boolean despawnEntity(GeyserSession session) {
|
||||
if (!valid) return true;
|
||||
|
||||
for (long passenger : passengers) {
|
||||
for (long passenger : passengers) { // Make sure all passengers on the despawned entity are updated
|
||||
Entity entity = session.getEntityCache().getEntityByJavaId(passenger);
|
||||
entity.getMetadata().getFlags().setFlag(EntityFlag.RIDING, false);
|
||||
if (entity == null) continue;
|
||||
entity.getMetadata().getOrCreateFlags().setFlag(EntityFlag.RIDING, false);
|
||||
entity.updateBedrockMetadata(session);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue