Skip to content

Commit

Permalink
That's it, done, I think?
Browse files Browse the repository at this point in the history
  • Loading branch information
iChun committed May 31, 2021
1 parent 340339d commit feac621
Show file tree
Hide file tree
Showing 37 changed files with 160 additions and 117 deletions.
2 changes: 2 additions & 0 deletions docs/components/config/condition/Condition.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Condition

The base Condition class. All Conditions extend from this class, and as a result, have all the fields defined in this Class as well.

Conditions are meant to only be triggered on Clients. Conditions may potentially be triggered on the Server-side, but is highly discouraged.

<br />

## Fields
Expand Down
4 changes: 2 additions & 2 deletions docs/components/config/condition/TwoHighSpaceCondition.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Finds for a two block high air space around a target (customisable). Works simil
| *`type`* | String | Internal ID for serialisation: `freeSpace` | Not seen in the Editor. |
| *`target`* | String | Target selector string to target. | |
| *`horiRadius`* | String | Horizontal radius the check. | |
| *`vertRadius`* | String | Vertical radius to check. Make sure two of this is higher than Custom Height. | |
| *`vertRadius`* | String | Vertical radius to check. Make sure two of this is higher than `customHeight`. | |
| *`tries`* | String | How many tries (horizontally) we try and check. Try not to put this too excessively high. | |
| *`variableName`* | String | Variable name to put the result into. | |
| `customHeight` | String | Custom Height. If left out, defaults to 2. Make sure two of vertRadius is higher than this number. | |
| `customHeight` | String | Custom Height. If left out, defaults to `2`. Make sure two of `vertRadius` is higher than this number. | |

///Footnotes Go Here///

Expand Down
4 changes: 2 additions & 2 deletions docs/components/config/outcome/ChatMessageOutcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Use this outcome to send put a message in chat if the player is in the world. Th
| -------- | ------ | ----------- | --------------- |
| *`type`* | String | Internal ID for serialisation: `chat` | Not seen in the Editor. |
| *`message`* | String | Message to send. Supports Minecraft's Text Formatting | |
| *`inActionBar`* | Boolean | Put the message in the player's Action Bar instead? | |
| *`sendToServer`* | Boolean | Send the message to the server instead? (No Action Bar support) | |
| `inActionBar` | Boolean | Put the message in the player's Action Bar instead? | |
| `sendToServer` | Boolean | Send the message to the server instead? (No Action Bar support) | |

///Footnotes Go Here///

Expand Down
24 changes: 19 additions & 5 deletions docs/components/config/outcome/CommandOutcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Command Outcome

## Description

Trigger a client-side or server-side command. There's a potential for this Outcome to be client-side only.
Trigger a client-side or server-side command. This Outcome becomes Client-side if you are unable to send outcomes to the server, have `executeAsSelf` enabled and have not enabled `disableChatCommandFallback`.

<br />

Expand All @@ -13,11 +13,25 @@ Trigger a client-side or server-side command. There's a potential for this Outco
| -------- | ------ | ----------- | --------------- |
| *`type`* | String | Internal ID for serialisation: `command` | Not seen in the Editor. |
| *`command`* | String | String to be put into the command. | |
| *`executeAsSelf`* | Boolean | Should the command be executed as the streamer or the server? (Only if the command is serverside) | |
| *`handleFeedback`* | String | How to handle the feedback of the command? Leave it as null to silence feedback (will not silence command errors). Leave it an empty string to allow the feedback. Put a name in to attempt to capture the feedback into a global variable of said name (only if the command is "executeAsSelf"). This listens for feedback from the server and will stop after a second. Bear in mind that CCI has to guess which chat message received is the feedback from the command, so do your testing! Allows variable insertion for the name. The feedback can not be used in the same event, as there will be a delay from sending the command to the server and to wait for the feedback. To use the feedback you will need to use a staggered event, or another event and a later time. | |
| *`feedbackKeys`* | String[] | To be used with "handleFeedback". If you know which feedback translation keys to listen for, put them in the array. If not, leave null, and CCI will capture the first available command feedback. To be used with commands that return several lines of feedback. Eg: Doing "/time query daytime" will return a localizable string with the key "commands.time.query". Add that if you want to capture just that one feedback line. | |
| *`disableChatCommandFallback`* | Boolean | If you are connected to a server where you don't have CCI permissions/server doesn't have CCI installed, and "executeAsSelf" is enabled, CommandOutcome tries to send a chat message with the command instead. Turning this on disables that. | |
| `executeAsSelf` | Boolean | Should the command be executed as the streamer or the server? | |
| `handleFeedback` | String | Variable name to insert server feedback. The server feedback will be inserted into a Global variable. | Please read the section below. |
| `feedbackKeys` | String Array | Translation keys to capture. | Please read the section below. |
| `disableChatCommandFallback` | Boolean | If you are connected to a server where you don't have CCI permissions/server doesn't have CCI installed, and `executeAsSelf` is enabled, `CommandOutcome` tries to send a chat message with the command instead. Turning this on disables that. | Chat fallback will also warn you if your message is too long or has invalid characters. |

///Footnotes Go Here///

[^-1]: Fields in *italics* are required for the Object to be valid.

## Handling the Feedback from the Server

Some commands have feedback that you would like to listen to. This is where `handleFeedback` and `feedbackKeys` come in.

`handleFeedback` tells CCI how to handle feedback. Leaving it as `null` makes CCI silence feedback. Leaving an empty String (note, this is not the same as `null`!), allows all feedback. Anything else will define the variable name we will input the feedback into, and will likely require the use of `feedbackKeys`. CCI will try and listen for feedback for a second after the command is sent (if feedback takes longer than this to return, you have other things to worry about).

You cannot silence feedback when you are using the chat fallback, but you can still capture feedback.

Be mindful that feedback is only sent to you when `executeAsSelf` is turned on.

Without using `feedbackKeys`, CCI will capture the first System Chat message that comes in. With `feedbackKeys`, if you know the translation keys that the command sends back, eg. `commands.time.query` from the Time Command, put them in the field. CCI will capture the first one that matches any one of the keys and consider it a job done.

To use this feedback however, you need another event to check for your variable set in `handleFeedback`.
4 changes: 2 additions & 2 deletions docs/components/config/outcome/ConditionalOutcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Conditional Outcome

## Description

Use this outcome to check for a specific condition before triggering. There's a potential for this Outcome to be client-side only.
Use this outcome to check for a specific condition before triggering. This Outcome is Client-side only.

<br />

Expand All @@ -14,7 +14,7 @@ Use this outcome to check for a specific condition before triggering. There's a
| *`type`* | String | Internal ID for serialisation: `conditional` | Not seen in the Editor. |
| *`condition`* | Condition | The condition to check. | |
| *`outcome`* | Outcome | The outcome to trigger. | |
| *`conditionNotMetOutcome`* | Outcome | An optional outcome to trigger if the condition isn't met. | |
| `conditionNotMetOutcome` | Outcome | An optional outcome to trigger if the condition isn't met. | |

///Footnotes Go Here///

Expand Down
2 changes: 1 addition & 1 deletion docs/components/config/outcome/ConstantOutcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Constant Outcome

## Description

Use this outcome to call a constant outcome. There's a potential for this Outcome to be client-side only.
Use this outcome to call a constant outcome. This Outcome is Client-side only.

<br />

Expand Down
6 changes: 4 additions & 2 deletions docs/components/config/outcome/EventOutcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Event Outcome

## Description

Attempt to trigger even more events. Use this to trigger delayed events, such as when Requesting Statistics or awaiting Command Feedback. Be mindful that the event's conditions are checked before triggering, so any functional conditions need to be done in a ConditionalOutcome instead, if the event has a delay. There's a potential for this Outcome to be client-side only.
Attempt to trigger even more events. Use this to trigger delayed events, such as when Requesting Statistics or awaiting Command Feedback.

Be mindful that the event's conditions are checked before triggering, so any functional conditions need to be done in a `ConditionalOutcome` instead, if the event has a delay. This Outcome is Client-side only.

<br />

Expand All @@ -12,7 +14,7 @@ Attempt to trigger even more events. Use this to trigger delayed events, such as
| Name | Type | Description | Additional Info |
| -------- | ------ | ----------- | --------------- |
| *`type`* | String | Internal ID for serialisation: `event` | Not seen in the Editor. |
| *`events`* | Event[] | List of events to attempt to trigger. | |
| *`events`* | Event Array | List of events to attempt to trigger. | |

///Footnotes Go Here///

Expand Down
4 changes: 2 additions & 2 deletions docs/components/config/outcome/FakeCrashOutcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Fake Crash Outcome

## Description

Pretends to crash the game. There's a potential for this Outcome to be client-side only.
Pretends to crash the game. This Outcome is Client-side only.

<br />

Expand All @@ -13,7 +13,7 @@ Pretends to crash the game. There's a potential for this Outcome to be client-si
| -------- | ------ | ----------- | --------------- |
| *`type`* | String | Internal ID for serialisation: `fakeCrash` | Not seen in the Editor. |
| *`crashType`* | String | Type of crash: 1 = Freeze. 2 = Out of Memory Screen. | |
| *`crashDuration`* | String | The duration of the fake crash, in ticks. | |
| `crashDuration` | String | The duration of the fake crash, in ticks. Defaults to 5 seconds. | |

///Footnotes Go Here///

Expand Down
13 changes: 9 additions & 4 deletions docs/components/config/outcome/FoodOutcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@ Food Outcome

Adds a certain stat to players' food stats. Either level and saturation, or exhaustion.

| Protip |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Good luck figuring out the numbers, cause I have no clue, all I do is call the code.<br /><br />If you find out what numbers work for what, please let me know and I'll add them here for others to read. |

<br />

## Fields

| Name | Type | Description | Additional Info |
| -------- | ------ | ----------- | --------------- |
| *`type`* | String | Internal ID for serialisation: `food` | Not seen in the Editor. |
| *`target`* | String | The target selector for the entities to affect. | |
| *`level`* | String | Level/Healing to add. | |
| *`saturation`* | String | Saturation to add. | |
| *`exhaustion`* | String | Exhaustion to add. | |
| *`target`* | String | The target selector for the entities to affect. | Only affects players. |
| *`level`*[^1] | String | Level/Healing to add. | |
| *`saturation`*[^1] | String | Saturation to add. | |
| *`exhaustion`*[^1] | String | Exhaustion to add. | |

///Footnotes Go Here///

[^-1]: Fields in *italics* are required for the Object to be valid.
[^1]: Either `level` and `saturation` or just `exhaustion` is required for the Object to be valid.
2 changes: 1 addition & 1 deletion docs/components/config/outcome/GameCrashOutcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Game Crash Outcome

## Description

Forces the game to crash. There's a potential for this Outcome to be client-side only.
Forces the game to crash. This Outcome is Client-side only.

<br />

Expand Down
2 changes: 1 addition & 1 deletion docs/components/config/outcome/GameSettingsOutcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Game Settings Outcome

## Description

Sets a Game Setting to the file, and forces a Game Settings reload. There's a potential for this Outcome to be client-side only.
Sets a Game Setting to the file, and forces a Game Settings reload. This Outcome is Client-side only.

<br />

Expand Down
4 changes: 2 additions & 2 deletions docs/components/config/outcome/IMCOutcome.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
IMCOutcome
IMC Outcome
=============

## Description
Expand All @@ -12,7 +12,7 @@ Sends an InterModComms runtime message to another mod. There's a potential for t
| Name | Type | Description | Additional Info |
| -------- | ------ | ----------- | --------------- |
| *`type`* | String | Internal ID for serialisation: `imc` | Not seen in the Editor. |
| *`modId`* | String | The modId of the mod to send this message to. | |
| *`modId`* | String | The `modId` of the mod to send this message to. | |
| *`subject`* | String | The key/subject of the IMC message. | |
| *`message`* | String | The value/message of the IMC message. | |

Expand Down
6 changes: 3 additions & 3 deletions docs/components/config/outcome/InputOutcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Input Outcome

## Description

Pop-up a window that requires the player to input some text. There's a potential for this Outcome to be client-side only.
Pop-up a window that requires the player to input some text. This Outcome is Client-side only.

<br />

Expand All @@ -13,9 +13,9 @@ Pop-up a window that requires the player to input some text. There's a potential
| -------- | ------ | ----------- | --------------- |
| *`type`* | String | Internal ID for serialisation: `input` | Not seen in the Editor. |
| *`text`* | String | The information text for the pop up. | |
| *`defaultInput`* | String | Default text for the input box. | |
| `defaultInput` | String | Default text for the input box. | |
| *`variableInput`* | String | The variable name to put the String from the input box once the player hits Done. | |
| *`postInputOutcome`* | Outcome | An outcome to trigger after the player hits Done. Bear in mind that the variable this InputOutcome inserts into is not a global variable and thus will be discarded if not stored in one. | |
| `postInputOutcome` | Outcome | An outcome to trigger after the player hits Done. Bear in mind that the variable this InputOutcome inserts into is not a global variable and thus will be discarded if not stored in one. | |

///Footnotes Go Here///

Expand Down
22 changes: 14 additions & 8 deletions docs/components/config/outcome/InventoryOutcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,21 @@ Manipulate the inventories of a set of entities matching the target selector.
| -------- | ------ | ----------- | --------------- |
| *`type`* | String | Internal ID for serialisation: `inventory` | Not seen in the Editor. |
| *`target`* | String | The target selector for the entities to affect. | |
| *`funcType`* | String | Available types: drop, swap, amount, delete, playerSwap, add | |
| *`index`* | String | The index/slot number for the inventories. Used by all types except playerSwap. For reference, it should be: 0-35 for Main Inventory, 36-39 for Armor, 40 for Off hand, 41+ for modded inventories. For some funcs, -1 means current item. | |
| *`additionalArgs`* | String | Additional arguments:
For Drop & Delete: The item stack count.
For Swap: The index/slot to swap with.
For Amount: The amount to increase/decrease the stack by.
For Player Swap: The target selector for the other player.
For Add: A string denoting what item to give and the count. Essentially the bit after "/give <target> " in the give command, like "minecraft:dirt 3" gives 3 dirt blocks | |
| *`funcType`* | String | Available types: `drop`, `swap`, `amount`, `delete`, `playerSwap`, `add` | |
| *`index`* | String | The index/slot number for the inventories. Used by all types except `playerSwap`. | For reference, it should be: `0-35` for Main Inventory, `36-39` for Armor, `40` for Off hand, `41+` for modded inventories. For some funcs, `-1` means current item. |
| *`additionalArgs`* | String | Additional arguments: Read below. | |

///Footnotes Go Here///

[^-1]: Fields in *italics* are required for the Object to be valid.

## Additional Arguments

| Type ID | Function | Argument |
| ------------ | ------------------------------------------ | -------- |
| `drop` | Drops item | The item stack count |
| `swap` | Swaps item with another slot | The index/slot to swap with |
| `amount` | Change item's stack size | The amount to increase/decrease the stack by |
| `delete` | Deletes item | The item stack count |
| `playerSwap` | Swaps entire inventory with another player | The target selector for the other player |
| `add` | Adds new item | A string denoting what item to give and the count. Essentially the bit after `/give <target> ` in the `give` command, like `minecraft:dirt 3` gives 3 dirt blocks |

0 comments on commit feac621

Please sign in to comment.