use of net.minecraft.data.DataGenerator in project NetherEx by LogicTechCorp.
the class DataGenerationHandler method onDataGathered.
@SubscribeEvent
public static void onDataGathered(GatherDataEvent event) {
DataGenerator generator = event.getGenerator();
if (event.includeServer()) {
generator.addProvider(gatherLootTables(generator));
generator.addProvider(gatherRecipes(generator));
}
}
use of net.minecraft.data.DataGenerator in project MinecraftForge by MinecraftForge.
the class DataGeneratorTest method gatherData.
@SubscribeEvent
public static void gatherData(GatherDataEvent event) {
GSON = new GsonBuilder().registerTypeAdapter(Variant.class, new Variant.Deserializer()).registerTypeAdapter(ItemTransforms.class, new ItemTransforms.Deserializer()).registerTypeAdapter(ItemTransform.class, new ItemTransform.Deserializer()).create();
DataGenerator gen = event.getGenerator();
if (event.includeClient()) {
gen.addProvider(new Lang(gen));
// Let blockstate provider see generated item models by passing its existing file helper
ItemModelProvider itemModels = new ItemModels(gen, event.getExistingFileHelper());
gen.addProvider(itemModels);
gen.addProvider(new BlockStates(gen, itemModels.existingFileHelper));
gen.addProvider(new SoundDefinitions(gen, event.getExistingFileHelper()));
}
if (event.includeServer()) {
gen.addProvider(new Recipes(gen));
gen.addProvider(new Tags(gen, event.getExistingFileHelper()));
gen.addProvider(new Advancements(gen, event.getExistingFileHelper()));
}
}
Aggregations