Skip to content

Commit

Permalink
Create 0.5.0 version for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gabber235 committed Aug 10, 2024
1 parent 44a5bef commit a46ae9c
Show file tree
Hide file tree
Showing 513 changed files with 10,623 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.bukkit.entity.Player
* ## How could this be used?
*
* This action can be useful in situations where you want to start a cinematic.
* See the [Cinematic](/docs/first-cinematic) tutorial for more information.
* See the [Cinematic](/docs/creating-stories/cinematics) tutorial for more information.
*/
class CinematicEntry(
override val id: String = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.bukkit.event.player.PlayerJoinEvent
*
* ## How could this be used?
*
* This could be used with [facts](/docs/facts) to give a new player a welcome message, or welcome back new players. You can also use it to give new players a starting item, or to give them a starting amount of money with the [Vault adapter](/adapters/VaultAdapter).
* This could be used with [facts](/docs/creating-stories/facts) to give a new player a welcome message, or welcome back new players. You can also use it to give new players a starting item, or to give them a starting amount of money with the [Vault adapter](/adapters/VaultAdapter).
*/
class PlayerJoinEventEntry(
override val id: String = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import java.time.LocalDateTime

@Entry("cron_fact", "Saved until a specified date, like (0 0 * * 1)", Colors.PURPLE, "mingcute:calendar-time-add-fill")
/**
* A [fact](/docs/facts) that is saved until a specified date, like (0 0 \* \* 1).
* A [fact](/docs/creating-stories/facts) that is saved until a specified date, like (0 0 \* \* 1).
*
* ## How could this be used?
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ import org.bukkit.entity.Player
Colors.PURPLE,
"material-symbols:person-pin"
)
/**
* The `In Audience Fact` is a fact that the value specified if the player is in the audience.
*
* <fields.ReadonlyFactInfo />
*
* ## How could this be used?
* This can be used to filter players if they are in a specific audience.
*/
class InAudienceFact(
override val id: String = "",
override val name: String = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import me.gabber235.typewriter.entry.entries.PersistableFactEntry

@Entry("permanent_fact", "Saved permanently, it never gets removed", Colors.PURPLE, "fa6-solid:database")
/**
* This [fact](/docs/facts) is permanent and never expires.
* This [fact](/docs/creating-stories/facts) is permanent and never expires.
*
* ## How could this be used?
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import org.bukkit.entity.Player

@Entry("number_placeholder", "Computed Fact for a placeholder number", Colors.PURPLE, "ph:placeholder-fill")
/**
* A [fact](/docs/facts) that is computed from a placeholder.
* A [fact](/docs/creating-stories/facts) that is computed from a placeholder.
* This placeholder is evaluated when the fact is read and must return a number or boolean.
*
* <fields.ReadonlyFactInfo />
Expand Down Expand Up @@ -60,7 +60,7 @@ fun Boolean.toInt() = if (this) 1 else 0

@Entry("value_placeholder", "Fact for a placeholder value", Colors.PURPLE, "fa6-solid:user-tag")
/**
* A [fact](/docs/facts) that is computed from a placeholder.
* A [fact](/docs/creating-stories/facts) that is computed from a placeholder.
* This placeholder is evaluated when the fact is read and can return anything.
* The value will be computed based on the `values` specified.
* <fields.ReadonlyFactInfo/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import me.gabber235.typewriter.entry.entries.GroupEntry

@Entry("session_fact", "Saved until a player logouts of the server", Colors.PURPLE, "fa6-solid:user-clock")
/**
* This [fact](/docs/facts) is stored until the player logs out.
* This [fact](/docs/creating-stories/facts) is stored until the player logs out.
*
* ## How could this be used?
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.bukkit.entity.Player

@Entry("combat_fact", "If the player is in combat", Colors.PURPLE, "fa6-solid:shield-halved")
/**
* A [fact](/docs/facts) that tells whether a player is in combat.
* A [fact](/docs/creating-stories/facts) that tells whether a player is in combat.
*
* <fields.ReadonlyFactInfo/>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import org.bukkit.entity.Player
"mingcute:counter-fill"
)
/**
* A [fact](/docs/facts) that represents how many specific MythicMobs mob are in the world.
* A [fact](/docs/creating-stories/facts) that represents how many specific MythicMobs mob are in the world.
*
* <fields.ReadonlyFactInfo />
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.bukkit.entity.Player

@Entry("in_rpg_region_fact", "If the player is in a RPGRegions region", Colors.PURPLE, "fa6-solid:road-barrier")
/**
* A [fact](/docs/facts) that checks if the player is in a specific region. The value will be `0` if the player is not in the region, and `1` if the player is in the region.
* A [fact](/docs/creating-stories/facts) that checks if the player is in a specific region. The value will be `0` if the player is not in the region, and `1` if the player is in the region.
*
* <fields.ReadonlyFactInfo />
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ enum class IslandFacts(private val retrieveFact: (SuperiorPlayer, Island) -> Int

@Entry("island_fact", "Various facts about a player's island", Colors.PURPLE, "fa6-solid:map-location-dot")
/**
* A [fact](/docs/facts) that can retrieve various information about an island.
* A [fact](/docs/creating-stories/facts) that can retrieve various information about an island.
*
* <fields.ReadonlyFactInfo />
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.bukkit.entity.Player

@Entry("balance_fact", "The balance of a player's account", Colors.PURPLE, "fa6-solid:money-bill-wave")
/**
* A [fact](/docs/facts) that represents a player's balance.
* A [fact](/docs/creating-stories/facts) that represents a player's balance.
*
* <fields.ReadonlyFactInfo />
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import org.bukkit.entity.Player

@Entry("permission_fact", "If the player has a permission", Colors.PURPLE, "fa6-solid:user-shield")
/**
* A [fact](/docs/facts) that checks if the player has a certain permission.
*
* A [fact](/docs/creating-stories/facts) that checks if the player has a certain permission.
*
* ## How could this be used?
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.bukkit.entity.Player

@Entry("in_region_fact", "If the player is in a WorldGuard region", Colors.PURPLE, "fa6-solid:road-barrier")
/**
* A [fact](/docs/facts) that checks if the player is in a specific region. The value will be `0` if the player is not in the region, and `1` if the player is in the region.
* A [fact](/docs/creating-stories/facts) that checks if the player is in a specific region. The value will be `0` if the player is not in the region, and `1` if the player is in the region.
*
* <fields.ReadonlyFactInfo />
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if another cinematic is triggered with a higher page priority than the current o
## How could this be used?

This action can be useful in situations where you want to start a cinematic.
See the [Cinematic](/docs/first-cinematic) tutorial for more information.
See the [Cinematic](/docs/creating-stories/cinematics) tutorial for more information.


## Fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `Player Join Event` event is called when a player joins the server.

## How could this be used?

This could be used with [facts](/docs/facts) to give a new player a welcome message, or welcome back new players. You can also use it to give new players a starting item, or to give them a starting amount of money with the [Vault adapter](/adapters/VaultAdapter).
This could be used with [facts](/docs/creating-stories/facts) to give a new player a welcome message, or welcome back new players. You can also use it to give new players a starting item, or to give them a starting amount of money with the [Vault adapter](/adapters/VaultAdapter).


## Fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from '@docusaurus/Link';

# Cron Fact

A [fact](/docs/facts) that is saved until a specified date, like (0 0 \* \* 1).
A [fact](/docs/creating-stories/facts) that is saved until a specified date, like (0 0 \* \* 1).

## How could this be used?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import Link from '@docusaurus/Link';

# In Audience Fact

The fact that the player is in the audience
The `In Audience Fact` is a fact that the value specified if the player is in the audience.

<fields.ReadonlyFactInfo />

## How could this be used?
This can be used to filter players if they are in a specific audience.


## Fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from '@docusaurus/Link';

# Number Placeholder Fact

A [fact](/docs/facts) that is computed from a placeholder.
A [fact](/docs/creating-stories/facts) that is computed from a placeholder.
This placeholder is evaluated when the fact is read and must return a number or boolean.

<fields.ReadonlyFactInfo />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from '@docusaurus/Link';

# Permanent Fact

This [fact](/docs/facts) is permanent and never expires.
This [fact](/docs/creating-stories/facts) is permanent and never expires.

## How could this be used?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from '@docusaurus/Link';

# Session Fact

This [fact](/docs/facts) is stored until the player logs out.
This [fact](/docs/creating-stories/facts) is stored until the player logs out.

## How could this be used?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from '@docusaurus/Link';

# Value Placeholder Fact

A [fact](/docs/facts) that is computed from a placeholder.
A [fact](/docs/creating-stories/facts) that is computed from a placeholder.
This placeholder is evaluated when the fact is read and can return anything.
The value will be computed based on the `values` specified.
<fields.ReadonlyFactInfo/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from '@docusaurus/Link';

# Combat Fact

A [fact](/docs/facts) that tells whether a player is in combat.
A [fact](/docs/creating-stories/facts) that tells whether a player is in combat.

<fields.ReadonlyFactInfo/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from '@docusaurus/Link';

# Mob Count Fact

A [fact](/docs/facts) that represents how many specific MythicMobs mob are in the world.
A [fact](/docs/creating-stories/facts) that represents how many specific MythicMobs mob are in the world.

<fields.ReadonlyFactInfo />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from '@docusaurus/Link';

# In Region Fact

A [fact](/docs/facts) that checks if the player is in a specific region. The value will be `0` if the player is not in the region, and `1` if the player is in the region.
A [fact](/docs/creating-stories/facts) that checks if the player is in a specific region. The value will be `0` if the player is not in the region, and `1` if the player is in the region.

<fields.ReadonlyFactInfo />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from '@docusaurus/Link';

# Island Fact

A [fact](/docs/facts) that can retrieve various information about an island.
A [fact](/docs/creating-stories/facts) that can retrieve various information about an island.

<fields.ReadonlyFactInfo />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from '@docusaurus/Link';

# Balance Fact

A [fact](/docs/facts) that represents a player's balance.
A [fact](/docs/creating-stories/facts) that represents a player's balance.

<fields.ReadonlyFactInfo />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import Link from '@docusaurus/Link';

# Permission Fact

A [fact](/docs/facts) that checks if the player has a certain permission.


A [fact](/docs/creating-stories/facts) that checks if the player has a certain permission.

## How could this be used?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from '@docusaurus/Link';

# In Region Fact

A [fact](/docs/facts) that checks if the player is in a specific region. The value will be `0` if the player is not in the region, and `1` if the player is in the region.
A [fact](/docs/creating-stories/facts) that checks if the player is in a specific region. The value will be `0` if the player is not in the region, and `1` if the player is in the region.

<fields.ReadonlyFactInfo />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ If you need a specific version, visit the [JitPack page](https://jitpack.io/#gab
## Step 2: Creating an Adapter Class
After setting up your project, create an adapter class. Here's an example:

<CodeSnippet tag="adapter" />
<CodeSnippet tag="adapter" json={require("../snippets.json")} />

## Step 3: Building the Adapter
After creating the adapter class, build the adapter. This can be done by running the `shadowJar` Gradle task.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ If you need this, reach out to me on [Discord](https://discord.gg/HtbKyuDDBw).
As entries are not allowed to have any state, we create a `CinematicAction` everytime a entry is used in a cinematic for a player.

## Usage
<CodeSnippet tag="cinematic_entry" />
<CodeSnippet tag="cinematic_entry" json={require("../../../snippets.json")} />

Segments sometimes need a minimum or maximum duration. This can be done using the `@InnerMin` and `@InnerMax` annotations.

<CodeSnippet tag="cinematic_segment_with_min_max" />
<CodeSnippet tag="cinematic_segment_with_min_max" json={require("../../../snippets.json")} />

This will make sure that the segment will be at least 10 frames long and at most 20 frames long.

### ExampleSegment
<CodeSnippet tag="cinematic_segment" />
<CodeSnippet tag="cinematic_segment" json={require("../../../snippets.json")} />

### ExampleCinematicAction

Expand All @@ -45,12 +45,12 @@ There are a few different lifecycle methods that can be used.

If you need all the customization, you can can implement the `CinematicAction` directly:

<CodeSnippet tag="cinematic_action" />
<CodeSnippet tag="cinematic_action" json={require("../../../snippets.json")} />

### SimpleCinematicAction
Sometimes you don't need all the customization and flexiblity. If you only care about 1 segment track, and only need to do something when a segment starts or ends, you can use the `SimpleCinematicAction`.

<CodeSnippet tag="cinematic_simple_action" />
<CodeSnippet tag="cinematic_simple_action" json={require("../../../snippets.json")} />

## Ticking

Expand All @@ -69,4 +69,4 @@ Like the camera which displays the camera in the world, instead of setting the p

To do this, there are 2 additional methods that can be implemented on the `CinematicEntry` that can return a different `CinematicAction` for recording and simulation.

<CodeSnippet tag="cinematic_create_actions" />
<CodeSnippet tag="cinematic_create_actions" json={require("../../../snippets.json")} />
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The `AudienceEntry` is the most used `ManifestEntry` in Typewriter.

Here's an example of a basic `AudienceEntry` implementation:

<CodeSnippet tag="audience_entry" />
<CodeSnippet tag="audience_entry" json={require("../../../snippets.json")} />

In this example, we define an `ExampleAudienceEntry` class that implements the `AudienceEntry` interface.
The `display()` function returns an `AudienceDisplay` object, which defines how the content is presented to the audience.
Expand All @@ -33,7 +33,7 @@ The `AudienceDisplay` class is responsible for displaying content to the audienc
It has lifecycle hooks to accomplish this.
Here's an example implementation:

<CodeSnippet tag="audience_display" />
<CodeSnippet tag="audience_display" json={require("../../../snippets.json")} />

Key methods in `AudienceDisplay`:

Expand All @@ -46,7 +46,7 @@ Key methods in `AudienceDisplay`:

For audiences that need to update regularly, you can implement the `TickableDisplay` interface:

<CodeSnippet tag="tickable_audience_display" />
<CodeSnippet tag="tickable_audience_display" json={require("../../../snippets.json")} />

The `tick()` method will be called every Minecraft tick (20 times per second, or every 50ms) on an asynchronous thread.
This allows you to update the display or perform regular actions for all players in the audience.
Expand All @@ -57,7 +57,7 @@ Every `AudienceDisplay` is also a Bukkit listener.
Event listeners will only be active when at least one player is in the audience.
Here's an example of how to handle events:

<CodeSnippet tag="audience_display_with_events" />
<CodeSnippet tag="audience_display_with_events" json={require("../../../snippets.json")} />

:::caution Events for All Players
Events will trigger for _**all**_ players, not just those in the audience.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Here's a generic example of creating and using an `ArtifactEntry`:

### Defining an ArtifactEntry

<CodeSnippet tag="artifact_entry" />
<CodeSnippet tag="artifact_entry" json={require("../../../snippets.json")} />

### Accessing the Artifact's Content
<CodeSnippet tag="artifact_access" />
<CodeSnippet tag="artifact_access" json={require("../../../snippets.json")} />

In this example, we get the content of the given artifact reference by using the `AssetManager`.
The `assetManager.fetchAsset` method is then used to retrieve the content of the artifact, based the `entry`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ The key attribute of AssetEntry is the path, which specifies the location of the
Here's a generic example of creating and using an `AssetEntry`:

### Defining an AssetEntry
<CodeSnippet tag="asset_entry" />
<CodeSnippet tag="asset_entry" json={require("../../../snippets.json")} />

### Accessing the Artifact's Content

To get the asset from the entry, you can use the following code:

<CodeSnippet tag="asset_access" />
<CodeSnippet tag="asset_access" json={require("../../../snippets.json")} />
Loading

0 comments on commit a46ae9c

Please sign in to comment.