Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-19 14:30:17 +01:00
Add comment and check for null when removing passengers
Dieser Commit ist enthalten in:
Ursprung
da96a5b19c
Commit
a7fbe995f8
@ -146,9 +146,10 @@ public class Entity {
|
|||||||
public boolean despawnEntity(GeyserSession session) {
|
public boolean despawnEntity(GeyserSession session) {
|
||||||
if (!valid) return true;
|
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 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);
|
entity.updateBedrockMetadata(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren