Skip to content

Commit

Permalink
Small clarifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
iChun committed May 31, 2021
1 parent c7d30fe commit 710a0dd
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 56 deletions.
29 changes: 15 additions & 14 deletions docs/components/config/Event.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ Deeper explanation of use available [here](../../../intermediate/configspecifics

## Fields

| Name | Type | Description | Additional Info |
| ----------------------------------- | -------------------------- | ----------- | --------------- |
| `name` | String | Optional name for this event, for Editor readability. | |
| `constantName` | String | The name of mapping to the Constant Event to reference. If this is set, we check against the Constant Event's conditions and trigger their outcomes. | Read [Constants](../../../intermediate/constants/) |
| `disabled` | Boolean | Disable this event? | |
| `conditions` | [Condition](url.tbd) Array | List of conditions required to trigger the event. | |
| `outcomes` | [Outcome](url.tbd) Array | List of outcomes to trigger if the event meets the conditions. | |
| `triggersFromAnyConditionMet` | Boolean | Does this event trigger from any condition that is met? | |
| `allowsOtherEventsToTrigger` | Boolean | Does triggering this event still allow other events to trigger? | |
| `singleOutcomeOnly` | Boolean | If there are multiple outcomes for the event, only the first outcome that succeeds? | |
| `playTime` | String | How long to play the event, in ticks. Only if the event type has been registered a queue. Set to -1 to skip the queue. | |
| `delay` | String | How long of a delay, in ticks, before playing the event. Supports variable insertion. | |
| `cooldown` | String | How often this event can be triggered, in ticks. Remove to have no cooldown. | |
| `disableShortCircuitWhenOnCooldown` | Boolean | Normally, if this event is on cooldown (and `allowsOtherEventsToTrigger` is disabled) and the conditions are met, this event stops other events triggering. This disables that. | |
| Name | Type | Description | Additional Info |
| ----------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| `name` | String | Optional name for this event, for Editor readability. | |
| `constantName` | String | The name of mapping to the Constant Event to reference. If this is set, we check against the Constant Event's conditions and trigger their outcomes. | Read [Constants](../../../intermediate/constants/) |
| `disabled` | Boolean | Disable this event? | |
| `conditions` | [Condition](url.tbd) Array | List of conditions required to trigger the event. | |
| `outcomes` | [Outcome](url.tbd) Array | List of outcomes to trigger if the event meets the conditions. | |
| `triggersFromAnyConditionMet` | Boolean | Does this event trigger from any condition that is met? | |
| `allowsOtherEventsToTrigger` | Boolean | Does triggering this event still allow other events to trigger? | |
| `singleOutcomeOnly` | Boolean | If there are multiple outcomes for the event, only the first outcome that succeeds? | |
| `playTime` | String | How long to play the event, in ticks. Only if the event type has been registered a queue. Set to -1 to skip the queue. | |
| `playTimeEvent` | [Event](url.tbd) | An event to trigger during the playTime of the Event ticks. Will have variables `$currentPlayTime` and `$totalPlayTime` inserted. | |
| `delay` | String | How long of a delay, in ticks, before playing the event. Supports variable insertion. | |
| `cooldown` | String | How often this event can be triggered, in ticks. Remove to have no cooldown. | |
| `disableShortCircuitWhenOnCooldown` | Boolean | Normally, if this event is on cooldown (and `allowsOtherEventsToTrigger` is disabled) and the conditions are met, this event stops other events triggering. This disables that. | |
45 changes: 12 additions & 33 deletions docs/components/gamehooks/Listener.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,29 @@ This Object checks a Forge Event to see if matches its current configuration. If

| Name | Type | Description | Additional Info |
| ------------ | ------ | ----------- | --------------- |
| `fields`[^1] | String | | |
| *`fields`*[^1] | String | | |
| | | | |

///Footnotes Go Here///


FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT FILLER TEXT
FILLER TEXT FILLER TEXT
FILLER TEXT
FILLER TEXT


FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT

FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT
FILLER TEXT

[^0]: Fields in *italics* are required for the Object to be valid.
[^1]: This is the first footnote.

[^-1]: Fields in *italics* are required for the Object to be valid.
[^1]: This is the first footnote. as a test
16 changes: 9 additions & 7 deletions docs/expert/gamehooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@ Before we get started, let me introduce to you the flow of code:
```text
"--->" indicates that the previous event will progress to the next point
"-/->" indicates that the previous event may stop progression
"a:, b:, c:" indicates potential different outcomes
"a:, b:, c:" indicates potential different paths
Forge Event Happens --->
Listener begins processing --->
Listener's preAccessorEvent triggers -/->
Listener's staticAccessors triggers LOOP_1 -/->
Listener's accessors triggers LOOP_1 -/->
Listener's argBasedAccessors triggers LOOP_1 -/->
Listener's event is triggerred -->
Listener's event is triggered -->
Listener cancels Forge Event (if applicable)
LOOP_1:
ObjectAccessor triggers preAccessorEvent -/->
ObjectAccessor does its accessor thing --->
a: Instance check, if set -/-> Insert object in arg, if set --->
b: No Object, nullObjectEvent is triggered -/->
ObjectAccessor postAccessorEvent is triggered -/->
a: ObjectAccessor's nextAccessors are triggered, LOOP_1 happens with them
ObjectAccessor's nextAccessors triggers their LOOP_1 --->
b: No Object, nullObjectEvent is triggered -/->
```

Expand All @@ -63,9 +63,10 @@ Let's have a look at a new Listener in the Editor first:
<br />
<br />

Listeners will require the Class name (name: `className`). This can be either:
* The Class' simple name (including the parent class, if this is an inner class). Eg: `PlayerEvent$ItemPickupEvent`
* The Class' full name. Eg: `net.minecraftforge.event.entity.living.LivingAttackEvent`. This is done by setting `isFullName` to true.
Listeners will require the Class name (name: `className`). This can be either:

* The Class' simple name (including the parent class, if this is an inner class). Eg: `PlayerEvent$ItemPickupEvent`
* The Class' full name. Eg: `net.minecraftforge.event.entity.living.LivingAttackEvent`. This is done by setting `isFullName` to true.

For this, we will need to listen for the `LivingAttackEvent`. Go ahead and create a listener and set the `className`.

Expand Down Expand Up @@ -294,6 +295,7 @@ So, what did we learn from the Example:
* How to register a Listener to a Forge Event
* How to get Listeners to work on a Dedicated Server
* How to use ObjectAccessors and ParamInjectors
* How to check if a reference object is an instance of a class
* How to stop Listeners from progressing
* How to create Objects using ObjectAccessors
* How to create primitives in ParamInjectors
Expand Down
4 changes: 3 additions & 1 deletion docs/gettingstarted/ccionservers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ CCI on Servers

CCI was written to work mostly on the Client, but some things require a Server back-end to work. This is where CCI needs to be installed on a server.

Where this plays the most significance is when the Client is using a `CommandOutcome` and has a command that is too long. Generally, In-Game Chat can only send messages up to 256 characters. The limit for a command in `CommandOutcome` is closer to 32,000 characters, similar to Command Blocks. To work around this, the Server Backend is needed, and the user needs to be whitelisted.
Where this plays the most significance is when the Client is using a `CommandOutcome` and has a command that is too long. Generally, In-Game Chat can only send messages up to 256 characters. The limit for a command in `CommandOutcome` is closer to 32,000 characters, similar to Command Blocks. To work around this, the Server Backend is needed, and the player needs to be whitelisted.

And that's it. No need to have Event Configurations on the Server or anything of that sort. Client does all the heavy lifting, while the Server, just the mod installed, and the player whitelisted.

<br/>

Expand Down
2 changes: 2 additions & 0 deletions docs/intermediate/configspecifics.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Removing the value of the `playTime` field, or setting it to a value below 0, wi

Just before Config Events in the queue are triggered, Global Variables are re-inserted into the variables list, just in case they have changed whilst the Config Event sits in the queue. Because of this, try not to insert any local variables with matching names as global variables, as those will be overwritten.

Also, take note of the `playTimeEvent` field. If this event exists, every tick for the duration of `playTime` (this is after the above Config Event had already triggered), this Config Event is triggered. The variables `currentPlayTime` and `totalPlayTime` are inserted into the variables list, with the current `playTime` tick, and the total play time from the previous event (equivalent to `playTime` from before) respectively. If `currentPlayTime` is equal to `totalPlayTime`, this is the last tick this Config Event will trigger.

<br />

### Ignored Types (name: `ignoredTypes`)
Expand Down
Binary file modified docs/intermediate/images/configspecifics/subevent.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ nav:
- Listener: 'components/gamehooks/Listener.md'

# How to, random mob, random chance, repeat outcome, Math, JSONSafe, two high space condition, tellraw breaking due to recursion
# the differences between SL and SE
# the differences between SL and SE, add into server page that EventConfigs aren't needed there

# Do not edit in PRs below here
site_name: Content Creator Integration Documentation
Expand Down

0 comments on commit 710a0dd

Please sign in to comment.