Search in sources :

Example 1 with LevelEventPacket

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

the class BoneMealParticle method encode.

@Override
public DataPacket[] encode() {
    LevelEventPacket pk = new LevelEventPacket();
    pk.evid = LevelEventPacket.EVENT_PARTICLE_BONEMEAL;
    pk.x = (float) this.x;
    pk.y = (float) this.y;
    pk.z = (float) this.z;
    pk.data = 0;
    return new DataPacket[] { pk };
}
Also used : LevelEventPacket(cn.nukkit.network.protocol.LevelEventPacket) DataPacket(cn.nukkit.network.protocol.DataPacket)

Example 2 with LevelEventPacket

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

the class GenericParticle method encode.

@Override
public DataPacket[] encode() {
    LevelEventPacket pk = new LevelEventPacket();
    pk.evid = (short) (LevelEventPacket.EVENT_ADD_PARTICLE_MASK | this.id);
    pk.x = (float) this.x;
    pk.y = (float) this.y;
    pk.z = (float) this.z;
    pk.data = this.data;
    return new DataPacket[] { pk };
}
Also used : LevelEventPacket(cn.nukkit.network.protocol.LevelEventPacket) DataPacket(cn.nukkit.network.protocol.DataPacket)

Example 3 with LevelEventPacket

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

the class DestroyBlockParticle method encode.

@Override
public DataPacket[] encode() {
    LevelEventPacket pk = new LevelEventPacket();
    pk.evid = LevelEventPacket.EVENT_PARTICLE_DESTROY;
    pk.x = (float) this.x;
    pk.y = (float) this.y;
    pk.z = (float) this.z;
    pk.data = this.data;
    return new DataPacket[] { pk };
}
Also used : LevelEventPacket(cn.nukkit.network.protocol.LevelEventPacket) DataPacket(cn.nukkit.network.protocol.DataPacket)

Example 4 with LevelEventPacket

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

the class MobSpawnParticle method encode.

@Override
public DataPacket[] encode() {
    LevelEventPacket packet = new LevelEventPacket();
    packet.evid = LevelEventPacket.EVENT_PARTICLE_SPAWN;
    packet.x = (float) this.x;
    packet.y = (float) this.y;
    packet.z = (float) this.z;
    packet.data = (this.width & 0xff) + ((this.height & 0xff) << 8);
    return new DataPacket[] { packet };
}
Also used : LevelEventPacket(cn.nukkit.network.protocol.LevelEventPacket) DataPacket(cn.nukkit.network.protocol.DataPacket)

Example 5 with LevelEventPacket

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

the class PunchBlockParticle method encode.

@Override
public DataPacket[] encode() {
    LevelEventPacket pk = new LevelEventPacket();
    pk.evid = LevelEventPacket.EVENT_PARTICLE_PUNCH_BLOCK;
    pk.x = (float) this.x;
    pk.y = (float) this.y;
    pk.z = (float) this.z;
    pk.data = this.data;
    return new DataPacket[] { pk };
}
Also used : LevelEventPacket(cn.nukkit.network.protocol.LevelEventPacket) DataPacket(cn.nukkit.network.protocol.DataPacket)

Aggregations

DataPacket (cn.nukkit.network.protocol.DataPacket)6 LevelEventPacket (cn.nukkit.network.protocol.LevelEventPacket)6