Moved ADD_TESTS
-Field
This commit is contained in:
parent
4977e659db
commit
b652f4fbce
8 changed files with 9 additions and 13 deletions
|
@ -42,6 +42,7 @@ public class BCLib implements ModInitializer {
|
||||||
public static final boolean RUNS_NULLSCAPE = FabricLoader.getInstance()
|
public static final boolean RUNS_NULLSCAPE = FabricLoader.getInstance()
|
||||||
.getModContainer("nullscape")
|
.getModContainer("nullscape")
|
||||||
.isPresent();
|
.isPresent();
|
||||||
|
public static final boolean ADD_TEST_DATA = true;
|
||||||
|
|
||||||
private void onDatagen() {
|
private void onDatagen() {
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class BCLRegistrySupplier extends RegistrySupplier {
|
||||||
);
|
);
|
||||||
registries.addUnfiltered(SurfaceRuleRegistry.SURFACE_RULES_REGISTRY, AssignedSurfaceRule.CODEC);
|
registries.addUnfiltered(SurfaceRuleRegistry.SURFACE_RULES_REGISTRY, AssignedSurfaceRule.CODEC);
|
||||||
|
|
||||||
if (BCLibDatagen.ADD_TESTS) {
|
if (BCLib.ADD_TEST_DATA) {
|
||||||
registries.add(Registries.STRUCTURE, Structure.DIRECT_CODEC, TestStructure::bootstrap);
|
registries.add(Registries.STRUCTURE, Structure.DIRECT_CODEC, TestStructure::bootstrap);
|
||||||
registries.add(Registries.STRUCTURE_SET, StructureSet.DIRECT_CODEC, TestStructure::bootstrapSet);
|
registries.add(Registries.STRUCTURE_SET, StructureSet.DIRECT_CODEC, TestStructure::bootstrapSet);
|
||||||
registries.add(
|
registries.add(
|
||||||
|
|
|
@ -15,7 +15,6 @@ import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
|
||||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
|
||||||
|
|
||||||
public class BCLibDatagen implements DataGeneratorEntrypoint {
|
public class BCLibDatagen implements DataGeneratorEntrypoint {
|
||||||
public static final boolean ADD_TESTS = true;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeDataGenerator(FabricDataGenerator dataGenerator) {
|
public void onInitializeDataGenerator(FabricDataGenerator dataGenerator) {
|
||||||
|
@ -23,7 +22,7 @@ public class BCLibDatagen implements DataGeneratorEntrypoint {
|
||||||
final FabricDataGenerator.Pack pack = dataGenerator.createPack();
|
final FabricDataGenerator.Pack pack = dataGenerator.createPack();
|
||||||
|
|
||||||
NullscapeBiomes.ensureStaticallyLoaded();
|
NullscapeBiomes.ensureStaticallyLoaded();
|
||||||
if (ADD_TESTS) {
|
if (BCLib.ADD_TEST_DATA) {
|
||||||
TestBiomes.ensureStaticallyLoaded();
|
TestBiomes.ensureStaticallyLoaded();
|
||||||
|
|
||||||
pack.addProvider(TestWorldgenProvider::new);
|
pack.addProvider(TestWorldgenProvider::new);
|
||||||
|
|
|
@ -5,7 +5,6 @@ import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiome;
|
||||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeBuilder;
|
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeBuilder;
|
||||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeContainer;
|
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeContainer;
|
||||||
import org.betterx.bclib.api.v3.datagen.TagDataProvider;
|
import org.betterx.bclib.api.v3.datagen.TagDataProvider;
|
||||||
import org.betterx.datagen.bclib.BCLibDatagen;
|
|
||||||
import org.betterx.worlds.together.WorldsTogether;
|
import org.betterx.worlds.together.WorldsTogether;
|
||||||
import org.betterx.worlds.together.tag.v3.TagManager;
|
import org.betterx.worlds.together.tag.v3.TagManager;
|
||||||
|
|
||||||
|
@ -107,7 +106,7 @@ public class TestBiomes extends TagDataProvider<Biome> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void bootstrap(BootstapContext<Biome> bootstrapContext) {
|
public static void bootstrap(BootstapContext<Biome> bootstrapContext) {
|
||||||
if (BCLibDatagen.ADD_TESTS && BCLib.isDevEnvironment()) {
|
if (BCLib.ADD_TEST_DATA && BCLib.isDevEnvironment()) {
|
||||||
BCLib.LOGGER.info("Bootstrap Biomes");
|
BCLib.LOGGER.info("Bootstrap Biomes");
|
||||||
|
|
||||||
THE_YELLOW = THE_YELLOW.register(bootstrapContext);
|
THE_YELLOW = THE_YELLOW.register(bootstrapContext);
|
||||||
|
|
|
@ -3,7 +3,6 @@ package org.betterx.datagen.bclib.tests;
|
||||||
import org.betterx.bclib.BCLib;
|
import org.betterx.bclib.BCLib;
|
||||||
import org.betterx.bclib.api.v3.levelgen.features.BCLConfigureFeature;
|
import org.betterx.bclib.api.v3.levelgen.features.BCLConfigureFeature;
|
||||||
import org.betterx.bclib.api.v3.levelgen.features.BCLFeatureBuilder;
|
import org.betterx.bclib.api.v3.levelgen.features.BCLFeatureBuilder;
|
||||||
import org.betterx.datagen.bclib.BCLibDatagen;
|
|
||||||
|
|
||||||
import net.minecraft.core.Holder;
|
import net.minecraft.core.Holder;
|
||||||
import net.minecraft.core.registries.Registries;
|
import net.minecraft.core.registries.Registries;
|
||||||
|
@ -32,7 +31,7 @@ public class TestConfiguredFeatures {
|
||||||
YELLOW_FEATURE.id
|
YELLOW_FEATURE.id
|
||||||
));
|
));
|
||||||
|
|
||||||
if (BCLibDatagen.ADD_TESTS && BCLib.isDevEnvironment()) {
|
if (BCLib.ADD_TEST_DATA && BCLib.isDevEnvironment()) {
|
||||||
BCLib.LOGGER.info("Bootstrap CONFIGUREDFeatures" + holder);
|
BCLib.LOGGER.info("Bootstrap CONFIGUREDFeatures" + holder);
|
||||||
//YELLOW_FEATURE = YELLOW_FEATURE.register(bootstrapContext);
|
//YELLOW_FEATURE = YELLOW_FEATURE.register(bootstrapContext);
|
||||||
BCLFeatureBuilder.registerUnbound(bootstrapContext);
|
BCLFeatureBuilder.registerUnbound(bootstrapContext);
|
||||||
|
|
|
@ -2,7 +2,6 @@ package org.betterx.datagen.bclib.tests;
|
||||||
|
|
||||||
import org.betterx.bclib.BCLib;
|
import org.betterx.bclib.BCLib;
|
||||||
import org.betterx.bclib.api.v3.levelgen.features.BCLFeature;
|
import org.betterx.bclib.api.v3.levelgen.features.BCLFeature;
|
||||||
import org.betterx.datagen.bclib.BCLibDatagen;
|
|
||||||
|
|
||||||
import net.minecraft.data.worldgen.BootstapContext;
|
import net.minecraft.data.worldgen.BootstapContext;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
|
@ -26,7 +25,7 @@ public class TestPlacedFeatures {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
public static void bootstrap(BootstapContext<PlacedFeature> bootstrapContext) {
|
public static void bootstrap(BootstapContext<PlacedFeature> bootstrapContext) {
|
||||||
if (BCLibDatagen.ADD_TESTS && BCLib.isDevEnvironment()) {
|
if (BCLib.ADD_TEST_DATA && BCLib.isDevEnvironment()) {
|
||||||
BCLib.LOGGER.info("Bootstrap PLACEDFeatures");
|
BCLib.LOGGER.info("Bootstrap PLACEDFeatures");
|
||||||
YELLOW_PLACED = YELLOW_PLACED.register(bootstrapContext);
|
YELLOW_PLACED = YELLOW_PLACED.register(bootstrapContext);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import org.betterx.bclib.api.v2.levelgen.structures.BCLStructure;
|
||||||
import org.betterx.bclib.api.v2.levelgen.structures.BCLStructureBuilder;
|
import org.betterx.bclib.api.v2.levelgen.structures.BCLStructureBuilder;
|
||||||
import org.betterx.bclib.util.BlocksHelper;
|
import org.betterx.bclib.util.BlocksHelper;
|
||||||
import org.betterx.bclib.util.MHelper;
|
import org.betterx.bclib.util.MHelper;
|
||||||
import org.betterx.datagen.bclib.BCLibDatagen;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
|
@ -162,7 +161,7 @@ public class TestStructure extends Structure {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerBase() {
|
public static void registerBase() {
|
||||||
if (BCLibDatagen.ADD_TESTS && BCLib.isDevEnvironment()) {
|
if (BCLib.ADD_TEST_DATA && BCLib.isDevEnvironment()) {
|
||||||
Registry.register(BuiltInRegistries.STRUCTURE_PIECE, TestStructurePiece.KEY, TestStructurePiece.INSTANCE);
|
Registry.register(BuiltInRegistries.STRUCTURE_PIECE, TestStructurePiece.KEY, TestStructurePiece.INSTANCE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package org.betterx.datagen.bclib.tests;
|
package org.betterx.datagen.bclib.tests;
|
||||||
|
|
||||||
import org.betterx.datagen.bclib.BCLibDatagen;
|
import org.betterx.bclib.BCLib;
|
||||||
|
|
||||||
import net.minecraft.core.HolderLookup;
|
import net.minecraft.core.HolderLookup;
|
||||||
import net.minecraft.core.registries.Registries;
|
import net.minecraft.core.registries.Registries;
|
||||||
|
@ -20,7 +20,7 @@ public class TestWorldgenProvider extends FabricDynamicRegistryProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure(HolderLookup.Provider registries, Entries entries) {
|
protected void configure(HolderLookup.Provider registries, Entries entries) {
|
||||||
if (BCLibDatagen.ADD_TESTS) {
|
if (BCLib.ADD_TEST_DATA) {
|
||||||
entries.addAll(registries.lookupOrThrow(Registries.CONFIGURED_FEATURE));
|
entries.addAll(registries.lookupOrThrow(Registries.CONFIGURED_FEATURE));
|
||||||
entries.addAll(registries.lookupOrThrow(Registries.PLACED_FEATURE));
|
entries.addAll(registries.lookupOrThrow(Registries.PLACED_FEATURE));
|
||||||
entries.addAll(registries.lookupOrThrow(Registries.BIOME));
|
entries.addAll(registries.lookupOrThrow(Registries.BIOME));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue