Updated DataGen
This commit is contained in:
parent
c5a8086eb4
commit
35f62b16af
45 changed files with 1847 additions and 39 deletions
|
@ -9,6 +9,7 @@ import org.betterx.datagen.bclib.tests.TestBiomes;
|
|||
import org.betterx.datagen.bclib.tests.TestConfiguredFeatures;
|
||||
import org.betterx.datagen.bclib.tests.TestPlacedFeatures;
|
||||
import org.betterx.datagen.bclib.tests.TestStructure;
|
||||
import org.betterx.datagen.bclib.worldgen.BiomeDatagenProvider;
|
||||
import org.betterx.datagen.bclib.worldgen.NoiseTypesDataProvider;
|
||||
import org.betterx.datagen.bclib.worldgen.VanillaBCLBiomesDataProvider;
|
||||
import org.betterx.worlds.together.WorldsTogether;
|
||||
|
@ -59,7 +60,7 @@ public class BCLRegistrySupplier extends RegistrySupplier {
|
|||
registries.add(Registries.PLACED_FEATURE, PlacedFeature.DIRECT_CODEC, TestPlacedFeatures::bootstrap);
|
||||
registries.add(Registries.BIOME, Biome.DIRECT_CODEC, TestBiomes::bootstrap);
|
||||
} else {
|
||||
registries.addBootstrapOnly(Registries.BIOME, Biome.DIRECT_CODEC, TestBiomes::bootstrap);
|
||||
registries.addBootstrapOnly(Registries.BIOME, Biome.DIRECT_CODEC, BiomeDatagenProvider::bootstrap);
|
||||
}
|
||||
|
||||
registries.add(
|
||||
|
|
|
@ -2,9 +2,9 @@ package org.betterx.datagen.bclib;
|
|||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.datagen.bclib.advancement.BCLAdvancementDataProvider;
|
||||
import org.betterx.datagen.bclib.advancement.RecipeDataProvider;
|
||||
import org.betterx.datagen.bclib.preset.WorldPresetDataProvider;
|
||||
import org.betterx.datagen.bclib.tests.TestBiomes;
|
||||
import org.betterx.datagen.bclib.tests.TestRecipes;
|
||||
import org.betterx.datagen.bclib.tests.TestWorldgenProvider;
|
||||
import org.betterx.datagen.bclib.worldgen.BCLibRegistriesDataProvider;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
|
|||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
|
||||
|
||||
public class BCLibDatagen implements DataGeneratorEntrypoint {
|
||||
public static final boolean ADD_TESTS = true;
|
||||
public static final boolean ADD_TESTS = false;
|
||||
|
||||
@Override
|
||||
public void onInitializeDataGenerator(FabricDataGenerator dataGenerator) {
|
||||
|
@ -24,9 +24,11 @@ public class BCLibDatagen implements DataGeneratorEntrypoint {
|
|||
if (ADD_TESTS) {
|
||||
pack.addProvider(TestWorldgenProvider::new);
|
||||
pack.addProvider(TestBiomes::new);
|
||||
pack.addProvider(TestRecipes::new);
|
||||
RecipeDataProvider.createTestRecipes();
|
||||
}
|
||||
|
||||
|
||||
pack.addProvider(RecipeDataProvider::new);
|
||||
pack.addProvider(WorldPresetDataProvider::new);
|
||||
pack.addProvider(BCLibRegistriesDataProvider::new);
|
||||
pack.addProvider(BCLAdvancementDataProvider::new);
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
package org.betterx.datagen.bclib.advancement;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.recipes.BCLRecipeBuilder;
|
||||
import org.betterx.worlds.together.WorldsTogether;
|
||||
|
||||
import net.minecraft.data.recipes.RecipeCategory;
|
||||
import net.minecraft.world.item.Items;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RecipeDataProvider extends org.betterx.bclib.api.v3.datagen.RecipeDataProvider {
|
||||
public RecipeDataProvider(FabricDataOutput output) {
|
||||
super(List.of(BCLib.MOD_ID, WorldsTogether.MOD_ID), output);
|
||||
}
|
||||
|
||||
public static void createTestRecipes() {
|
||||
BCLRecipeBuilder
|
||||
.crafting(BCLib.makeID("test_star"), Items.NETHER_STAR)
|
||||
.setOutputCount(1)
|
||||
.setShape("ggg", "glg", "ggg")
|
||||
.addMaterial('g', Items.GLASS_PANE)
|
||||
.addMaterial('l', Items.LAPIS_LAZULI)
|
||||
.setCategory(RecipeCategory.TOOLS)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -23,7 +23,7 @@ import java.util.concurrent.CompletableFuture;
|
|||
public class TestBiomes extends TagDataProvider<Biome> {
|
||||
static BCLBiomeContainer<BCLBiome> THE_YELLOW = BCLBiomeBuilder
|
||||
.start(BCLib.makeID("the_yellow"))
|
||||
.precipitation(Biome.Precipitation.NONE)
|
||||
.hasPrecipitation(false)
|
||||
.temperature(1.0f)
|
||||
.wetness(1.0f)
|
||||
.fogColor(0xFFFF00)
|
||||
|
@ -38,7 +38,7 @@ public class TestBiomes extends TagDataProvider<Biome> {
|
|||
|
||||
static BCLBiomeContainer<BCLBiome> THE_BLUE = BCLBiomeBuilder
|
||||
.start(BCLib.makeID("the_blue"))
|
||||
.precipitation(Biome.Precipitation.NONE)
|
||||
.hasPrecipitation(false)
|
||||
.temperature(1.0f)
|
||||
.wetness(1.0f)
|
||||
.fogColor(0x0000FF)
|
||||
|
@ -53,7 +53,7 @@ public class TestBiomes extends TagDataProvider<Biome> {
|
|||
|
||||
static BCLBiomeContainer<BCLBiome> THE_GRAY = BCLBiomeBuilder
|
||||
.start(BCLib.makeID("the_gray"))
|
||||
.precipitation(Biome.Precipitation.NONE)
|
||||
.hasPrecipitation(false)
|
||||
.temperature(1.0f)
|
||||
.wetness(1.0f)
|
||||
.fogColor(0xFFFFFF)
|
||||
|
@ -66,7 +66,7 @@ public class TestBiomes extends TagDataProvider<Biome> {
|
|||
.build();
|
||||
static BCLBiomeContainer<BCLBiome> THE_ORANGE = BCLBiomeBuilder
|
||||
.start(BCLib.makeID("the_orange"))
|
||||
.precipitation(Biome.Precipitation.NONE)
|
||||
.hasPrecipitation(false)
|
||||
.temperature(1.0f)
|
||||
.wetness(1.0f)
|
||||
.fogColor(0xFF7700)
|
||||
|
@ -79,7 +79,7 @@ public class TestBiomes extends TagDataProvider<Biome> {
|
|||
.build();
|
||||
static BCLBiomeContainer<BCLBiome> THE_PURPLE = BCLBiomeBuilder
|
||||
.start(BCLib.makeID("the_purple"))
|
||||
.precipitation(Biome.Precipitation.NONE)
|
||||
.hasPrecipitation(false)
|
||||
.temperature(1.0f)
|
||||
.wetness(1.0f)
|
||||
.fogColor(0xFF00FF)
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
package org.betterx.datagen.bclib.tests;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.v3.datagen.RecipeDataProvider;
|
||||
import org.betterx.bclib.recipes.BCLRecipeBuilder;
|
||||
import org.betterx.bclib.recipes.CraftingRecipeBuilder;
|
||||
import org.betterx.worlds.together.WorldsTogether;
|
||||
|
||||
import net.minecraft.data.recipes.RecipeCategory;
|
||||
import net.minecraft.world.item.Items;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TestRecipes extends RecipeDataProvider {
|
||||
public TestRecipes(FabricDataOutput output) {
|
||||
super(List.of(BCLib.MOD_ID, WorldsTogether.MOD_ID), output);
|
||||
}
|
||||
|
||||
final CraftingRecipeBuilder WONDER = BCLRecipeBuilder
|
||||
.crafting(BCLib.makeID("test_star"), Items.NETHER_STAR)
|
||||
.setOutputCount(1)
|
||||
.setShape("ggg", "glg", "ggg")
|
||||
.addMaterial('g', Items.GLASS_PANE)
|
||||
.addMaterial('l', Items.LAPIS_LAZULI)
|
||||
.setCategory(RecipeCategory.TOOLS)
|
||||
.build();
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package org.betterx.datagen.bclib.worldgen;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.v3.datagen.TagDataProvider;
|
||||
import org.betterx.worlds.together.WorldsTogether;
|
||||
import org.betterx.worlds.together.tag.v3.TagManager;
|
||||
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.data.worldgen.BootstapContext;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class BiomeDatagenProvider extends TagDataProvider<Biome> {
|
||||
public BiomeDatagenProvider(
|
||||
FabricDataOutput output,
|
||||
CompletableFuture<HolderLookup.Provider> registriesFuture
|
||||
) {
|
||||
super(TagManager.BIOMES, List.of(BCLib.MOD_ID, WorldsTogether.MOD_ID, "c"), output, registriesFuture);
|
||||
}
|
||||
|
||||
public static void bootstrap(BootstapContext<Biome> bootstrapContext) {
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue