Skip to content

Commit 5e06bd1

Browse files
committed
feat: update gene references to use string identifiers in kubejs.mdx
1 parent 60316ba commit 5e06bd1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/geneticsresequenced/devs/kubejs.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ I can't remember how to listen to third party events so I'll just leave it like
1212

1313
```js
1414
const $GenesData = Java.loadClass('dev.aaronhowser.mods.geneticsresequenced.attachment.GenesData')
15-
const $GeneRegistry = Java.loadClass('dev.aaronhowser.mods.geneticsresequenced.registry.ModGenes')
1615
```
1716

1817
```js
19-
$GenesData.addGene(livingEntity, $GeneRegistry.CHATTERBOX)
20-
$GenesData.removeGene(livingEntity, $GeneRegistry.LAY_EGG)
21-
let hasSlimyDeath = $GenesData.hasGene(livingEntity, $GeneRegistry.SLIMY_DEATH)
18+
$GenesData.addGene(livingEntity, "geneticsresequenced:chatterbox")
19+
$GenesData.removeGene(livingEntity, "geneticsresequenced:lay_egg")
20+
let hasSlimyDeath = $GenesData.hasGene(livingEntity, "geneticsresequenced:slimy_death")
2221
```
2322

2423
This uses reflection to load the [GenesData](https://github.com/Berry-Club/Genetics-Resequenced/blob/NeoForge-1.21/src/main/kotlin/dev/aaronhowser/mods/geneticsresequenced/attachment/GenesData.kt) and [ModGenes](https://github.com/Berry-Club/Genetics-Resequenced/blob/NeoForge-1.21/src/main/kotlin/dev/aaronhowser/mods/geneticsresequenced/registry/ModGenes.kt) classes, allowing you to use their functions.

0 commit comments

Comments
 (0)