Quarry

A quarry is a contraption, that automatically removes all blocks from an area of indefinite size in a definite amount of time. Additionally quarries usually process the removed blocks in some way, meaning the blocks get broken and put into chests. Quarries belong to slime-stone technology.

## Reaching the blocks

To do anything with all blocks in an area of indefinite size, the quarry must be able to somehow reach all the blocks in the area. If the area has an indefinite size, the coordinates of the blocks are at least partially unknown.

### Mobile and Static Approach

In a 1-dimensional Quarry, there are two main ways to reach a block with unknown coordinates along a certain axis: You can either use a flying machine, that moves along the axis, or you can use an infinitely expandable static contraption, that reaches all blocks along the axis at once. The approach with the flying machine will be called "M" from now on, the other approach will be called "S". Both approaches have advantages and disadvantages. While S instantly reaches all blocks along an axis, systems using M needs to fly to the block. This means S is faster than M. However the amount of resources and the setup time required for an S system increases with the size of the quarry. This means M is usually a lot cheaper and easier to set up than S.

### Multiple Dimensions

In multiple dimensions the blocks have unknown coordinates along multiple axes. For each of the axis either M or S can be used. This means to reach all blocks in a 2-dimensional environment, you can either use flying machines, that move along both axes (MM), a system that can reach entire lines at once by being expandable in one direction and can move along the other axis (MS), or you can use a static piston contraption, that reaches all blocks in the plane at any given point in time (SS). Again, the more S there are, the faster and more expensive the quarry is.

In 3 dimensions you can use a flying machine moving along all 3 axes (MMM), a line by line flying machine moving along 2 axes (MMS), a plane by plane flying machine moving along 1 axis (MSS), or a completely static piston contraption, that mines your cube.

### Repeatability of Movement

If a contraption uses the M approach on multiple axes, the movement along at least one of these axes must be repeatable, because otherwise some spots along the plane/cube will be missed. The only known way to make such a movement repeatable, is by making the flying machine capable of moving in both directions along the axis. This means a MM flying machine moves 2-way on at least one of the 2 axes it moves along, and a MMM flying machine moves 2-way on at least 2 of the 3 axes it moves along.

## Coordinate Fixation

Once the quarry reaches a block, it must do something with it. One thing the quarry needs to do with the block, is moving it from an unknown position to a fixed position. This process is called coordinate fixation.

### Recursion in multiple Dimensions

Usually coordinate fixation happens for one coordinate at a time. This means, if a block has three unknown coordinates, the block will first be moved into a specific plane, where the block has only two unknown coordinates and one fixed coordinate. After that the process of fixing one coordinate at a time is repeated, until all coordinates of the block are fixed.

So a 3D Quarry basically consists out of a contraption to fixate one coordinate of all blocks inside a cube + a 2D Quarry. A 2D Quarry uses a mechanism to fixate one coordinate of all blocks inside a plane + a 1D Quarry and so on.

### Moving with M

If a mechanism fixes the x-axis and uses a M approach to reach all blocks along the x-axis, the coordinate can simply be fixated by moving the blocks along with the flying machine, that reaches them. Since there are usually multiple blocks along one axis, this process must be repeatable. So if a flying machine moves along an axis, and fixes the coordinates of blocks along the same axis, the flying machine must be able to move in both directions along the axis.

### Conveyor with S

If a mechanism fixes the x-axis and uses a M approach to reach all blocks along the x-axis, a complicated conveyor mechanism has to be used. Every module of the infinitely expandable contraption must be able to move the blocks, that it reaches, to the module next to it. This process is much more complicated than moving blocks with a M approach.

## Processing

At some point in time, the quarry has to break the blocks and put them into chests. This is usually done using a wither cage.

### Processing in 0 dimensions

The easiest way to do the processing, is to have a single static wither cage, that processes the blocks, after all their coordinates have been fixated. It is theoretically possible to make mobile wither cages, or infinitely expandable wither cage arrays, however there is rarely an advantage.

### Gravitational y-fixation

It might make sense to process blocks in a dimension higher than 0, if the processing happens in a vertical 1 dimensional environment. Because in that case, the y-fixation can be done in a fast and cheap way, by letting the items from the wither cages fall down.

## Control System

It is not sufficient to have a contraption, that can theoretically reach, fixate and process all blocks, if the right things aren´t activated at the right time. The unit, that sends flying machines off in the right directions at the right time is called the control system. The control system however varies largely from the concrete designs.

### Sending information

One thing, that most control systems might need to do at some point, is send information from one point to the next. This is not necessarily required, if every part of the control system manages to figure out what to do, simply by looking at which flying machines arrive at its location at which time, but it might be difficult to make an entire quarry based on this.

To send information, control points can use mobile flying machines, that serve as instructions, to other control points. This method is quite slow.

Control points can also be connected by static redstone, ideally instant wire. This is the fastest method, however it is quite expensive.

Control points can also communicate using wireless redstones, by exploiting the hitboxbug.

## Unmovable Blocks

The coordinates of a block can only be effectively fixated, if the block is movable. Therefore unmovable blocks like obsidian or spawners can break quarries.

There are the following ways to deal with the problem of unmovable blocks.

### Pre-processing in 3 dimensions

If a 5-way mobile wither cage, a 3-way array of mobile wither cages, a plane of mobile wither cages, or a static cube of withers is used, it´s possible to process the blocks in a 3-dimensional environment before fixating their coordinates. After all the blocks have been broken, only the coordinates of the items have to be fixated.

### Avoiding unmovable blocks

Large parts of the nether and the end are completely free of unmovable blocks. Also chunks in the overworld, that have not been affected by terrain population, don´t have any unmovable blocks except bedrock. Here a quarry can be set up without having to worry about unmovable blocks.

### Detecting unmovable blocks

A system can be made, that detects, whether there are any unmovable blocks in the area, and if it finds any, it stops the quarry and notifies the player. However this detection system must also be able to reach all blocks in a 3-dimensional environment, and must be able to get the information back to a fixed position. Therefore this process is more difficult, than it might appear first.

## Horizontal and Vertical Designs

Quarries, that mine from the top down are called vertical quarries. Quarries mining from a horizontal side, are called horizontal quarries. Both have their own problems.

### Gravel

While horizontal quarries usually have no problem dealing with gravels, it can break vertical quarry designs, because the gravel block might be picked up, but then fall back in a location, the quarry thinks it has already mined. This is especially difficult to prevent, if the y-coordinate gets fixated first.

### Liquids

While vertical quarries usually have no problem dealing with liquids, they can break horizontal quarry designs, because the liquids can update pistons at unexpected timing, and even more importantly, liquids can generate cobblestone and stone in locations, the quarry thinks it has already mined.