Skip to content

Commit ca13516

Browse files
Update Selection GUI Crafting docs for v3.0.0 rewrite (#37)
* docs for SelectionGUI Crafting * Changes requested by WaitingIdly Vol. I * update sgc docs for v3.0.0 * improve sgc docs Vol. I
1 parent 8f2e8fa commit ca13516

File tree

2 files changed

+178
-93
lines changed

2 files changed

+178
-93
lines changed

docs/groovy-script/mods/selectionguicrafting/category.md

Lines changed: 64 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,31 @@ mods.selectionguicrafting.Category
2323

2424
## Adding Recipes
2525

26+
- Adds a new category:
27+
28+
```groovy:no-line-numbers
29+
mods.selectionguicrafting.category.add(Category)
30+
```
31+
32+
2633
### Recipe Builder
2734

2835
Just like other recipe types, the Crafting Category also uses a recipe builder.
2936

3037
Don't know what a builder is? Check [the builder info page](../../getting_started/builder.md) out.
3138

32-
:::::::::: details mods.selectionguicrafting.category.categoryBuilder() {open id="abstract"}
39+
:::::::::: details Recipe Builder {open id="abstract"}
40+
41+
---
42+
43+
- Create the Recipe Builder.
44+
45+
```groovy:no-line-numbers
46+
mods.selectionguicrafting.category.categoryBuilder()
47+
```
48+
49+
---
50+
3351
- `String`. The Category ID, must be unique. Requires not null and the ID must be unique.
3452

3553
```groovy:no-line-numbers
@@ -43,43 +61,59 @@ Don't know what a builder is? Check [the builder info page](../../getting_starte
4361
frame(ResourceLocation)
4462
```
4563

64+
- `Sound`. The sounds that will be played when the recipe is crafted. Can be overridden by the recipe. The first `float` value is the volume, the second `float` value is the pitch of the sound.
65+
66+
```groovy:no-line-numbers
67+
sound(Sound)
68+
sound(String)
69+
sound(SoundEvent)
70+
sound(ResourceLocation)
71+
sound(String, float, float)
72+
sound(SoundEvent, float, float)
73+
sound(ResourceLocation, float, float)
74+
```
75+
4676
- `ResourceLocation`. The path to the border texture. The resource must be loaded via external methods. [Textures that come with the mod](https://github.com/Ender-Development/selection-gui-crafting-continued/tree/master/src/main/resources/assets/selectionguicrafting/textures/gui/background). (Default `selectionguicrafting:textures/gui/background/default.png`).
4777

4878
```groovy:no-line-numbers
4979
border(String)
5080
border(ResourceLocation)
5181
```
5282

53-
- `ArrayList<GsSound>`. The sounds that will be played when the recipe is crafted. Can be overridden by the recipe. The first `float` value is the volume, the second `float` value is the pitch of the sound.
83+
- `AbstractTrigger`. A trigger that will open a GUI with all recipes for that category. Can be a block or an item. The first `double` value modifies the item damage, the second the crafting time, the third the amount of xp given to the player. Requires not null and a category needs at least one trigger.
5484

5585
```groovy:no-line-numbers
56-
sound(GsSound)
57-
sound(String, float, float)
58-
sound(SoundEvent, float, float)
59-
sound(ResourceLocation, float, float)
86+
trigger(Block)
87+
trigger(IIngredient)
88+
trigger(ItemTrigger)
89+
trigger(BlockTrigger)
90+
trigger(Block, double, double, double)
91+
trigger(IIngredient, double, double, double)
6092
```
6193

62-
- `ArrayList<GsParticle>`. The particles that will be spawned when the recipe is crafted. Can be overridden by the recipe. The `int` value is the amount of particles, the `float` value is the speed of the particles.
94+
- `Particle`. The particles that will be spawned when the recipe is crafted. Can be overridden by the recipe. The `int` value is the amount of particles, the `float` value is the speed of the particles.
6395

6496
```groovy:no-line-numbers
65-
particle(GsParticle)
97+
particle(String)
98+
particle(Particle)
99+
particle(EnumParticleTypes)
66100
particle(String, int, float)
67101
particle(EnumParticleTypes, int, float)
68102
```
69103

70-
- `GsEnum.QueueType`. If the recipes in this category can be queued. Can be overridden by the recipe. Allowed values are: `true`, `false` or `YES`, `NO`. (Default `YES`).
104+
- `QueueType`. If the recipes in this category can be queued. Can be overridden by the recipe. Allowed values are: `true`, `false` or `YES`, `NO`. (Default `YES`).
71105

72106
```groovy:no-line-numbers
73107
queueType(String)
74108
queueType(boolean)
75-
queueType(GsEnum.QueueType)
109+
queueType(QueueType)
76110
```
77111

78-
- `GsEnum.SoundType`. How the sounds will be played. Can be overridden by the recipe. Allowed values are: `RANDOM` or `COMBINED`. (Default `RANDOM`).
112+
- `SoundType`. How the sounds will be played. Can be overridden by the recipe. Allowed values are: `RANDOM` or `COMBINED`. (Default `RANDOM`).
79113

80114
```groovy:no-line-numbers
81115
soundType(String)
82-
soundType(GsEnum.SoundType)
116+
soundType(SoundType)
83117
```
84118

85119
- `ResourceLocation`. The path to the background texture. The resource must be loaded via external methods. [Textures that come with the mod](https://github.com/Ender-Development/selection-gui-crafting-continued/tree/master/src/main/resources/assets/selectionguicrafting/textures/gui/background). (Default `selectionguicrafting:textures/gui/background/default.png`).
@@ -96,17 +130,11 @@ Don't know what a builder is? Check [the builder info page](../../getting_starte
96130
decoration(ResourceLocation)
97131
```
98132

99-
- `GsEnum.OutputType`. How the output will be handed to the player. Can be overridden by the recipe. Allowed values are: `DROP` or `INVENTORY`. (Default `DROP`).
133+
- `OutputType`. How the output will be handed to the player. Can be overridden by the recipe. Allowed values are: `DROP` or `INVENTORY`. (Default `INVENTORY`).
100134

101135
```groovy:no-line-numbers
102136
outputType(String)
103-
outputType(GsEnum.OutputType)
104-
```
105-
106-
- `String`. The display name of the category that will be shown in the GUI. This can either be a string or a translation key if you want to make your Display Name translatable. Requires not null and the display name must be set.
107-
108-
```groovy:no-line-numbers
109-
displayName(String)
137+
outputType(OutputType)
110138
```
111139

112140
- `ResourceLocation`. The path to the progress bar texture. The resource must be loaded via external methods. Can be overridden by the recipe. [Textures that come with the mod](https://github.com/Ender-Development/selection-gui-crafting-continued/tree/master/src/main/resources/assets/selectionguicrafting/textures/gui/bar). (Default `selectionguicrafting:textures/gui/progress/default.png`).
@@ -116,37 +144,41 @@ Don't know what a builder is? Check [the builder info page](../../getting_starte
116144
bar(ResourceLocation)
117145
```
118146

119-
- `GsEnum.BackgroundType`. How the background will be rendered. The resource must be loaded via external methods. Allowed values are: `SINGLE_STRETCH`, `TILE`, or `SINGLE_CUT`. `TILE` uses a 16x16 texture and repeats it. `SINGLE_STRETCH` stretches the texture ratio to fill the screen. `SINGLE_CUT` stretches the texture while keeping the aspect ratio and cuts of anything that goes outside the gui. The texture is centered on the x and y axis. (Default `TILE`).
147+
- `BackgroundType`. How the background will be rendered. The resource must be loaded via external methods. Allowed values are: `SINGLE_STRETCH`, `TILE`, or `SINGLE_CUT`. `TILE` uses a 16x16 texture and repeats it. `SINGLE_STRETCH` stretches the texture ratio to fill the screen. `SINGLE_CUT` stretches the texture while keeping the aspect ratio and cuts of anything that goes outside the gui. The texture is centered on the x and y axis. (Default `TILE`).
120148

121149
```groovy:no-line-numbers
122150
backgroundType(String)
123-
backgroundType(GsEnum.BackgroundType)
151+
backgroundType(BackgroundType)
124152
```
125153

126-
- First validates the builder, returning `null` and outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returns `null` or `io.enderdev.selectionguicrafting.registry.GsCategory`).
154+
---
155+
156+
- First validates the builder, returning `null` and outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returns `null` or `io.enderdev.selectionguicrafting.registry.category.Category`).
127157

128158
```groovy:no-line-numbers
129159
register()
130160
```
131161

162+
---
163+
132164
::::::::: details Example {open id="example"}
133165
```groovy:no-line-numbers
134166
mods.selectionguicrafting.category.categoryBuilder()
135167
.id('dummy_category')
136-
.displayName('Your first Category')
168+
.trigger(item('minecraft:diamond'), 0.2, 0.8, 2.65)
137169
.background('selectionguicrafting:textures/gui/background/wood.png')
138170
.register()
139171

140172
mods.selectionguicrafting.category.categoryBuilder()
141173
.id('blub')
142-
.displayName('Pick your recipe')
174+
.trigger(item('minecraft:stone_shovel'))
143175
.background('selectionguicrafting:textures/gui/background/lake.png')
144176
.backgroundType('SINGLE_CUT')
145177
.register()
146178

147179
mods.selectionguicrafting.category.categoryBuilder()
148180
.id('dead')
149-
.displayName('This is another dummy category to test')
181+
.trigger(block('minecraft:snow'))
150182
.background('selectionguicrafting:textures/gui/background/deadlands.png')
151183
.decoration('selectionguicrafting:textures/gui/decor/gold.png')
152184
.border('selectionguicrafting:textures/gui/background/wood.png')
@@ -160,6 +192,12 @@ mods.selectionguicrafting.category.categoryBuilder()
160192

161193
## Removing Recipes
162194

195+
- Removes the given category:
196+
197+
```groovy:no-line-numbers
198+
mods.selectionguicrafting.category.remove(Category)
199+
```
200+
163201
- Remove a category by its name:
164202

165203
```groovy:no-line-numbers

0 commit comments

Comments
 (0)