Search in sources :

Example 1 with EntityProtocolType

use of org.lanternpowered.server.network.entity.EntityProtocolType in project LanternServer by LanternPowered.

the class LanternWorld method addEntity.

@Nullable
private LanternEntity addEntity(LanternEntity entity) {
    final LanternEntity entity1 = this.entitiesByUniqueId.putIfAbsent(entity.getUniqueId(), entity);
    if (entity1 != null) {
        return entity1;
    }
    final EntityProtocolType entityProtocolType = entity.getEntityProtocolType();
    if (entityProtocolType != null) {
        this.entityProtocolManager.add(entity, entityProtocolType);
    }
    entity.setPositionAndWorld(this, entity.getPosition());
    return null;
}
Also used : EntityProtocolType(org.lanternpowered.server.network.entity.EntityProtocolType) LanternEntity(org.lanternpowered.server.entity.LanternEntity) Nullable(javax.annotation.Nullable)

Aggregations

Nullable (javax.annotation.Nullable)1 LanternEntity (org.lanternpowered.server.entity.LanternEntity)1 EntityProtocolType (org.lanternpowered.server.network.entity.EntityProtocolType)1