Skip to content

Commit 3ad9945

Browse files
changes
1 parent 878eb6c commit 3ad9945

File tree

13 files changed

+101
-52
lines changed

13 files changed

+101
-52
lines changed

docs/nova/addon/abilities.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class ExampleAbility(player: Player) : Ability(player) {
2626
Then, register a new ability type for that ability:
2727
```kotlin
2828
@Init(stage = InitStage.PRE_PACK)
29-
object Abilities : AbilityTypeRegistry by ExampleAddon.registry {
29+
object Abilities {
3030

31-
val EXAMPLE_ABILITY = registerAbilityType("example_ability", ::MyAbility)
31+
val EXAMPLE_ABILITY = ExampleAddon.registerAbilityType("example_ability", ::MyAbility)
3232

3333
}
3434
```

docs/nova/addon/attachments.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Once a player is given an attachment, it will stay on that player until it is re
99

1010
## Creating an AttachmentType
1111

12-
Create an `AttachmentTypeRegistry` and annotate it with `#!kotlin @Init` to have it loaded during addon initialization.
12+
Register an attachment type:
1313

1414
```kotlin
1515
@Init(stage = InitStage.PRE_PACK)
16-
object Attachments : AttachmentTypeRegistry by ExampleAddon.registry {
16+
object Attachments {
1717

18-
val EXAMPLE_ATTACHMENT = registerAttachmentType("example_attachment") { ItemAttachment(it, Items.ATTACHMENT_ITEM) }
18+
val EXAMPLE_ATTACHMENT = ExampleAddon.registerAttachmentType("example_attachment") { ItemAttachment(it, Items.ATTACHMENT_ITEM) }
1919

2020
}
2121
```

docs/nova/addon/blocks/block-behaviors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ Similar to [ItemBehaviors](../items/item-behaviors.md), you can implement block
22

33
```kotlin
44
@Init(stage = InitStage.PRE_PACK)
5-
object Blocks : BlockRegistry by ExampleAddon.registry {
5+
object Blocks {
66

7-
val EXAMPLE_BLOCK = block("example_block") {
7+
val EXAMPLE_BLOCK = ExampleAddon.block("example_block") {
88
behaviors(/*...*/)
99
}
1010

docs/nova/addon/blocks/creating-blocks.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ need to check for each individual scope, but can just use `#!kotlin DefaultBlock
4848

4949
## Creating a Block Registry
5050

51-
Create a `BlockRegistry` singleton object and annotate it with `#!kotlin @Init` to have it loaded during addon initialization.
51+
Create a singleton object and annotate it with `#!kotlin @Init` to have it loaded during addon initialization.
5252

5353
```kotlin
5454
@Init(stage = InitStage.PRE_PACK) // (1)!
55-
object Blocks : BlockRegistry by ExampleAddon.registry {
55+
object Blocks {
5656

5757
// (2)!
5858

@@ -68,9 +68,9 @@ You can create a very simple block like this:
6868

6969
```kotlin
7070
@Init(stage = InitStage.PRE_PACK)
71-
object Blocks : BlockRegistry by ExampleAddon.registry {
71+
object Blocks {
7272

73-
val EXAMPLE_BLOCK = block("example_block") {}
73+
val EXAMPLE_BLOCK = ExampleAddon.block("example_block") {}
7474

7575
}
7676
```
@@ -96,9 +96,9 @@ In the following code snippet, I chose to back the custom block via mushroom blo
9696

9797
```kotlin
9898
@Init(stage = InitStage.PRE_PACK)
99-
object Blocks : BlockRegistry by ExampleAddon.registry {
99+
object Blocks {
100100

101-
val EXAMPLE_BLOCK = block("example_block") {
101+
val EXAMPLE_BLOCK = ExampleAddon.block("example_block") {
102102
stateBacked(BackingStateCategory.MUSHROOM_BLOCK)
103103
}
104104
}
@@ -110,9 +110,9 @@ To override which model is used for your block, use the `selectModel` scope to s
110110

111111
```kotlin
112112
@Init(stage = InitStage.PRE_PACK)
113-
object Blocks : BlockRegistry by ExampleAddon.registry {
113+
object Blocks {
114114

115-
val EXAMPLE_BLOCK = block("example_block") {
115+
val EXAMPLE_BLOCK = ExampleAddon.block("example_block") {
116116
stateProperties(DefaultScopedBlockStateProperties.FACING_HORIZONTAL) // (1)!
117117

118118
stateBacked(BackingStateCategory.MUSHROOM_BLOCK) { // (2)!
@@ -135,9 +135,9 @@ and use that to rotate the model:
135135

136136
```kotlin
137137
@Init(stage = InitStage.PRE_PACK)
138-
object Blocks : BlockRegistry by ExampleAddon.registry {
138+
object Blocks {
139139

140-
val EXAMPLE_BLOCK = block("example_block") {
140+
val EXAMPLE_BLOCK = ExampleAddon.block("example_block") {
141141
stateProperties(DefaultScopedBlockStateProperties.FACING_HORIZONTAL)
142142

143143
models {
@@ -157,13 +157,13 @@ object Blocks : BlockRegistry by ExampleAddon.registry {
157157

158158
## Creating an Item for the Block
159159

160-
To create an item for your block, simply reference your block while registering the item in your `ItemRegistry`:
160+
To create an item for your block, simply reference your block while registering the item:
161161

162162
```kotlin
163163
@Init(stage = InitStage.PRE_PACK)
164-
object Items : ItemRegistry by ExampleAddon.registry {
164+
object Items {
165165

166-
val EXAMPLE_BLOCK = item(Blocks.EXAMPLE_BLOCK) {}
166+
val EXAMPLE_BLOCK = ExampleAddon.item(Blocks.EXAMPLE_BLOCK) {}
167167

168168
}
169169
```

docs/nova/addon/fonts/guitextures.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
## Creating a GuiTexture
22

3-
To create a `GuiTexture`, you'll need to use a `GuiTextureRegistry`:
3+
Register your gui texture using initialization:
44

55
```kotlin
66
@Init(stage = InitStage.PRE_PACK) // (1)!
7-
object GuiTextures : GuiTextureRegistry by ExampleAddon.registry {
7+
object GuiTextures {
88

9-
val EXAMPLE = guiTexture("example") {
9+
val EXAMPLE = ExampleAddon.guiTexture("example") {
1010
alignment(/*...*/) // (2)!
1111
path("gui/example")
1212
}

docs/nova/addon/items/creating-items.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
## Creating an Item Registry
22

3-
To create a custom item, you'll first need to create an `ItemRegistry`:
3+
First, create an empty singleton object and annotate it like this:
44
```kotlin
55
@Init(stage = InitStage.PRE_PACK) // (1)!
6-
object Items ItemRegistry by ExampleAddon.registry {
6+
object Items {
77

88
// (2)!
99

@@ -19,9 +19,9 @@ You can register a really simple item like this:
1919

2020
```kotlin
2121
@Init(stage = InitStage.PRE_PACK)
22-
object Items : ItemRegistry by ExampleAddon.registry {
22+
object Items {
2323

24-
val EXAMPLE_ITEM = registerItem("example_item", /* Item Behaviors */)
24+
val EXAMPLE_ITEM = ExampleAddon.registerItem("example_item", /* Item Behaviors */)
2525

2626
}
2727
```
@@ -40,9 +40,9 @@ Nova offers a DSL builder for creating item model definitions:
4040

4141
```kotlin
4242
@Init(stage = InitStage.PRE_PACK)
43-
object Items : ItemRegistry by ExampleAddon.registry {
43+
object Items {
4444

45-
val EXAMPLE_ITEM = item("example_item") {
45+
val EXAMPLE_ITEM = ExampleAddon.item("example_item") {
4646
modelDefinition {
4747
model = /* ... */
4848
}

docs/nova/addon/items/enchantments.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ supported_enchantments: # (2)!
3939

4040
### Custom Enchantments
4141

42-
To create a custom enchantment, you'll need to create an `EnchantmentRegistry`:
42+
You can register a custom enchantment like this:
4343

4444
```kotlin title="Enchantments.kt"
4545
@Init(stage = InitStage.PRE_PACK) // (1)!
46-
object Enchantments : EnchantmentRegistry by ExampleAddon.registry {
46+
object Enchantments {
4747
48-
val EXAMPLE_ENCHANTMENT = enchantment("example_enchantment") {
48+
val EXAMPLE_ENCHANTMENT = ExampleAddon.enchantment("example_enchantment") {
4949
// ...
5050
}
5151

docs/nova/addon/items/equipment.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
## Creating equipment
22

3-
Custom equipment (armor) can be registered via an `EquipmentRegistry`:
3+
Custom equipment (armor) can be registered like this:
44

55
```kotlin
66
@Init(stage = InitStage.PRE_PACK) // (1)!
7-
object Equipment : EquipmentRegistry by ExampleAddon.registry {
7+
object Equipment {
88

9-
val EXAMPLE = equipment("example") {
9+
val EXAMPLE = ExampleAddon.equipment("example") {
1010
humanoid { // (2)!
1111
layer { // (3)!
1212
texture("example") // (4)!
@@ -50,7 +50,7 @@ val EXAMPLE_HELMET = registerItem("example_helmet", Equippable(Armor.EXAMPLE, Eq
5050
You can also create animated armor:
5151

5252
```kotlin title="Equipment.kt"
53-
val EXAMPLE = animatedEquipment("example") {
53+
val EXAMPLE = ExampleAddon.animatedEquipment("example") {
5454
humanoid {
5555
layer {
5656
texture(5, InterpolationMode.NONE, "frame_1", "frame_2", "frame_3") // (1)!

docs/nova/addon/items/item-behaviors.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ different configs.
5757

5858
```kotlin
5959
@Init(stage = InitStage.PRE_PACK) // (1)!
60-
object Items : ItemRegistry by ExampleAddon.registry {
60+
object Items {
6161

62-
val EXAMPLE_ITEM_1 = registerItem("example_1", MyBehavior) // configs/example_1.yml
63-
val EXAMPLE_ITEM_2 = registerItem("example_2", MyBehavior) // configs/example_2.yml
64-
val EXAMPLE_ITEM_3 = registerItem("example_3", MyBehavior) // configs/example_3.yml
62+
val EXAMPLE_ITEM_1 = ExampleAddon.registerItem("example_1", MyBehavior) // configs/example_1.yml
63+
val EXAMPLE_ITEM_2 = ExampleAddon.registerItem("example_2", MyBehavior) // configs/example_2.yml
64+
val EXAMPLE_ITEM_3 = ExampleAddon.registerItem("example_3", MyBehavior) // configs/example_3.yml
6565

6666
}
6767
```

docs/nova/addon/items/tools.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ diamond: 3
5656

5757
### Registering a custom tool tier
5858

59-
To register custom tool tiers, create a new `ToolTierRegistry` and annotate it with `#!kotlin @Init` to load it during addon initialization:
59+
You can register a custom tool tier like this:
6060

6161
```kotlin
6262
@Init(stage = InitStage.PRE_PACK) // (1)!
63-
object ToolTiers : ToolTierRegistry by ExampleAddon.registry {
63+
object ToolTiers {
6464
65-
val EXAMPLE_TIER = registerToolTier("example_tier")
65+
val EXAMPLE_TIER = ExampleAddon.registerToolTier("example_tier")
6666
6767
}
6868
```
@@ -96,13 +96,13 @@ By default, there are six tool categories available:
9696

9797
### Registering a custom tool category
9898

99-
To register custom tool categories, create a new `ToolCategoryRegistry` and annotate it with `#!kotlin @Init` to load it during addon initialization:
99+
You can register a custom tool category like this:
100100

101101
```kotlin
102102
@Init(stage = InitStage.PRE_PACK) // (1)!
103-
object ToolCategories : ToolCategoryRegistry by ExampleAddon.registry {
103+
object ToolCategories {
104104
105-
val EXAMPLE_CATEGORY = registerToolCategory("example_category")
105+
val EXAMPLE_CATEGORY = ExampleAddon.registerToolCategory("example_category")
106106
107107
}
108108
```

0 commit comments

Comments
 (0)