Search in sources :

Example 36 with AddEntityPacket

use of cn.nukkit.network.protocol.AddEntityPacket in project Nukkit by Nukkit.

the class EntityEnderPearl method spawnTo.

@Override
public void spawnTo(Player player) {
    AddEntityPacket pk = new AddEntityPacket();
    pk.type = NETWORK_ID;
    pk.entityUniqueId = this.getId();
    pk.entityRuntimeId = this.getId();
    pk.x = (float) this.x;
    pk.y = (float) this.y;
    pk.z = (float) this.z;
    pk.speedX = (float) this.motionX;
    pk.speedY = (float) this.motionY;
    pk.speedZ = (float) this.motionZ;
    pk.metadata = this.dataProperties;
    player.dataPacket(pk);
    super.spawnTo(player);
}
Also used : AddEntityPacket(cn.nukkit.network.protocol.AddEntityPacket)

Example 37 with AddEntityPacket

use of cn.nukkit.network.protocol.AddEntityPacket in project Nukkit by Nukkit.

the class EntityLightning method spawnTo.

@Override
public void spawnTo(Player player) {
    AddEntityPacket pk = new AddEntityPacket();
    pk.entityUniqueId = this.getId();
    pk.entityRuntimeId = this.getId();
    pk.type = EntityLightning.NETWORK_ID;
    pk.x = (float) this.x;
    pk.y = (float) this.y;
    pk.z = (float) this.z;
    pk.speedX = 0;
    pk.speedY = 0;
    pk.speedZ = 0;
    pk.yaw = (float) this.yaw;
    pk.pitch = (float) this.pitch;
    pk.metadata = this.dataProperties;
    player.dataPacket(pk);
    super.spawnTo(player);
}
Also used : AddEntityPacket(cn.nukkit.network.protocol.AddEntityPacket)

Example 38 with AddEntityPacket

use of cn.nukkit.network.protocol.AddEntityPacket in project Nukkit by Nukkit.

the class EntityParrot method spawnTo.

@Override
public void spawnTo(Player player) {
    AddEntityPacket pk = new AddEntityPacket();
    pk.type = this.getNetworkId();
    pk.entityUniqueId = this.getId();
    pk.entityRuntimeId = this.getId();
    pk.x = (float) this.x;
    pk.y = (float) this.y;
    pk.z = (float) this.z;
    pk.speedX = (float) this.motionX;
    pk.speedY = (float) this.motionY;
    pk.speedZ = (float) this.motionZ;
    pk.metadata = this.dataProperties;
    player.dataPacket(pk);
    super.spawnTo(player);
}
Also used : AddEntityPacket(cn.nukkit.network.protocol.AddEntityPacket)

Example 39 with AddEntityPacket

use of cn.nukkit.network.protocol.AddEntityPacket in project Nukkit by Nukkit.

the class EntityPig method spawnTo.

@Override
public void spawnTo(Player player) {
    AddEntityPacket pk = new AddEntityPacket();
    pk.type = this.getNetworkId();
    pk.entityUniqueId = this.getId();
    pk.entityRuntimeId = this.getId();
    pk.x = (float) this.x;
    pk.y = (float) this.y;
    pk.z = (float) this.z;
    pk.speedX = (float) this.motionX;
    pk.speedY = (float) this.motionY;
    pk.speedZ = (float) this.motionZ;
    pk.metadata = this.dataProperties;
    player.dataPacket(pk);
    super.spawnTo(player);
}
Also used : AddEntityPacket(cn.nukkit.network.protocol.AddEntityPacket)

Example 40 with AddEntityPacket

use of cn.nukkit.network.protocol.AddEntityPacket in project Nukkit by Nukkit.

the class EntityRabbit method spawnTo.

@Override
public void spawnTo(Player player) {
    AddEntityPacket pk = new AddEntityPacket();
    pk.type = this.getNetworkId();
    pk.entityUniqueId = this.getId();
    pk.entityRuntimeId = this.getId();
    pk.x = (float) this.x;
    pk.y = (float) this.y;
    pk.z = (float) this.z;
    pk.speedX = (float) this.motionX;
    pk.speedY = (float) this.motionY;
    pk.speedZ = (float) this.motionZ;
    pk.metadata = this.dataProperties;
    player.dataPacket(pk);
    super.spawnTo(player);
}
Also used : AddEntityPacket(cn.nukkit.network.protocol.AddEntityPacket)

Aggregations

AddEntityPacket (cn.nukkit.network.protocol.AddEntityPacket)58 MobEquipmentPacket (cn.nukkit.network.protocol.MobEquipmentPacket)5 ItemBow (cn.nukkit.item.ItemBow)2 EntityMetadata (cn.nukkit.entity.data.EntityMetadata)1 ItemSwordGold (cn.nukkit.item.ItemSwordGold)1 ItemSwordIron (cn.nukkit.item.ItemSwordIron)1 ItemSwordStone (cn.nukkit.item.ItemSwordStone)1