package common.util;

public class WorldPos extends BlockPos {
	private final int dim;

	public WorldPos(int x, int y, int z, int dim) {
		super(x, y, z);
		this.dim = dim;
	}

	public WorldPos(BlockPos pos, int dim) {
		this(pos.getX(), pos.getY(), pos.getZ(), dim);
	}
	
    public int getDimension() {
        return this.dim;
    }

	public boolean equals(Object obj) {
		if(this == obj) {
			return true;
		}
		else if(!(obj instanceof WorldPos)) {
			return false;
		}
		else {
			WorldPos pos = (WorldPos)obj;
			return this.getX() == pos.getX() && this.getY() == pos.getY() && this.getZ() == pos.getZ() && this.dim == pos.dim;
		}
	}

	public int hashCode() {
		return super.hashCode() * 31 + this.dim;
	}

	public String toString() {
		return this.dim + ";" + this.getX() + ";" + this.getY() + ";" + this.getZ();
	}
}
