Changes

218 bytes added ,  22:53, 31 July 2021
Update to 1.17
Line 27: Line 27:     
== Data Providers ==
 
== Data Providers ==
'''Data providers''' are the classes that define the resources data to be generated. All data providers implement <code>IDataProvider</code>. Minecraft has abstract implementations for most assets and data, so mod developers only need to extend those abstract classes and override the specified method.
+
'''Data providers''' are the classes that define the resources data to be generated. All data providers implement <code>DataProvider</code>. Minecraft has abstract implementations for most assets and data, so mod developers only need to extend those abstract classes and override the specified method.
    
The <code>GatherDataEvent</code> is fired on the mod event bus when the data generator is being created, and the <code>DataGenerator</code> can be obtained from the event. Create and register data providers using <code><nowiki>DataGenerator#addProvider</nowiki></code>.
 
The <code>GatherDataEvent</code> is fired on the mod event bus when the data generator is being created, and the <code>DataGenerator</code> can be obtained from the event. Create and register data providers using <code><nowiki>DataGenerator#addProvider</nowiki></code>.
Line 38: Line 38:  
*** <code>BlockStateProvider</code> - for blockstates and their block and item models; override <code>#registerStatesAndModels</code>
 
*** <code>BlockStateProvider</code> - for blockstates and their block and item models; override <code>#registerStatesAndModels</code>
 
*** <code>BlockModelProvider</code> -  for block models; override <code>#registerModels</code>
 
*** <code>BlockModelProvider</code> -  for block models; override <code>#registerModels</code>
 +
* <code>SoundDefinitionsProvider</code> - for the <code>sounds.json</code> file; override <code>#registerSounds</code>
    
=== Server Data ===
 
=== Server Data ===
Line 44: Line 45:  
* <code>RecipeProvider</code> - for recipes and their unlocking advancements; override <code>#registerRecipes</code>
 
* <code>RecipeProvider</code> - for recipes and their unlocking advancements; override <code>#registerRecipes</code>
 
* <code>TagsProvider</code> - for tags; override <code>#registerTags</code>
 
* <code>TagsProvider</code> - for tags; override <code>#registerTags</code>
 +
* <code>GlobalLootModifierProvider</code> - for global loot modifiers; override <code>#start</code>
    
{{Tip|An <code>AdvancementProvider</code> class does exists, however it is hardcoded for only the vanilla advancements.}}
 
{{Tip|An <code>AdvancementProvider</code> class does exists, however it is hardcoded for only the vanilla advancements.}}