Skip to content

Commit

Permalink
Improved documentation (#37)
Browse files Browse the repository at this point in the history
* Update Custom-Machines.md

-Added correction to simple machine builder regarding defining pollution amount
-Added comment to multiblock machine builder regarding how to define tooltips.

* Update Custom-Recipe-Types.md

-Added comment explaining recipeModifers
-Added comment explaining where to find additional GuiTextures and FillDirections.

* Update v1.2.1.md

Added note mentioning how to supply recipe modifiers correctly.

* Update Custom-Machines.md

- Corrected comment on how to define simple electric machine to include pollution in the method.
- Added comment detailing how to add tooltips to multiblock machines.

* Update Custom-Machines.md

Formatting corrections

* Update v1.2.1.md

-Corrected capitalization.
  • Loading branch information
AncientShotgun authored Sep 7, 2024
1 parent ea3a3bd commit 8ba65c0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/Modpacks/Changes/v1.2.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ In particular, multiblocks supporting parallel hatches now need to be declared d
.recipeModifier(GTRecipeModifiers.PARALLEL_HATCH.apply(OverclockingLogic.PERFECT_OVERCLOCK, GTRecipeModifiers.ELECTRIC_OVERCLOCK))

// After:
.recipeModifiers(GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.ELECTRIC_OVERCLOCK.apply(OverclockingLogic.PERFECT_OVERCLOCK))
.recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.ELECTRIC_OVERCLOCK.apply(OverclockingLogic.PERFECT_OVERCLOCK)])
```

Recipe modifiers must be supplied as a JavaScript array, as this is what Rhino transpiles into a varargs (```RecipeModifier...```) value, which is what the ```.recipeModifiers()``` method accepts as input. If not supplied as an array, Rhino with throw an exception and crash Minecraft.

## Bedrock Ores

Expand Down
13 changes: 10 additions & 3 deletions docs/Modpacks/Other-Topics/Custom-Machines.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ GTCEuStartupEvents.registry('gtceu:machine', event => {

```js title="test_electric_machine.js"
GTCEuStartupEvents.registry('gtceu:machine', event => {
event.create('test_electric', 'simple', GTValues.LV, GTValues.MV, GTValues.HV) // (1)
event.create('test_electric', 'simple', 0, GTValues.LV, GTValues.MV, GTValues.HV) // (1)
.rotationState(RotationState.NON_Y_AXIS)
.recipeType('test_recipe_type')
.tankScalingFunction(tier => tier * 3200)
})
```

1. Machine ID, Machine Type, Voltage Tiers

1. Machine ID, Machine Type, Pollution Produced, Voltage Tiers



## Creating Custom Kinetic Machine
Expand Down Expand Up @@ -59,6 +61,7 @@ GTCEuStartupEvents.registry('gtceu:machine', event => {
```js title="test_multiblock.js"
GTCEuStartupEvents.registry('gtceu:machine', event => {
event.create('test_generator', 'multiblock')
.tooltips(Component.translatable('your.langfile.entry.here')) // (1)
.rotationState(RotationState.NON_Y_AXIS)
.appearanceBlock(GTBlocks.CASING_STEEL_SOLID)
.recipeTypes(['test_recipe_type_1', 'test_recipe_type_2'])
Expand All @@ -82,6 +85,10 @@ GTCEuStartupEvents.registry('gtceu:machine', event => {
})
```


1. You can add tooltips to your multiblock controllers that show up when you mouseover them. Each separate call of ```.tooltips()``` will add a separate line to the controller's tooltip. ```Component.translatable()``` reads entries from .json lang files placed in ```kubejs/assets/gtceu/lang``` or supplied via a standalone resource pack. The ```Component``` class is autoloaded by KubeJS at compile time; it doesn't need to be manually loaded.


### Shape Info

Shape Info is used to manually define how your multiblock appears in the JEI/REI/EMI multiblock preview tab.
Expand Down Expand Up @@ -124,4 +131,4 @@ GTCEuStartupEvents.registry('gtceu:machine', event => {
false
)
})
```
```
11 changes: 7 additions & 4 deletions docs/Modpacks/Other-Topics/Custom-Recipe-Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ title: Custom Recipe Type
GTCEuStartupEvents.registry('gtceu:recipe_type', event => {
event.create('test_recipe_type')
.category('test')
.recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.ELECTRIC_OVERCLOCK.apply(OverclockingLogic.PERFECT_OVERCLOCK)]) // (1)
.setEUIO('in')
.setMaxIOSize(3, 3, 3, 3) // (1)
.setMaxIOSize(3, 3, 3, 3) // (2)
.setSlotOverlay(false, false, GuiTextures.SOLIDIFIER_OVERLAY)
.setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT)
.setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT) // (3)
.setSound(GTSoundEntries.COOLING)
})
```

1. Max Item Inputs, Max Item Outputs, Max Fluid Inputs, Max Fluid Outputs
1. If electric and/or multiblock machines can process your custom recipe type, ```.recipeModifiers()``` will allow you to fine-tune the behaviour of these machine when running recipes of your custom recipe type. ```GTRecipeModifiers.PARALLEL_HATCH``` will enable Multiblock Machines to parallelize recipes of your custom type via an optional Parallel Hatch, while ```GTRecipeModifiers.ELECTRIC_OVERCLOCK```will define how your recipes overclock in electric machines and multiblocks.
2. Max Item Inputs, Max Item Outputs, Max Fluid Inputs, Max Fluid Outputs
3. A list of available ```GuiTextures``` and ```FillDirection```s can be found in the GTCEu Modern Github, or in the .jar file.


```js title="test_kinetic_recipe_type.js"
Expand All @@ -35,4 +38,4 @@ GTCEuStartupEvents.registry('gtceu:recipe_type', event => {
})
```

1. Helps to adjust the JEI/REI/EMI layout when adding addition conditions to the recipe like RPM and SU.
1. Helps to adjust the JEI/REI/EMI layout when adding addition conditions to the recipe like RPM and SU.

0 comments on commit 8ba65c0

Please sign in to comment.