All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.network.protocol.SyncEntityPropertyPacket Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit.network.protocol;

import cn.nukkit.api.PowerNukkitOnly;
import cn.nukkit.api.Since;
import cn.nukkit.nbt.tag.CompoundTag;

@PowerNukkitOnly
@Since("1.5.0.0-PN")
public class SyncEntityPropertyPacket extends DataPacket {
    @PowerNukkitOnly
    @Since("1.5.0.0-PN")
    public static final byte NETWORK_ID = ProtocolInfo.SYNC_ENTITY_PROPERTY_PACKET;

    private CompoundTag data;

    @PowerNukkitOnly
    @Since("1.5.0.0-PN")
    public SyncEntityPropertyPacket() {
        // Does nothing
    }

    @Override
    public byte pid() {
        return NETWORK_ID;
    }

    @Override
    public void decode() {
        data = getTag();
    }

    @Override
    public void encode() {
        reset();
        putTag(data);
    }

    @PowerNukkitOnly
    @Since("1.5.0.0-PN")
    public CompoundTag getData() {
        return data;
    }

    @PowerNukkitOnly
    @Since("1.5.0.0-PN")
    public void setData(CompoundTag data) {
        this.data = data;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy