Fixed crash when reading a projectile spawn packet from earlier versions

This commit is contained in:
Sollace 2021-01-21 09:40:01 +02:00
parent 22c295f1d6
commit 33b3eec4cb

View file

@ -22,7 +22,7 @@ public class MsgSpawnProjectile extends EntitySpawnS2CPacket implements Channel.
@SuppressWarnings("unchecked")
public MsgSpawnProjectile(Entity e) {
super(e, Optional.of(e instanceof Owned ? ((Owned<Entity>)e).getMaster() : null).map(Entity::getEntityId).orElse(0));
super(e, Optional.ofNullable(e instanceof Owned ? ((Owned<Entity>)e).getMaster() : null).map(Entity::getEntityId).orElse(0));
}
@Override