datagen ?
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
// 1.20.1 2026-10-21T20:42:12.229997076 frangipane/Block Loot Tables
|
||||||
|
94ae4ae5b42e18f05571aa5faf36cf24050c907c data/frangipane/loot_tables/blocks/mossy_brick.json
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
// 1.20.1 2026-10-21T20:42:12.229948493 frangipane/Tags for minecraft:item
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// 1.20.1 2026-10-21T20:42:12.229862428 frangipane/Tags for minecraft:block
|
||||||
|
06e672f4362ad6a85ac16ce830c01ee9dd5eeca9 data/minecraft/tags/blocks/needs_stone_tool.json
|
||||||
|
06e672f4362ad6a85ac16ce830c01ee9dd5eeca9 data/minecraft/tags/blocks/mineable/pickaxe.json
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// 1.20.1 2026-10-21T20:42:12.229272852 frangipane/Recipes
|
||||||
|
5cdce09496967a71175fe1d1d950cbe8e59510f5 data/frangipane/advancements/recipes/misc/deep_steel_ingot_from_nugget.json
|
||||||
|
b4ae5fda62d1bb6a6d1c2b234df557c6914d0db9 data/frangipane/recipes/deep_steel_ingot_from_nugget.json
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
// 1.20.1 2026-10-21T20:42:12.229682404 frangipane/Model Definitions
|
||||||
|
2c3fb20732d4c633e0b7fab10d30f18b0722aa76 assets/frangipane/models/item/deep_steel_ingot.json
|
||||||
|
1d35caaa2ce4b6e02c3f5b25b7ae55ae08d8ba2e assets/frangipane/blockstates/mossy_brick.json
|
||||||
|
496e3cc377b06d60fd6f61f9d2a90d30a6766fa2 assets/frangipane/models/item/mossy_brick.json
|
||||||
|
d49a1bf9216d59760e4b7c781f30b3356415cda5 assets/frangipane/models/block/mossy_brick.json
|
||||||
|
5f0c424c1ba9c0890df5d71e0ca0e743dce99d3c assets/frangipane/models/item/deep_steel_nugget.json
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": {
|
||||||
|
"model": "frangipane:block/mossy_brick"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "frangipane:item/deep_steel_nugget"
|
||||||
|
}
|
||||||
|
}
|
||||||
+35
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:recipes/root",
|
||||||
|
"criteria": {
|
||||||
|
"has_dirt": {
|
||||||
|
"conditions": {
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"items": [
|
||||||
|
"minecraft:dirt"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"trigger": "minecraft:inventory_changed"
|
||||||
|
},
|
||||||
|
"has_the_recipe": {
|
||||||
|
"conditions": {
|
||||||
|
"recipe": "frangipane:deep_steel_ingot_from_nugget"
|
||||||
|
},
|
||||||
|
"trigger": "minecraft:recipe_unlocked"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"requirements": [
|
||||||
|
[
|
||||||
|
"has_dirt",
|
||||||
|
"has_the_recipe"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"rewards": {
|
||||||
|
"recipes": [
|
||||||
|
"frangipane:deep_steel_ingot_from_nugget"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sends_telemetry_event": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:block",
|
||||||
|
"pools": [
|
||||||
|
{
|
||||||
|
"bonus_rolls": 0.0,
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"condition": "minecraft:survives_explosion"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"name": "frangipane:mossy_brick"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rolls": 1.0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"category": "misc",
|
||||||
|
"key": {
|
||||||
|
"H": {
|
||||||
|
"item": "frangipane:deep_steel_nugget"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pattern": [
|
||||||
|
"HHH",
|
||||||
|
"HHH",
|
||||||
|
"HHH"
|
||||||
|
],
|
||||||
|
"result": {
|
||||||
|
"item": "frangipane:deep_steel_ingot"
|
||||||
|
},
|
||||||
|
"show_notification": true
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"frangipane:mossy_brick"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"frangipane:mossy_brick"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -2,11 +2,17 @@ package org.strawberries.frangipane;
|
|||||||
|
|
||||||
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
|
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
|
||||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
|
||||||
|
import org.strawberries.frangipane.datagen.*;
|
||||||
|
|
||||||
public class FrangipaneDataGenerator implements DataGeneratorEntrypoint {
|
public class FrangipaneDataGenerator implements DataGeneratorEntrypoint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
|
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
|
||||||
FabricDataGenerator.Pack pack = fabricDataGenerator.createPack();
|
FabricDataGenerator.Pack pack = fabricDataGenerator.createPack();
|
||||||
|
pack.addProvider(ModBlockTagProvider::new);
|
||||||
|
pack.addProvider(ModItemTagProvider::new);
|
||||||
|
pack.addProvider(ModModelProvider::new);
|
||||||
|
pack.addProvider(ModRecipeProvider::new);
|
||||||
|
pack.addProvider(ModLootTableProvider::new);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package org.strawberries.frangipane.datagen;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||||
|
import net.minecraft.registry.RegistryWrapper;
|
||||||
|
import net.minecraft.registry.tag.BlockTags;
|
||||||
|
import org.strawberries.frangipane.block.ModBlocks;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
public class ModBlockTagProvider extends FabricTagProvider.BlockTagProvider {
|
||||||
|
public ModBlockTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||||
|
super(output, registriesFuture);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void configure(RegistryWrapper.WrapperLookup lookup) {
|
||||||
|
// getOrCreateTagBuilder(BlockTags.HOE_MINEABLE);
|
||||||
|
getOrCreateTagBuilder(BlockTags.PICKAXE_MINEABLE).add(ModBlocks.MOSSY_BRICK);
|
||||||
|
getOrCreateTagBuilder(BlockTags.NEEDS_STONE_TOOL).add(ModBlocks.MOSSY_BRICK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package org.strawberries.frangipane.datagen;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||||
|
import net.minecraft.registry.RegistryWrapper;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
public class ModItemTagProvider extends FabricTagProvider.ItemTagProvider {
|
||||||
|
public ModItemTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> completableFuture) {
|
||||||
|
super(output, completableFuture);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void configure(RegistryWrapper.WrapperLookup lookup) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package org.strawberries.frangipane.datagen;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider;
|
||||||
|
import org.strawberries.frangipane.block.ModBlocks;
|
||||||
|
|
||||||
|
public class ModLootTableProvider extends FabricBlockLootTableProvider {
|
||||||
|
public ModLootTableProvider(FabricDataOutput dataOutput) {
|
||||||
|
super(dataOutput);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void generate() {
|
||||||
|
addDrop(ModBlocks.MOSSY_BRICK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.strawberries.frangipane.datagen;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider;
|
||||||
|
import net.minecraft.data.client.BlockStateModelGenerator;
|
||||||
|
import net.minecraft.data.client.ItemModelGenerator;
|
||||||
|
import net.minecraft.data.client.Models;
|
||||||
|
import org.strawberries.frangipane.block.ModBlocks;
|
||||||
|
import org.strawberries.frangipane.item.ModItems;
|
||||||
|
|
||||||
|
public class ModModelProvider extends FabricModelProvider {
|
||||||
|
public ModModelProvider(FabricDataOutput output) {
|
||||||
|
super(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) {
|
||||||
|
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.MOSSY_BRICK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void generateItemModels(ItemModelGenerator itemModelGenerator) {
|
||||||
|
itemModelGenerator.register(ModItems.DEEP_STEEL_INGOT, Models.GENERATED);
|
||||||
|
itemModelGenerator.register(ModItems.DEEP_STEEL_NUGGET, Models.GENERATED);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package org.strawberries.frangipane.datagen;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
|
||||||
|
import net.minecraft.data.server.recipe.RecipeJsonProvider;
|
||||||
|
import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder;
|
||||||
|
import net.minecraft.item.Items;
|
||||||
|
import net.minecraft.recipe.book.RecipeCategory;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
import org.strawberries.frangipane.item.ModItems;
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
public class ModRecipeProvider extends FabricRecipeProvider {
|
||||||
|
public ModRecipeProvider(FabricDataOutput output) {
|
||||||
|
super(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void generate(Consumer<RecipeJsonProvider> exporter) {
|
||||||
|
ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, ModItems.DEEP_STEEL_INGOT)
|
||||||
|
.pattern("HHH")
|
||||||
|
.pattern("HHH")
|
||||||
|
.pattern("HHH")
|
||||||
|
.input('H', ModItems.DEEP_STEEL_NUGGET)
|
||||||
|
.criterion("has_dirt", conditionsFromItem(Items.DIRT))
|
||||||
|
.offerTo(exporter, new Identifier("frangipane", "deep_steel_ingot_from_nugget"));
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ public class ModItemGroups {
|
|||||||
.icon(() -> new ItemStack(ModItems.DEEP_STEEL_INGOT))
|
.icon(() -> new ItemStack(ModItems.DEEP_STEEL_INGOT))
|
||||||
.entries((displayContext, entries) -> {
|
.entries((displayContext, entries) -> {
|
||||||
entries.add(ModItems.DEEP_STEEL_INGOT);
|
entries.add(ModItems.DEEP_STEEL_INGOT);
|
||||||
|
entries.add(ModItems.DEEP_STEEL_NUGGET);
|
||||||
entries.add(ModBlocks.MOSSY_BRICK);
|
entries.add(ModBlocks.MOSSY_BRICK);
|
||||||
}).build()
|
}).build()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -16,17 +16,16 @@ public class ModItems {
|
|||||||
new Item(new FabricItemSettings())
|
new Item(new FabricItemSettings())
|
||||||
);
|
);
|
||||||
|
|
||||||
// NOTE: non.
|
public static final Item DEEP_STEEL_NUGGET = registerItem(
|
||||||
// public static final Item MOSSY_BRICK = registerItem(
|
"deep_steel_nugget",
|
||||||
// "mossy_brick",
|
new Item(new FabricItemSettings())
|
||||||
// new Item(new FabricItemSettings())
|
);
|
||||||
// );
|
|
||||||
|
|
||||||
private static void addItemsToIngredientTabItemGroup(
|
private static void addItemsToIngredientTabItemGroup(
|
||||||
FabricItemGroupEntries entries
|
FabricItemGroupEntries entries
|
||||||
) {
|
) {
|
||||||
entries.add(DEEP_STEEL_INGOT);
|
entries.add(DEEP_STEEL_INGOT);
|
||||||
// entries.add(MOSSY_BRICK);
|
entries.add(DEEP_STEEL_NUGGET);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Item registerItem(String name, Item item) {
|
private static Item registerItem(String name, Item item) {
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"variants": {
|
|
||||||
"": { "model": "frangipane:block/mossy_brick" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"itemgroup.frangipane_group": "Le groupe de la frangipane",
|
"itemgroup.frangipane_group": "Le groupe de la frangipane",
|
||||||
"item.frangipane.deep_steel_ingot": "Deep steel ingot",
|
"item.frangipane.deep_steel_ingot": "Deep steel ingot",
|
||||||
|
"item.frangipane.deep_steel_nugget": "Deep steel nugget",
|
||||||
"block.frangipane.mossy_brick": "Mossy block"
|
"block.frangipane.mossy_brick": "Mossy block"
|
||||||
}
|
}
|
||||||
Binary file not shown.
Reference in New Issue
Block a user