package common.util;

import common.entity.Entity;

public class HitPosition {
	public static enum ObjectType {
		MISS, BLOCK, ENTITY;
	}

	public final ObjectType type;
	public final BlockPos block;
	public final Facing side;
	public final Vec3 vec;
	public final Entity entity;

	public HitPosition(Entity entity) {
		this(entity, new Vec3(entity.posX, entity.posY, entity.posZ));
	}

	public HitPosition(ObjectType type, Vec3 vec, Facing side, BlockPos block) {
		this.type = type;
		this.block = block;
		this.side = side;
		this.entity = null;
		this.vec = new Vec3(vec.xCoord, vec.yCoord, vec.zCoord);
	}

	public HitPosition(Entity entity, Vec3 vec) {
		this.type = ObjectType.ENTITY;
		this.block = null;
		this.side = null;
		this.entity = entity;
		this.vec = vec;
	}
}
