cn.nukkit.network.protocol.AddEntityPacket Java Examples

The following examples show how to use cn.nukkit.network.protocol.AddEntityPacket. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EntityEndermite.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #2
Source File: EntitySilverfish.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #3
Source File: EntityMagmaCube.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #4
Source File: EntityCaveSpider.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #5
Source File: EntityMinecartAbstract.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void spawnTo(Player player) {
    AddEntityPacket pk = new AddEntityPacket();
    pk.entityUniqueId = getId();
    pk.entityRuntimeId = getId();
    pk.type = getNetworkId();
    pk.x = (float) x;
    pk.y = (float) y;
    pk.z = (float) z;
    pk.speedX = 0;
    pk.speedY = 0;
    pk.speedZ = 0;
    pk.yaw = 0;
    pk.pitch = 0;
    pk.metadata = dataProperties;
    player.dataPacket(pk);

    super.spawnTo(player);
}
 
Example #6
Source File: EntityDonkey.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #7
Source File: EntityGuardian.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #8
Source File: EntityZombie.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #9
Source File: EntityEnderman.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #10
Source File: EntityMooshroom.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #11
Source File: EntityPolarBear.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #12
Source File: EntitySkeleton.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);

    MobEquipmentPacket pk1 = new MobEquipmentPacket();
    pk1.eid = this.getId();
    pk1.item = new ItemBow();
    pk1.hotbarSlot = 10;
    player.dataPacket(pk1);

    super.spawnTo(player);
}
 
Example #13
Source File: EntityZombieVillager.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #14
Source File: EntityShulker.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #15
Source File: EntityVindicator.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #16
Source File: EntityWither.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #17
Source File: EntityVex.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);

    MobEquipmentPacket pk1 = new MobEquipmentPacket();
    pk1.eid = this.getId();
    pk1.item = new ItemSwordIron();
    pk1.hotbarSlot = 10;
    player.dataPacket(pk1);

    super.spawnTo(player);
}
 
Example #18
Source File: EntityLightning.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #19
Source File: EntityWitherSkeleton.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);

    MobEquipmentPacket pk1 = new MobEquipmentPacket();
    pk1.eid = this.getId();
    pk1.item = new ItemSwordStone();
    pk1.hotbarSlot = 10;
    player.dataPacket(pk1);

    super.spawnTo(player);
}
 
Example #20
Source File: Animal.java    From Actaeon with MIT License 6 votes vote down vote up
@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);
}
 
Example #21
Source File: EntityThrownTrident.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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.yaw = (float) this.yaw;
    pk.pitch = (float) this.pitch;
    pk.metadata = this.dataProperties;
    player.dataPacket(pk);

    super.spawnTo(player);
}
 
Example #22
Source File: EntityFishingHook.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void spawnTo(Player player) {
    AddEntityPacket pk = new AddEntityPacket();
    pk.entityRuntimeId = this.getId();
    pk.entityUniqueId = this.getId();
    pk.type = NETWORK_ID;
    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.yaw = (float) this.yaw;
    pk.pitch = (float) this.pitch;

    long ownerId = -1;
    if (this.shootingEntity != null) {
        ownerId = this.shootingEntity.getId();
    }
    pk.metadata = this.dataProperties.putLong(DATA_OWNER_EID, ownerId);
    player.dataPacket(pk);
    super.spawnTo(player);
}
 
Example #23
Source File: EntityWolf.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #24
Source File: EntityAnimal.java    From Jupiter with GNU General Public License v3.0 6 votes vote down vote up
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);
}
 
Example #25
Source File: EntityArrow.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void spawnTo(Player player) {
    AddEntityPacket pk = new AddEntityPacket();
    pk.type = EntityArrow.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.yaw = (float) this.yaw;
    pk.pitch = (float) this.pitch;
    pk.metadata = this.dataProperties;
    player.dataPacket(pk);

    super.spawnTo(player);
}
 
Example #26
Source File: EntityEnderPearl.java    From Jupiter with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void spawnTo(Player player){
       AddEntityPacket pk = new AddEntityPacket();
       pk.type = EntityEnderPearl.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);
}
 
Example #27
Source File: EntityFishingHook.java    From Jupiter with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void spawnTo(Player player) {
    AddEntityPacket packet = new AddEntityPacket();
    packet.type = EntityFishingHook.NETWORK_ID;
    packet.entityUniqueId = this.getId();
    packet.entityRuntimeId = getId();
    packet.x = (float) x;
    packet.y = (float) y;
    packet.z = (float) z;
    packet.speedX = (float) motionX;
    packet.speedY = (float) motionY;
    packet.speedZ = (float) motionZ;
    packet.yaw = (float) yaw;
    packet.pitch = (float) pitch;
    packet.metadata = dataProperties;
    player.dataPacket(packet);
    super.spawnTo(player);
}
 
Example #28
Source File: EntitySquid.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #29
Source File: EntityOcelot.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #30
Source File: EntityFallingBlock.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void spawnTo(Player player) {
    AddEntityPacket packet = new AddEntityPacket();
    packet.type = EntityFallingBlock.NETWORK_ID;
    packet.entityUniqueId = this.getId();
    packet.entityRuntimeId = getId();
    packet.x = (float) x;
    packet.y = (float) y;
    packet.z = (float) z;
    packet.speedX = (float) motionX;
    packet.speedY = (float) motionY;
    packet.speedZ = (float) motionZ;
    packet.yaw = (float) yaw;
    packet.pitch = (float) pitch;
    packet.metadata = dataProperties;
    player.dataPacket(packet);
    super.spawnTo(player);
}