# Vocabulary

> Every Kind, Cause, Actor, OperationType, Phase, Outcome and Failure.Reason in the Oasis API, with what each one means.

Source: https://oasis-protection.com/docs/api/reference/

These tables list every value of the API’s enums. They come from the enums themselves, so the words, keys and flags are exact. Each enum’s `description()` is the short text Oasis shows players, and you can show it too.

## Kind

What an edit describes. `word()` is the stored word, and `plural()` is the word staff type after `kind` in a command. `Kind.of(String)` finds a kind by either one, in any case.

Only kinds with `canRollBack()` change the world in an operation. The rest are for lookups. Only kinds with `inspectable()` describe the world at a place, so only they appear in [`lookups().history(block)`](/docs/api/reading-history/#the-history-of-one-block).

| Kind        | `word()`    | `plural()`   | `canRollBack()` | `inspectable()` | `description()`                                          |
| ----------- | ----------- | ------------ | --------------- | --------------- | -------------------------------------------------------- |
| `BLOCK`     | `block`     | `blocks`     | Yes             | Yes             | block changes                                            |
| `CONTAINER` | `container` | `containers` | Yes             | Yes             | items moved in chests and other containers               |
| `ENTITY`    | `entity`    | `entities`   | Yes             | Yes             | mobs, armor stands, vehicles, paintings, and item frames |
| `ITEM`      | `item`      | `items`      | No              | Yes             | items dropped and picked up                              |
| `BOOK`      | `book`      | `books`      | No              | No              | books written and signed                                 |
| `CHAT`      | `chat`      | `chat`       | No              | No              | chat messages                                            |
| `COMMAND`   | `command`   | `commands`   | No              | No              | commands run                                             |
| `SESSION`   | `session`   | `sessions`   | No              | No              | logins and logouts                                       |
| `RENAME`    | `rename`    | `renames`    | No              | No              | items named in an anvil                                  |

## Cause

What happened. `word()` is the stored word, and the word staff type after `cause` in a command. `Cause.of(String)` finds a cause by its word, in any case.

The logger throws `IllegalArgumentException` for `ROLLBACK`, `UNDO` and `REDO`, because only Oasis writes them. See [Causes only Oasis writes](/docs/api/logging-edits/#causes-only-oasis-writes). A selection may name them.

| Cause         | `word()`      | `description()`                                                                              |
| ------------- | ------------- | -------------------------------------------------------------------------------------------- |
| `BREAKING`    | `breaking`    | a block, an armor stand, or a vehicle was broken                                             |
| `PLACING`     | `placing`     | a player placed a block                                                                      |
| `EXPLOSION`   | `explosion`   | TNT, creepers, beds, and crystals                                                            |
| `FIRE`        | `fire`        | fire destroyed a block                                                                       |
| `IGNITION`    | `ignition`    | fire lit by a player, lava, or lightning                                                     |
| `FLOW`        | `flow`        | water or lava flowed into a block                                                            |
| `MELTING`     | `melting`     | ice or snow melted, coral died                                                               |
| `FORMING`     | `forming`     | ice, snow, or concrete formed                                                                |
| `SPREADING`   | `spreading`   | fire, grass, mushrooms, or vines spread                                                      |
| `DECAY`       | `decay`       | leaves decayed                                                                               |
| `GROWTH`      | `growth`      | crops, saplings, or trees grew                                                               |
| `PISTON`      | `piston`      | a piston moved a block                                                                       |
| `BUCKET`      | `bucket`      | water or lava poured or scooped up with a bucket, or poured by a dispenser                   |
| `SIGN`        | `sign`        | text written on a sign                                                                       |
| `WRITING`     | `writing`     | a book written or signed                                                                     |
| `INTERACTION` | `interaction` | a door, gate, trapdoor, button, or lever used                                                |
| `WORLDEDIT`   | `worldedit`   | WorldEdit or FAWE                                                                            |
| `KILLING`     | `killing`     | a mob or an animal was killed                                                                |
| `SPAWNING`    | `spawning`    | a boat, minecart, or armor stand was placed, or a mob came from an egg, breeding, or a split |
| `HANGING`     | `hanging`     | a painting or item frame was placed or broken                                                |
| `FRAMING`     | `framing`     | an item put in, turned, or taken out of an item frame                                        |
| `EQUIPPING`   | `equipping`   | armor or an item put on or taken off an armor stand                                          |
| `TAKING`      | `taking`      | items taken out of a container                                                               |
| `PUTTING`     | `putting`     | items put into a container                                                                   |
| `DROPPING`    | `dropping`    | an item dropped by a player                                                                  |
| `PICKUP`      | `pickup`      | an item picked up by a player                                                                |
| `CHAT`        | `chat`        | a chat message                                                                               |
| `COMMAND`     | `command`     | a command run by a player                                                                    |
| `LOGIN`       | `login`       | a player joined                                                                              |
| `LOGOUT`      | `logout`      | a player left                                                                                |
| `ROLLBACK`    | `rollback`    | a rollback, a restore, or an undo put a block back                                           |
| `UNDO`        | `undo`        | FAWE undid a WorldEdit edit                                                                  |
| `REDO`        | `redo`        | FAWE redid a WorldEdit edit                                                                  |
| `RENAMING`    | `renaming`    | an item named in an anvil                                                                    |

## Actor

Who acted when no player did. Each actor has a stable `id()` and a `key()` that starts with `#`, so staff can name it after `user` like any player. The id is the same on every server: Oasis makes it from the key. `Actor.of(String)` finds an actor by its key, and `Actor.of(UUID)` by its id, which is empty for a player.

`isWorld()` is true when the actor is the world acting and not a person. A rollback looks through an edit of one of these: water, fire and decay are not someone who changed the block. WorldEdit from the console, the rollback actor and the console itself are not world actors. A world actor can carry an edit: `EditLog.via()` takes it, and an edit of it with nobody behind it reads it as both `person()` and `actor()`. The other three act as a person and carry nothing, so `via()` throws for them.

| Actor         | `key()`        | `isWorld()` | `description()`                                                  | `id()`                                 |
| ------------- | -------------- | ----------- | ---------------------------------------------------------------- | -------------------------------------- |
| `WATER`       | `#water`       | Yes         | water flow                                                       | `238b436a-60e8-3749-924f-cf3a986a00eb` |
| `LAVA`        | `#lava`        | Yes         | lava flow                                                        | `fd82c6ab-0c1f-3d49-8ec5-ad6218e7986e` |
| `FIRE`        | `#fire`        | Yes         | fire                                                             | `c7ea9c8a-104d-35f7-84c6-9754715d1a7a` |
| `EXPLOSION`   | `#explosion`   | Yes         | explosions with no player behind them: beds, crystals, fireballs | `a771dc97-8eff-3082-a086-99cd3bb7ae99` |
| `CREEPER`     | `#creeper`     | Yes         | creepers                                                         | `f06e198d-42c6-309f-87a4-9d8a40b9fba9` |
| `DISPENSER`   | `#dispenser`   | Yes         | items dispensed into the world by dispensers or droppers         | `4ae65d41-38e3-3c1b-a932-c5f9fa8b332f` |
| `DECAY`       | `#decay`       | Yes         | leaves decaying                                                  | `115faa9c-99cd-3bd5-a6aa-6da6a711614f` |
| `FALLING`     | `#falling`     | Yes         | sand, gravel, and anvils falling                                 | `fb3c7253-7915-3893-b5f0-5301439d5305` |
| `GROWTH`      | `#growth`      | Yes         | plants and trees growing                                         | `3e78147c-b7ec-3bd7-8a82-c1c21bdd2581` |
| `PISTON`      | `#piston`      | Yes         | pistons                                                          | `1abe6017-5805-36d9-8207-7db76ac4e52f` |
| `HOPPER`      | `#hopper`      | Yes         | items transferred between inventories by hoppers or droppers     | `27873a62-68ef-3369-a038-c15c6bc3f3ab` |
| `ENVIRONMENT` | `#environment` | Yes         | everything else the world did on its own                         | `3cdb86bf-e001-33c8-9291-8cf6933538cd` |
| `WORLDEDIT`   | `#worldedit`   | No          | WorldEdit from the console                                       | `0d38e07b-7cd8-37b7-b55c-2302d942cd15` |
| `ROLLBACK`    | `#rollback`    | No          | a rollback, a restore, or an undo Oasis ran                      | `d39c8832-29fc-3f6f-8f52-11598f4404c9` |
| `CONSOLE`     | `#console`     | No          | the console                                                      | `c7d56188-2b63-3bb4-b321-c5e2b6afd770` |

A plugin that asked for the API also has a key and an id, `#plugin:<Name>`. It is not an `Actor` value. Read it with [`oasis.id()` and `oasis.key(person)`](/docs/api/concepts/#what-the-api-acts-for).

## OperationType

What an operation does, as `Operation.type()`, `OperationChunkEvent.type()` and `OperationEndEvent.type()` read it. A sweep and a force have the type of the operation they follow.

| OperationType | Means                                                                |
| ------------- | -------------------------------------------------------------------- |
| `ROLLBACK`    | It puts back what the chosen edits changed, as it stood before them. |
| `RESTORE`     | It puts the chosen edits back after a rollback took them away.       |
| `UNDO`        | It reverses an earlier operation and the passes of its group.        |

## Phase

The stage an operation is in, as `Progress.phase()` reads it.

| Phase      | Means                                                                                                                                                    |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `PLANNING` | The operation reads what it must do. `Progress.fraction()` reads 0, and `chunks()` is 0.                                                                 |
| `APPLYING` | The first pass writes the world, a chunk at a time.                                                                                                      |
| `SWEEPING` | A follow-up pass of the same operation takes the lava, the water and the fire the world made while the first pass ran, which that pass could not select. |
| `FINISHED` | The operation and its sweeps ended.                                                                                                                      |

## Outcome

How an operation or a purge ended, as `Result.outcome()` and `PurgeResult.outcome()` read it. A purge never ends `CANCELLED`.

| Outcome     | Means                                                                                             |
| ----------- | ------------------------------------------------------------------------------------------------- |
| `FINISHED`  | The operation ran to its end.                                                                     |
| `CANCELLED` | `Operation.cancel()` stopped it. `Result.applied()` counts what it wrote before it stopped.       |
| `FAILED`    | It could not run, or stopped on an error. `Result.failure()` or `PurgeResult.failure()` says why. |

## Failure.Reason

Why an operation or a purge ended with `Outcome.FAILED`, as `Result.failure().get().reason()` or `PurgeResult.failure().get().reason()` reads it, or why a read could not answer, as `OasisException.failure().reason()` reads it. Test the reason in code, and show `Failure.message()` to people.

| Reason              | Means                                                                                                                                                                                                                       |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `BUSY`              | Another operation runs, or a purge runs, or an operation runs that can hold the edits of your purge. Oasis runs one at a time; start yours again when it ends.                                                              |
| `REBUILDING`        | The store rebuilds the runs that another build of Oasis wrote, after an update. Start it again when the rebuild ends.                                                                                                       |
| `MOVING`            | The history moves to another store (`/oasis move`). Start it again when the move ends.                                                                                                                                      |
| `STARTING`          | Oasis still opens its store, just after the server started. Start it again shortly.                                                                                                                                         |
| `OVERLOADED`        | The store holds as many requests as it takes. Start it again shortly.                                                                                                                                                       |
| `NOTHING_TO_UNDO`   | The undo names a person who has run no operation.                                                                                                                                                                           |
| `NO_SUCH_OPERATION` | The undo, or the read of kept positions, names an operation that the history does not hold.                                                                                                                                 |
| `STORE`             | The store failed: Oasis stopped logging, or the store could not read or record the operation, or a purge stopped on a store error. The operation or the purge does not run again by itself; the server log names the error. |
| `PASS`              | The pass stopped on an error after it began to write: the store failed under it, or a write to the world threw. The edits it wrote stay, and `Result.applied()` counts them.                                                |
| `NO_SUCH_WORLD`     | The selection names a world, chosen or left out, that is not loaded under that exact name, that Oasis never saw, and that the history holds no edit of. Most often a typo. Nothing ran, and the message names the world.    |
| `WORLD_GONE`        | The operation has edits in a world that is not loaded, that no [world loader](/docs/api/worlds/) owns, and that has no folder Oasis can load. It wrote nothing. The message names each such world.                          |
| `WORLD_LOAD`        | A world of the operation did not load: its world loader failed, or its folder did not open. The edits written before stay, and `Result.applied()` counts them. The message names the world and why.                         |
| `WORLD_FORMAT`      | A newer build of Oasis or Packs Server wrote values into a world of the operation, in a format this build does not know. The pass writes nothing into that world. Install that build or a newer one; the message names it.  |

[Running operations](/docs/api/operations/#when-an-operation-fails) says what to do about each one. A purge ends with `BUSY`, `NO_SUCH_WORLD`, `REBUILDING`, `MOVING`, `STARTING`, `OVERLOADED` or `STORE`. See [When a purge fails](/docs/api/purges/#when-a-purge-fails). A read, such as a lookup or an estimate, fails with `NO_SUCH_WORLD`, `STARTING`, `OVERLOADED`, `MOVING` or `STORE`, the read of kept positions also with `NO_SUCH_OPERATION`, and an estimate of an undo also with `NOTHING_TO_UNDO` or `NO_SUCH_OPERATION`. See [When a read fails](/docs/api/reading-history/#when-a-read-fails).
