summaryrefslogtreewikicommitdiff
path: root/src/main/java/dev/tylerm/khs/util/packet/EntityTeleportPacket.java
blob: cd29e28703d743478ddb2ef8ee821d7aaf75df71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package dev.tylerm.khs.util.packet;

import com.comphenix.protocol.PacketType;
import org.bukkit.entity.Entity;
import org.jetbrains.annotations.NotNull;

public class EntityTeleportPacket extends AbstractPacket {

    public EntityTeleportPacket(){
        super(PacketType.Play.Server.ENTITY_TELEPORT);
    }

    public void setEntity(@NotNull Entity entity){
        super.packet.getIntegers().write(0, entity.getEntityId());
    }

    public void setX(double x){
        super.packet.getDoubles().write(0, x);
    }

    public void setY(double y){
        super.packet.getDoubles().write(1, y);
    }

    public void setZ(double z){
        super.packet.getDoubles().write(2, z);
    }

}