File size: 692 Bytes
d46f4a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
30
package net.minecraft.world.phys;

import net.minecraft.world.entity.Entity;

public abstract class HitResult {
    protected final Vec3 location;

    protected HitResult(Vec3 p_82447_) {
        this.location = p_82447_;
    }

    public double distanceTo(Entity p_82449_) {
        double d0 = this.location.x - p_82449_.getX();
        double d1 = this.location.y - p_82449_.getY();
        double d2 = this.location.z - p_82449_.getZ();
        return d0 * d0 + d1 * d1 + d2 * d2;
    }

    public abstract HitResult.Type getType();

    public Vec3 getLocation() {
        return this.location;
    }

    public static enum Type {
        MISS,
        BLOCK,
        ENTITY;
    }
}