From 3bb6e324a107b22d9c9d1703c16f014592c90a14 Mon Sep 17 00:00:00 2001 From: flatkat Date: Sat, 20 Jul 2024 17:50:21 +0200 Subject: [PATCH] Added datagen stuff and rose loot table -Rose now drops itself when broken -Potted Rose now drops a pot and a rose when broken -Datagen Stuff added (most of them commented out on the DataGenerator class due to them not being used) *Contents of the "generated" folder have not been added (at least yet) bc idk if im supposed to. I have plans to make a Github Actions script that runs datagen for me on the repo. Until then, if you download this repo you will have to run datagen manually before building. --- .../AncientAndForgottenDataGenerator.java | 10 ++++++++++ .../datagen/ModBlockTagProvider.java | 19 +++++++++++++++++++ .../datagen/ModItemTagProvider.java | 4 ++++ .../datagen/ModLootTableProvider.java | 19 +++++++++++++++++++ .../datagen/ModModelProvider.java | 4 ++++ .../datagen/ModRecipeProvider.java | 4 ++++ 6 files changed, 60 insertions(+) create mode 100644 src/main/java/net/flatkat/ancient_forgotten/datagen/ModBlockTagProvider.java create mode 100644 src/main/java/net/flatkat/ancient_forgotten/datagen/ModItemTagProvider.java create mode 100644 src/main/java/net/flatkat/ancient_forgotten/datagen/ModLootTableProvider.java create mode 100644 src/main/java/net/flatkat/ancient_forgotten/datagen/ModModelProvider.java create mode 100644 src/main/java/net/flatkat/ancient_forgotten/datagen/ModRecipeProvider.java diff --git a/src/main/java/net/flatkat/ancient_forgotten/AncientAndForgottenDataGenerator.java b/src/main/java/net/flatkat/ancient_forgotten/AncientAndForgottenDataGenerator.java index 1b6733c..a98b5f0 100644 --- a/src/main/java/net/flatkat/ancient_forgotten/AncientAndForgottenDataGenerator.java +++ b/src/main/java/net/flatkat/ancient_forgotten/AncientAndForgottenDataGenerator.java @@ -2,10 +2,20 @@ import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; +import net.flatkat.ancient_forgotten.datagen.*; public class AncientAndForgottenDataGenerator 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/net/flatkat/ancient_forgotten/datagen/ModBlockTagProvider.java b/src/main/java/net/flatkat/ancient_forgotten/datagen/ModBlockTagProvider.java new file mode 100644 index 0000000..d510ccf --- /dev/null +++ b/src/main/java/net/flatkat/ancient_forgotten/datagen/ModBlockTagProvider.java @@ -0,0 +1,19 @@ +package net.flatkat.ancient_forgotten.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 ModBlockTagProvider extends FabricTagProvider.BlockTagProvider { + + public ModBlockTagProvider(FabricDataOutput output, CompletableFuture registriesFuture) { + super(output, registriesFuture); + } + + @Override + protected void configure(RegistryWrapper.WrapperLookup arg) { + + } +} diff --git a/src/main/java/net/flatkat/ancient_forgotten/datagen/ModItemTagProvider.java b/src/main/java/net/flatkat/ancient_forgotten/datagen/ModItemTagProvider.java new file mode 100644 index 0000000..1b8b2d8 --- /dev/null +++ b/src/main/java/net/flatkat/ancient_forgotten/datagen/ModItemTagProvider.java @@ -0,0 +1,4 @@ +package net.flatkat.ancient_forgotten.datagen; + +public class ModItemTagProvider { +} diff --git a/src/main/java/net/flatkat/ancient_forgotten/datagen/ModLootTableProvider.java b/src/main/java/net/flatkat/ancient_forgotten/datagen/ModLootTableProvider.java new file mode 100644 index 0000000..734e270 --- /dev/null +++ b/src/main/java/net/flatkat/ancient_forgotten/datagen/ModLootTableProvider.java @@ -0,0 +1,19 @@ +package net.flatkat.ancient_forgotten.datagen; + +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; +import net.flatkat.ancient_forgotten.block.ModBlocks; + +public class ModLootTableProvider extends FabricBlockLootTableProvider { + + public ModLootTableProvider(FabricDataOutput dataOutput) { + super(dataOutput); + } + + @Override + public void generate() { + addDrop(ModBlocks.ROSE); + addPottedPlantDrops(ModBlocks.POTTED_ROSE); + } +} diff --git a/src/main/java/net/flatkat/ancient_forgotten/datagen/ModModelProvider.java b/src/main/java/net/flatkat/ancient_forgotten/datagen/ModModelProvider.java new file mode 100644 index 0000000..59bbf5a --- /dev/null +++ b/src/main/java/net/flatkat/ancient_forgotten/datagen/ModModelProvider.java @@ -0,0 +1,4 @@ +package net.flatkat.ancient_forgotten.datagen; + +public class ModModelProvider { +} diff --git a/src/main/java/net/flatkat/ancient_forgotten/datagen/ModRecipeProvider.java b/src/main/java/net/flatkat/ancient_forgotten/datagen/ModRecipeProvider.java new file mode 100644 index 0000000..5898514 --- /dev/null +++ b/src/main/java/net/flatkat/ancient_forgotten/datagen/ModRecipeProvider.java @@ -0,0 +1,4 @@ +package net.flatkat.ancient_forgotten.datagen; + +public class ModRecipeProvider { +}