Search in sources :

Example 1 with PEEntityLink

use of org.dragonet.common.data.entity.PEEntityLink in project DragonProxy by DragonetMC.

the class AddPlayerPacket method encodePayload.

@Override
public void encodePayload() {
    putUUID(uuid);
    putString(username);
    // putString(thirdpartyName != null ? thirdpartyName : username);
    // putVarInt(platformID);
    putVarLong(eid);
    putUnsignedVarLong(rtid);
    // putString(platformChatID);
    putVector3F(position);
    putVector3F(motion);
    putLFloat(pitch);
    putLFloat(yaw);
    putLFloat(headYaw);
    putSlot(item);
    if (meta != null) {
        meta.encode();
        put(meta.getBuffer());
    } else {
        putUnsignedVarInt(0);
    }
    // Flags
    putUnsignedVarInt(0);
    // Command permission
    putUnsignedVarInt(0);
    // Action Permissions
    putUnsignedVarInt(0);
    // Permission Level
    putUnsignedVarInt(0);
    // Custom stored permissions
    putUnsignedVarInt(0);
    // User Id
    putLLong(0L);
    if (links != null && links.length > 0) {
        putUnsignedVarInt(links.length);
        for (PEEntityLink l : links) {
            putEntityLink(l);
        }
    } else {
        putUnsignedVarInt(0);
    }
}
Also used : PEEntityLink(org.dragonet.common.data.entity.PEEntityLink)

Example 2 with PEEntityLink

use of org.dragonet.common.data.entity.PEEntityLink in project DragonProxy by DragonetMC.

the class AddEntityPacket method encodePayload.

@Override
public void encodePayload() {
    putVarLong(eid);
    putUnsignedVarLong(rtid);
    putUnsignedVarInt(type);
    putVector3F(position);
    putVector3F(motion);
    putLFloat(pitch);
    putLFloat(yaw);
    if (attributes != null && attributes.size() > 0) {
        putUnsignedVarInt(attributes.size());
        for (PEEntityAttribute attr : attributes) {
            putString(attr.name);
            putLFloat(attr.min);
            putLFloat(attr.currentValue);
            putLFloat(attr.max);
        }
    } else {
        putUnsignedVarInt(0);
    }
    if (meta != null) {
        meta.encode();
        put(meta.getBuffer());
    } else {
        putUnsignedVarInt(0);
    }
    if (links != null && links.length > 0) {
        putUnsignedVarInt(links.length);
        for (PEEntityLink l : links) {
            putEntityLink(l);
        }
    } else {
        putUnsignedVarInt(0);
    }
}
Also used : PEEntityLink(org.dragonet.common.data.entity.PEEntityLink) PEEntityAttribute(org.dragonet.common.data.entity.PEEntityAttribute)

Aggregations

PEEntityLink (org.dragonet.common.data.entity.PEEntityLink)2 PEEntityAttribute (org.dragonet.common.data.entity.PEEntityAttribute)1