diff --git a/src/main/generated/.cache/3743cfb9e65f2b657ac65498bc831b6b38ee5be6 b/src/main/generated/.cache/3743cfb9e65f2b657ac65498bc831b6b38ee5be6 new file mode 100644 index 0000000..682c77d --- /dev/null +++ b/src/main/generated/.cache/3743cfb9e65f2b657ac65498bc831b6b38ee5be6 @@ -0,0 +1,3 @@ +// 1.20.1 2024-11-16T18:16:03.177455006 futhark/Tags for minecraft:block +9d53a90ae3f26d6181121ef328fe1447d076d138 data/fabric/tags/blocks/needs_tool_level_4.json +a9b55e67ddbec4f60d16ca1cbece69abb4c1b045 data/futhark/tags/blocks/rune_component_blocks.json diff --git a/src/main/generated/.cache/6ad491f09a14073fc707dd96e0033acdcc341bef b/src/main/generated/.cache/6ad491f09a14073fc707dd96e0033acdcc341bef new file mode 100644 index 0000000..62ff134 --- /dev/null +++ b/src/main/generated/.cache/6ad491f09a14073fc707dd96e0033acdcc341bef @@ -0,0 +1,3 @@ +// 1.20.1 2024-11-16T18:16:03.17674354 futhark/Block Loot Tables +11dffe7e3a626334ae291fa9f719130ef92d7146 data/futhark/loot_tables/blocks/rune_block.json +9e1a8f29e55a3641f089d9793addae4f5d7e6531 data/futhark/loot_tables/blocks/jaffa_jam_block.json diff --git a/src/main/generated/.cache/b232ab6c579490507d83eff6f4f4ac8670e75f26 b/src/main/generated/.cache/b232ab6c579490507d83eff6f4f4ac8670e75f26 new file mode 100644 index 0000000..2684a1c --- /dev/null +++ b/src/main/generated/.cache/b232ab6c579490507d83eff6f4f4ac8670e75f26 @@ -0,0 +1,7 @@ +// 1.20.1 2024-11-16T18:16:03.178005707 futhark/Recipes +b3ebe698aedaace80b70616d5a3a3f4cdea18b14 data/futhark/advancements/recipes/building_blocks/jaffa_jam_block.json +af261655798bc6798f072eefbd173c094976d5d2 data/futhark/recipes/jaffa_jam_bottle.json +21aaf3e299205cd147f9a7cd07db055f3b6f707d data/futhark/recipes/jaffa_jam_block.json +30d45b6c110019dbf22e4dc7e13899631793c07a data/futhark/recipes/runic_chisel.json +af167e526e8e42f625ad7be3bf8b762019737cd9 data/futhark/advancements/recipes/food/jaffa_jam_bottle.json +78ed4c6f8275ac2acfc26772741203479f7be97b data/futhark/advancements/recipes/tools/runic_chisel.json diff --git a/src/main/generated/.cache/ba502c7b70814b3d51c711e12b126c9ee58ec766 b/src/main/generated/.cache/ba502c7b70814b3d51c711e12b126c9ee58ec766 new file mode 100644 index 0000000..474b1bd --- /dev/null +++ b/src/main/generated/.cache/ba502c7b70814b3d51c711e12b126c9ee58ec766 @@ -0,0 +1,10 @@ +// 1.20.1 2024-11-16T18:16:03.178423491 futhark/Model Definitions +73dfda6a56d6357526a78744df4a3629ed627de0 assets/futhark/models/block/jaffa_jam_block.json +276f160a0d27df492aec9e46ffdc1dc17d7ad376 assets/futhark/models/item/jaffa_jam_block.json +f38e69eb4a4c2e11ce36b08d0223122343bd510f assets/futhark/models/item/rune_block.json +633e38d5782fbde20e8458c7c6b99741a71f5f88 assets/futhark/models/item/runic_chisel.json +8bd22ab66e5b65494a4a44a42073ef5db2d2595c assets/futhark/blockstates/rune_block.json +1f32bfa134be73e11aab069870879b8933c36a2a assets/futhark/models/block/rune_block.json +e3a75c74be3035068fcf74a97c29e7d0338ba9c3 assets/futhark/models/item/jaffa_cake.json +8046d8fa422be23ddaedf65df32204f7050e9ff5 assets/futhark/blockstates/jaffa_jam_block.json +b6b689060a02a2c8e1e0c90e5ec8788e8a58e807 assets/futhark/models/item/jaffa_jam.json diff --git a/src/main/generated/.cache/f6136e830cd7b6dfc4a01f57d31f667862b2eb6a b/src/main/generated/.cache/f6136e830cd7b6dfc4a01f57d31f667862b2eb6a new file mode 100644 index 0000000..48f5645 --- /dev/null +++ b/src/main/generated/.cache/f6136e830cd7b6dfc4a01f57d31f667862b2eb6a @@ -0,0 +1 @@ +// 1.20.1 2024-11-16T18:16:03.17777695 futhark/Tags for minecraft:item diff --git a/src/main/resources/assets/futhark/blockstates/jaffa_jam_block.json b/src/main/generated/assets/futhark/blockstates/jaffa_jam_block.json similarity index 100% rename from src/main/resources/assets/futhark/blockstates/jaffa_jam_block.json rename to src/main/generated/assets/futhark/blockstates/jaffa_jam_block.json diff --git a/src/main/resources/assets/futhark/blockstates/rune_block.json b/src/main/generated/assets/futhark/blockstates/rune_block.json similarity index 100% rename from src/main/resources/assets/futhark/blockstates/rune_block.json rename to src/main/generated/assets/futhark/blockstates/rune_block.json diff --git a/src/main/generated/assets/futhark/models/block/jaffa_jam_block.json b/src/main/generated/assets/futhark/models/block/jaffa_jam_block.json new file mode 100644 index 0000000..75d2936 --- /dev/null +++ b/src/main/generated/assets/futhark/models/block/jaffa_jam_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "futhark:block/jaffa_jam_block" + } +} \ No newline at end of file diff --git a/src/main/generated/assets/futhark/models/block/rune_block.json b/src/main/generated/assets/futhark/models/block/rune_block.json new file mode 100644 index 0000000..a1e355c --- /dev/null +++ b/src/main/generated/assets/futhark/models/block/rune_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "futhark:block/rune_block" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/futhark/models/item/jaffa_cake.json b/src/main/generated/assets/futhark/models/item/jaffa_cake.json similarity index 60% rename from src/main/resources/assets/futhark/models/item/jaffa_cake.json rename to src/main/generated/assets/futhark/models/item/jaffa_cake.json index d77e653..9ff643d 100644 --- a/src/main/resources/assets/futhark/models/item/jaffa_cake.json +++ b/src/main/generated/assets/futhark/models/item/jaffa_cake.json @@ -1,5 +1,5 @@ { - "parent": "item/generated", + "parent": "minecraft:item/generated", "textures": { "layer0": "futhark:item/jaffa_cake" } diff --git a/src/main/resources/assets/futhark/models/item/jaffa_jam.json b/src/main/generated/assets/futhark/models/item/jaffa_jam.json similarity index 59% rename from src/main/resources/assets/futhark/models/item/jaffa_jam.json rename to src/main/generated/assets/futhark/models/item/jaffa_jam.json index a6e5346..06a98fd 100644 --- a/src/main/resources/assets/futhark/models/item/jaffa_jam.json +++ b/src/main/generated/assets/futhark/models/item/jaffa_jam.json @@ -1,5 +1,5 @@ { - "parent": "item/generated", + "parent": "minecraft:item/generated", "textures": { "layer0": "futhark:item/jaffa_jam" } diff --git a/src/main/resources/assets/futhark/models/item/jaffa_jam_block.json b/src/main/generated/assets/futhark/models/item/jaffa_jam_block.json similarity index 100% rename from src/main/resources/assets/futhark/models/item/jaffa_jam_block.json rename to src/main/generated/assets/futhark/models/item/jaffa_jam_block.json diff --git a/src/main/resources/assets/futhark/models/item/rune_block.json b/src/main/generated/assets/futhark/models/item/rune_block.json similarity index 100% rename from src/main/resources/assets/futhark/models/item/rune_block.json rename to src/main/generated/assets/futhark/models/item/rune_block.json diff --git a/src/main/resources/assets/futhark/models/item/runic_chisel.json b/src/main/generated/assets/futhark/models/item/runic_chisel.json similarity index 60% rename from src/main/resources/assets/futhark/models/item/runic_chisel.json rename to src/main/generated/assets/futhark/models/item/runic_chisel.json index 8515169..9049627 100644 --- a/src/main/resources/assets/futhark/models/item/runic_chisel.json +++ b/src/main/generated/assets/futhark/models/item/runic_chisel.json @@ -1,5 +1,5 @@ { - "parent": "item/generated", + "parent": "minecraft:item/generated", "textures": { "layer0": "futhark:item/runic_chisel" } diff --git a/src/main/generated/data/fabric/tags/blocks/needs_tool_level_4.json b/src/main/generated/data/fabric/tags/blocks/needs_tool_level_4.json new file mode 100644 index 0000000..dd19dfb --- /dev/null +++ b/src/main/generated/data/fabric/tags/blocks/needs_tool_level_4.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "futhark:rune_block" + ] +} \ No newline at end of file diff --git a/src/main/generated/data/futhark/advancements/recipes/building_blocks/jaffa_jam_block.json b/src/main/generated/data/futhark/advancements/recipes/building_blocks/jaffa_jam_block.json new file mode 100644 index 0000000..54173ad --- /dev/null +++ b/src/main/generated/data/futhark/advancements/recipes/building_blocks/jaffa_jam_block.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_jaffa_jam": { + "conditions": { + "items": [ + { + "items": [ + "futhark:jaffa_jam" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:jaffa_jam_block" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_jaffa_jam", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "minecraft:jaffa_jam_block" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/src/main/generated/data/futhark/advancements/recipes/food/jaffa_jam_bottle.json b/src/main/generated/data/futhark/advancements/recipes/food/jaffa_jam_bottle.json new file mode 100644 index 0000000..534e509 --- /dev/null +++ b/src/main/generated/data/futhark/advancements/recipes/food/jaffa_jam_bottle.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_jaffa_jam_block": { + "conditions": { + "items": [ + { + "items": [ + "futhark:jaffa_jam_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:jaffa_jam_bottle" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_jaffa_jam_block", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "minecraft:jaffa_jam_bottle" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/src/main/generated/data/futhark/advancements/recipes/tools/runic_chisel.json b/src/main/generated/data/futhark/advancements/recipes/tools/runic_chisel.json new file mode 100644 index 0000000..1045a04 --- /dev/null +++ b/src/main/generated/data/futhark/advancements/recipes/tools/runic_chisel.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_lapis_lazuli": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:lapis_lazuli" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:runic_chisel" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_lapis_lazuli", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "minecraft:runic_chisel" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/src/main/resources/data/futhark/loot_tables/blocks/jaffa_jam_block.json b/src/main/generated/data/futhark/loot_tables/blocks/jaffa_jam_block.json similarity index 100% rename from src/main/resources/data/futhark/loot_tables/blocks/jaffa_jam_block.json rename to src/main/generated/data/futhark/loot_tables/blocks/jaffa_jam_block.json diff --git a/src/main/generated/data/futhark/loot_tables/blocks/rune_block.json b/src/main/generated/data/futhark/loot_tables/blocks/rune_block.json new file mode 100644 index 0000000..4b1329b --- /dev/null +++ b/src/main/generated/data/futhark/loot_tables/blocks/rune_block.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "futhark:rune_block" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/futhark/recipes/jaffa_jam_block.json b/src/main/generated/data/futhark/recipes/jaffa_jam_block.json similarity index 89% rename from src/main/resources/data/futhark/recipes/jaffa_jam_block.json rename to src/main/generated/data/futhark/recipes/jaffa_jam_block.json index 64443a7..c9b02d6 100644 --- a/src/main/resources/data/futhark/recipes/jaffa_jam_block.json +++ b/src/main/generated/data/futhark/recipes/jaffa_jam_block.json @@ -1,6 +1,6 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "category": "building", "key": { "#": { "item": "futhark:jaffa_jam" diff --git a/src/main/resources/data/futhark/recipes/jaffa_jam_bottle.json b/src/main/generated/data/futhark/recipes/jaffa_jam_bottle.json similarity index 100% rename from src/main/resources/data/futhark/recipes/jaffa_jam_bottle.json rename to src/main/generated/data/futhark/recipes/jaffa_jam_bottle.json diff --git a/src/main/resources/data/futhark/recipes/runic_chisel.json b/src/main/generated/data/futhark/recipes/runic_chisel.json similarity index 90% rename from src/main/resources/data/futhark/recipes/runic_chisel.json rename to src/main/generated/data/futhark/recipes/runic_chisel.json index d345904..8e82f50 100644 --- a/src/main/resources/data/futhark/recipes/runic_chisel.json +++ b/src/main/generated/data/futhark/recipes/runic_chisel.json @@ -5,11 +5,11 @@ "#": { "item": "minecraft:stick" }, - "X": { - "item": "minecraft:iron_ingot" - }, "L": { "item": "minecraft:lapis_lazuli" + }, + "X": { + "item": "minecraft:iron_ingot" } }, "pattern": [ @@ -18,7 +18,7 @@ " L" ], "result": { - "item": "futhark.runic_chisel" + "item": "futhark:runic_chisel" }, "show_notification": true } \ No newline at end of file diff --git a/src/main/generated/data/futhark/tags/blocks/rune_component_blocks.json b/src/main/generated/data/futhark/tags/blocks/rune_component_blocks.json new file mode 100644 index 0000000..7de86cb --- /dev/null +++ b/src/main/generated/data/futhark/tags/blocks/rune_component_blocks.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:lapis_block" + ] +} \ No newline at end of file diff --git a/src/main/java/com/futhark/Futhark.java b/src/main/java/com/futhark/Futhark.java index 89ec608..c4f744b 100644 --- a/src/main/java/com/futhark/Futhark.java +++ b/src/main/java/com/futhark/Futhark.java @@ -4,7 +4,6 @@ import com.futhark.block.ModBlocks; import com.futhark.item.ModItemGroups; import com.futhark.item.ModItems; import net.fabricmc.api.ModInitializer; -import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.event.player.UseBlockCallback; import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry; diff --git a/src/main/java/com/futhark/FutharkDataGenerator.java b/src/main/java/com/futhark/FutharkDataGenerator.java index 292a336..452a528 100644 --- a/src/main/java/com/futhark/FutharkDataGenerator.java +++ b/src/main/java/com/futhark/FutharkDataGenerator.java @@ -1,11 +1,17 @@ package com.futhark; +import com.futhark.datagen.*; import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; public class FutharkDataGenerator implements DataGeneratorEntrypoint { @Override public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { - + FabricDataGenerator.Pack pack = fabricDataGenerator.createPack(); + pack.addProvider(ModBlockTagProvider::new); + pack.addProvider(ModItemTagProvider::new); + pack.addProvider(ModLootTableProvider::new); + pack.addProvider(ModModelProvider::new); + pack.addProvider(ModRecipeProvider::new); } } diff --git a/src/main/java/com/futhark/FutharkModClient.java b/src/main/java/com/futhark/FutharkModClient.java index 184ee10..057c5a1 100644 --- a/src/main/java/com/futhark/FutharkModClient.java +++ b/src/main/java/com/futhark/FutharkModClient.java @@ -1,12 +1,15 @@ package com.futhark; +import com.futhark.block.ModBlocks; import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry; +import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.entity.MinecartEntityRenderer; public class FutharkModClient implements ClientModInitializer{ @Override public void onInitializeClient() { - + BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.JAFFA_JAM_BLOCK, RenderLayer.getTranslucent()); } } diff --git a/src/main/java/com/futhark/ModTags.java b/src/main/java/com/futhark/ModTags.java new file mode 100644 index 0000000..0ea2406 --- /dev/null +++ b/src/main/java/com/futhark/ModTags.java @@ -0,0 +1,24 @@ +package com.futhark; + +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; +import net.minecraft.block.Block; +import net.minecraft.item.Item; + +public class ModTags { + public static class Blocks { + + public static final TagKey RUNE_COMPONENT_BLOCKS = createTag("rune_component_blocks"); + + private static TagKey createTag(String name) { + return TagKey.of(RegistryKeys.BLOCK, new Identifier(Futhark.MOD_ID, name)); + } + } + + public static class Items { + private static TagKey createTag(String name) { + return TagKey.of(RegistryKeys.ITEM, new Identifier(Futhark.MOD_ID, name)); + } + } +} diff --git a/src/main/java/com/futhark/block/ModBlocks.java b/src/main/java/com/futhark/block/ModBlocks.java index f70105b..beb41c6 100644 --- a/src/main/java/com/futhark/block/ModBlocks.java +++ b/src/main/java/com/futhark/block/ModBlocks.java @@ -1,7 +1,6 @@ package com.futhark.block; import com.futhark.Futhark; -import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.*; @@ -31,6 +30,5 @@ public class ModBlocks extends Block { public static void init() { Futhark.LOGGER.info("Registering Blocks"); - BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.JAFFA_JAM_BLOCK, RenderLayer.getTranslucent()); } } diff --git a/src/main/java/com/futhark/datagen/ModBlockTagProvider.java b/src/main/java/com/futhark/datagen/ModBlockTagProvider.java new file mode 100644 index 0000000..2491851 --- /dev/null +++ b/src/main/java/com/futhark/datagen/ModBlockTagProvider.java @@ -0,0 +1,26 @@ +package com.futhark.datagen; + +import com.futhark.ModTags; +import com.futhark.block.ModBlocks; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; +import net.minecraft.block.Blocks; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.RegistryWrapper; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; + +import java.util.concurrent.CompletableFuture; + +public class ModBlockTagProvider extends FabricTagProvider.BlockTagProvider { + public ModBlockTagProvider(FabricDataOutput output, CompletableFuture registriesFuture) { + super(output, registriesFuture); + } + + @Override + protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) { + getOrCreateTagBuilder(ModTags.Blocks.RUNE_COMPONENT_BLOCKS).add(Blocks.LAPIS_BLOCK); + + getOrCreateTagBuilder(TagKey.of(RegistryKeys.BLOCK, new Identifier("fabric", "needs_tool_level_4"))).add(ModBlocks.RUNE_BLOCK); + } +} diff --git a/src/main/java/com/futhark/datagen/ModItemTagProvider.java b/src/main/java/com/futhark/datagen/ModItemTagProvider.java new file mode 100644 index 0000000..a2c1a29 --- /dev/null +++ b/src/main/java/com/futhark/datagen/ModItemTagProvider.java @@ -0,0 +1,18 @@ +package com.futhark.datagen; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; +import net.minecraft.registry.RegistryWrapper; + +import java.util.concurrent.CompletableFuture; + +public class ModItemTagProvider extends FabricTagProvider.ItemTagProvider { + public ModItemTagProvider(FabricDataOutput output, CompletableFuture completableFuture) { + super(output, completableFuture); + } + + @Override + protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) { + + } +} diff --git a/src/main/java/com/futhark/datagen/ModLootTableProvider.java b/src/main/java/com/futhark/datagen/ModLootTableProvider.java new file mode 100644 index 0000000..ca00991 --- /dev/null +++ b/src/main/java/com/futhark/datagen/ModLootTableProvider.java @@ -0,0 +1,18 @@ +package com.futhark.datagen; + +import com.futhark.block.ModBlocks; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricLootTableProvider; + +public class ModLootTableProvider extends FabricBlockLootTableProvider { + public ModLootTableProvider(FabricDataOutput dataOutput) { + super(dataOutput); + } + + @Override + public void generate() { + addDrop(ModBlocks.JAFFA_JAM_BLOCK); + addDrop(ModBlocks.RUNE_BLOCK); + } +} diff --git a/src/main/java/com/futhark/datagen/ModModelProvider.java b/src/main/java/com/futhark/datagen/ModModelProvider.java new file mode 100644 index 0000000..65b8c45 --- /dev/null +++ b/src/main/java/com/futhark/datagen/ModModelProvider.java @@ -0,0 +1,28 @@ +package com.futhark.datagen; + +import com.futhark.block.ModBlocks; +import com.futhark.item.ModItems; +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; + +public class ModModelProvider extends FabricModelProvider { + public ModModelProvider(FabricDataOutput output) { + super(output); + } + + @Override + public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { + blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.JAFFA_JAM_BLOCK); + blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.RUNE_BLOCK); + } + + @Override + public void generateItemModels(ItemModelGenerator itemModelGenerator) { + itemModelGenerator.register(ModItems.JAFFA_CAKE, Models.GENERATED); + itemModelGenerator.register(ModItems.JAFFA_JAM, Models.GENERATED); + itemModelGenerator.register(ModItems.RUNIC_CHISEL, Models.GENERATED); + } +} diff --git a/src/main/java/com/futhark/datagen/ModRecipeProvider.java b/src/main/java/com/futhark/datagen/ModRecipeProvider.java new file mode 100644 index 0000000..9f7ad81 --- /dev/null +++ b/src/main/java/com/futhark/datagen/ModRecipeProvider.java @@ -0,0 +1,49 @@ +package com.futhark.datagen; + +import com.futhark.block.ModBlocks; +import com.futhark.item.ModItems; +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.data.server.recipe.ShapelessRecipeJsonBuilder; +import net.minecraft.item.Items; +import net.minecraft.recipe.book.RecipeCategory; +import net.minecraft.util.Identifier; + +import java.util.function.Consumer; + +public class ModRecipeProvider extends FabricRecipeProvider { + public ModRecipeProvider(FabricDataOutput output) { + super(output); + } + + @Override + public void generate(Consumer consumer) { + ShapedRecipeJsonBuilder.create(RecipeCategory.BUILDING_BLOCKS, ModBlocks.JAFFA_JAM_BLOCK, 1) + .pattern("##") + .pattern("##") + .input('#', ModItems.JAFFA_JAM) + .criterion(hasItem(ModItems.JAFFA_JAM), conditionsFromItem(ModItems.JAFFA_JAM)) + .offerTo(consumer, new Identifier(getRecipeName(ModBlocks.JAFFA_JAM_BLOCK))); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, ModItems.RUNIC_CHISEL, 1) + .pattern("X ") + .pattern(" # ") + .pattern(" L") + .input('X', Items.IRON_INGOT) + .input('#', Items.STICK) + .input('L', Items.LAPIS_LAZULI) + .criterion(hasItem(Items.LAPIS_LAZULI), conditionsFromItem(Items.LAPIS_LAZULI)) + .offerTo(consumer, new Identifier(getRecipeName(ModItems.RUNIC_CHISEL))); + + ShapelessRecipeJsonBuilder.create(RecipeCategory.FOOD, ModItems.JAFFA_JAM, 4) + .input(ModBlocks.JAFFA_JAM_BLOCK) + .input(Items.GLASS_BOTTLE) + .input(Items.GLASS_BOTTLE) + .input(Items.GLASS_BOTTLE) + .input(Items.GLASS_BOTTLE) + .criterion(hasItem(ModBlocks.JAFFA_JAM_BLOCK), conditionsFromItem(ModBlocks.JAFFA_JAM_BLOCK)) + .offerTo(consumer, new Identifier("jaffa_jam_bottle")); + } +} diff --git a/src/main/resources/assets/futhark/models/block/jaffa_jam_block.json b/src/main/resources/assets/futhark/models/block/jaffa_jam_block.json deleted file mode 100644 index c36a42e..0000000 --- a/src/main/resources/assets/futhark/models/block/jaffa_jam_block.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "futhark:block/jaffa_jam_block" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/futhark/models/block/rune_block.json b/src/main/resources/assets/futhark/models/block/rune_block.json deleted file mode 100644 index 0e49a0c..0000000 --- a/src/main/resources/assets/futhark/models/block/rune_block.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "futhark:block/rune_block" - } -} \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 4420eb0..1102096 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -18,6 +18,9 @@ "main": [ "com.futhark.Futhark" ], + "client": [ + "com.futhark.FutharkModClient" + ], "fabric-datagen": [ "com.futhark.FutharkDataGenerator" ]