import net.minecraft.core.BlockPos;
-import java.util.Objects;
-
public class CubicChunkPos {
public final int x;
public final int y;
public CubicChunkPos(BlockPos blockPos) {
this.x = blockPos.getX() >> 4;
- this.y = blockPos.getY() >> 4;
+ this.y = blockPos.getY() >> 5;
this.z = blockPos.getZ() >> 4;
}
}
public int getMinBlockY() {
- return this.y << 4;
+ return this.y << 5;
}
public int getMinBlockZ() {
}
public int getMaxBlockY() {
- return (this.y << 4) + 15;
+ return (this.y << 5) + 31;
}
public int getMaxBlockZ() {
return x == that.x && y == that.y && z == that.z;
}
+ @Override
+ public String toString() {
+ return "CubicChunkPos{" +
+ "x=" + x +
+ ", y=" + y +
+ ", z=" + z +
+ '}';
+ }
+
@Override
public int hashCode() {
- return Objects.hash(x, y, z);
+ return Long.hashCode(toLong());
}
}