fr:tutoriel:data-generator-introduction
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
fr:tutoriel:data-generator-introduction [2021/12/24 18:48] – created mysterious_dev | fr:tutoriel:data-generator-introduction [2021/12/24 22:16] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Data Generators - Introduction ====== | ====== Data Generators - Introduction ====== | ||
+ | |||
+ | ==== Introduction ==== | ||
+ | |||
+ | Les Data Generators sont une solution pour générer des JSON's en écrivant quelques lignes de code. Nous verrons ici comment préparer votre environnement de développement pour utiliser cet outil. | ||
+ | |||
+ | ==== build.gradle ==== | ||
+ | |||
+ | <code java> | ||
+ | sourceSets { | ||
+ | main{ | ||
+ | resources { | ||
+ | srcDirs += [ | ||
+ | ' | ||
+ | ] | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | loom { | ||
+ | runs { | ||
+ | datagen { | ||
+ | server() | ||
+ | |||
+ | name " | ||
+ | vmArg " | ||
+ | vmArg " | ||
+ | |||
+ | runDir " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | assemble.dependsOn runDatagen | ||
+ | </ | ||
+ | |||
+ | ==== Classe principale pour les Data Generators ==== | ||
+ | |||
+ | <code java> | ||
+ | public class ExampleDataMod implements DataGeneratorEntrypoint { | ||
+ | @Override | ||
+ | public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | ==== fabric.mod.json ==== | ||
+ | |||
+ | <code json> | ||
+ | " | ||
+ | " | ||
+ | ] | ||
+ | </ | ||
+ | |||
+ | **[WIP]** | ||
fr/tutoriel/data-generator-introduction.1640371714.txt.gz · Last modified: 2021/12/24 18:48 by mysterious_dev