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

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

Go to download

A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.

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

import cn.nukkit.api.PowerNukkitOnly;
import cn.nukkit.api.Since;
import lombok.ToString;

/**
 * @author joserobjr
 */
@PowerNukkitOnly
@Since("1.4.0.0-PN")
@ToString
public class PositionTrackingDBClientRequestPacket extends DataPacket {
    @PowerNukkitOnly
    @Since("1.4.0.0-PN")
    public static final byte NETWORK_ID = ProtocolInfo.POS_TRACKING_CLIENT_REQUEST_PACKET;
    
    private static final Action[] ACTIONS = Action.values();
    
    private Action action;
    private int trackingId;

    @PowerNukkitOnly
    @Since("1.4.0.0-PN")
    public Action getAction() {
        return action;
    }

    @PowerNukkitOnly
    @Since("1.4.0.0-PN")
    public int getTrackingId() {
        return trackingId;
    }

    @Override
    public void encode() {
        reset();
        putByte((byte) action.ordinal());
        putVarInt(trackingId);
    }

    @Override
    public void decode() {
        int aByte = getByte();
        action = ACTIONS[aByte];
        trackingId = getVarInt();
    }

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

    @Since("1.4.0.0-PN")
    @PowerNukkitOnly
    public enum Action {
        @PowerNukkitOnly
        @Since("1.4.0.0-PN")
        QUERY
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy