New Structures for end village

This commit is contained in:
Frank 2023-06-14 13:14:54 +02:00
parent 3454b4e801
commit 6585eabb7e
14 changed files with 56 additions and 10 deletions

View file

@ -16,4 +16,7 @@ public class EndProcessors {
public static final ResourceKey<StructureProcessorList> END_STREET = public static final ResourceKey<StructureProcessorList> END_STREET =
ProcessorHelper.createKey(BetterEnd.makeID("end_street")); ProcessorHelper.createKey(BetterEnd.makeID("end_street"));
public static final ResourceKey<StructureProcessorList> CRYING_10_PERCENT =
ProcessorHelper.createKey(BetterEnd.makeID("crying_10_percent"));
} }

View file

@ -40,13 +40,13 @@ public class EndStructures {
public static final BCLStructure<MegaLakeStructure> MEGALAKE = BCLStructureBuilder public static final BCLStructure<MegaLakeStructure> MEGALAKE = BCLStructureBuilder
.start(BetterEnd.makeID("megalake"), MegaLakeStructure::new) .start(BetterEnd.makeID("megalake"), MegaLakeStructure::new)
.step(Decoration.RAW_GENERATION) .step(Decoration.LAKES)
.randomPlacement(4, 1) .randomPlacement(4, 1)
.build(); .build();
public static final BCLStructure<MegaLakeSmallStructure> MEGALAKE_SMALL = BCLStructureBuilder public static final BCLStructure<MegaLakeSmallStructure> MEGALAKE_SMALL = BCLStructureBuilder
.start(BetterEnd.makeID("megalake_small"), MegaLakeSmallStructure::new) .start(BetterEnd.makeID("megalake_small"), MegaLakeSmallStructure::new)
.step(Decoration.RAW_GENERATION) .step(Decoration.LAKES)
.randomPlacement(4, 1) .randomPlacement(4, 1)
.build(); .build();

View file

@ -24,6 +24,10 @@ import com.google.common.collect.ImmutableList;
import java.util.function.Function; import java.util.function.Function;
public class VillagePools { public class VillagePools {
public static final ResourceKey<PlacedFeature> CHORUS_VILLAGE = ResourceKey.create(
Registries.PLACED_FEATURE,
BetterEnd.makeID("village_chorus")
);
public static ResourceKey<StructureTemplatePool> TERMINATORS_KEY = StructurePools public static ResourceKey<StructureTemplatePool> TERMINATORS_KEY = StructurePools
.createKey(BetterEnd.makeID("village/terminators")); .createKey(BetterEnd.makeID("village/terminators"));
public static ResourceKey<StructureTemplatePool> START = StructurePools public static ResourceKey<StructureTemplatePool> START = StructurePools
@ -54,12 +58,14 @@ public class VillagePools {
final Holder.Reference<StructureTemplatePool> emptyPool = poolGetter.getOrThrow(Pools.EMPTY); final Holder.Reference<StructureTemplatePool> emptyPool = poolGetter.getOrThrow(Pools.EMPTY);
final Holder.Reference<StructureTemplatePool> terminatorPool = poolGetter.getOrThrow(VillagePools.TERMINATORS_KEY); final Holder.Reference<StructureTemplatePool> terminatorPool = poolGetter.getOrThrow(VillagePools.TERMINATORS_KEY);
Holder.Reference<StructureProcessorList> mossifyProcessor = processorGetter.getOrThrow(EndProcessors.WEATHERED_10_PERCENT); final Holder.Reference<StructureProcessorList> mossifyProcessor = processorGetter.getOrThrow(EndProcessors.WEATHERED_10_PERCENT);
Holder.Reference<StructureProcessorList> crack = processorGetter.getOrThrow(EndProcessors.CRACK_20_PERCENT); final Holder.Reference<StructureProcessorList> crack = processorGetter.getOrThrow(EndProcessors.CRACK_20_PERCENT);
Holder.Reference<StructureProcessorList> crackAndWeather = processorGetter.getOrThrow(EndProcessors.CRACK_AND_WEATHER); final Holder.Reference<StructureProcessorList> cry = processorGetter.getOrThrow(EndProcessors.CRYING_10_PERCENT);
Holder.Reference<StructureProcessorList> endStreetProcessor = processorGetter.getOrThrow(EndProcessors.END_STREET); final Holder.Reference<StructureProcessorList> crackAndWeather = processorGetter.getOrThrow(EndProcessors.CRACK_AND_WEATHER);
final Holder.Reference<StructureProcessorList> endStreetProcessor = processorGetter.getOrThrow(EndProcessors.END_STREET);
final Holder.Reference<StructureProcessorList> emptyProcessor = processorGetter.getOrThrow(ProcessorLists.EMPTY); final Holder.Reference<StructureProcessorList> emptyProcessor = processorGetter.getOrThrow(ProcessorLists.EMPTY);
final Holder.Reference<PlacedFeature> chorus = featureGetter.getOrThrow(CHORUS_VILLAGE);
ctx.register(VillagePools.TERMINATORS_KEY, new StructureTemplatePool( ctx.register(VillagePools.TERMINATORS_KEY, new StructureTemplatePool(
emptyPool, emptyPool,
ImmutableList.of( ImmutableList.of(
@ -101,7 +107,8 @@ public class VillagePools {
single("village/decoration/pond_01", mossifyProcessor, 1), single("village/decoration/pond_01", mossifyProcessor, 1),
single("village/decoration/respawn_01", endStreetProcessor, 1), single("village/decoration/respawn_01", endStreetProcessor, 1),
single("village/decoration/respawn_02", endStreetProcessor, 1), single("village/decoration/respawn_02", endStreetProcessor, 1),
single("village/decoration/fountain_01", endStreetProcessor, 1) single("village/decoration/fountain_01", endStreetProcessor, 1),
single("village/street_decoration/work_01", endStreetProcessor, 1)
), ),
StructureTemplatePool.Projection.RIGID StructureTemplatePool.Projection.RIGID
@ -124,8 +131,15 @@ public class VillagePools {
terminatorPool, terminatorPool,
ImmutableList.of( ImmutableList.of(
Pair.of(StructurePoolElement.empty(), 5), Pair.of(StructurePoolElement.empty(), 5),
single("village/street_decoration/lamp_02", emptyProcessor, 2), single("village/street_decoration/lamp_02", emptyProcessor, 4),
single("village/street_decoration/lamp_05", emptyProcessor, 1) single("village/street_decoration/lamp_05", emptyProcessor, 2),
single("village/street_decoration/lamp_06", emptyProcessor, 3),
single("village/street_decoration/obsidian_01", cry, 2),
single("village/street_decoration/obsidian_02", cry, 3),
single("village/street_decoration/obsidian_03", cry, 2),
single("village/street_decoration/obsidian_04", cry, 2),
single("village/street_decoration/obsidian_05", cry, 1),
Pair.of(StructurePoolElement.feature(chorus), 2)
), ),
StructureTemplatePool.Projection.RIGID StructureTemplatePool.Projection.RIGID
)); ));

View file

@ -1,12 +1,30 @@
package org.betterx.datagen.betterend.worldgen; package org.betterx.datagen.betterend.worldgen;
import org.betterx.bclib.api.v3.levelgen.features.BCLPlacedFeatureBuilder; import org.betterx.bclib.api.v3.levelgen.features.BCLPlacedFeatureBuilder;
import org.betterx.betterend.world.structures.village.VillagePools;
import net.minecraft.core.Holder;
import net.minecraft.core.HolderGetter;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstapContext; import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.data.worldgen.features.EndFeatures;
import net.minecraft.data.worldgen.placement.PlacementUtils;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.placement.PlacedFeature; import net.minecraft.world.level.levelgen.placement.PlacedFeature;
public class PlacedFeatureDataProvider { public class PlacedFeatureDataProvider {
public static void bootstrap(BootstapContext<PlacedFeature> ctx) { public static void bootstrap(BootstapContext<PlacedFeature> ctx) {
BCLPlacedFeatureBuilder.registerUnbound(ctx); BCLPlacedFeatureBuilder.registerUnbound(ctx);
HolderGetter<ConfiguredFeature<?, ?>> configuredFeatures = ctx.lookup(Registries.CONFIGURED_FEATURE);
Holder.Reference<ConfiguredFeature<?, ?>> chorusFeature = configuredFeatures.getOrThrow(EndFeatures.CHORUS_PLANT);
PlacementUtils.register(
ctx,
VillagePools.CHORUS_VILLAGE,
chorusFeature,
PlacementUtils.filteredByBlockSurvival(Blocks.CHORUS_PLANT)
);
} }
} }

View file

@ -15,6 +15,15 @@ import com.google.common.collect.ImmutableList;
public class ProcessorsDataProvider { public class ProcessorsDataProvider {
public static void bootstrap(BootstapContext<StructureProcessorList> bootstapContext) { public static void bootstrap(BootstapContext<StructureProcessorList> bootstapContext) {
ProcessorHelper.register(
bootstapContext,
EndProcessors.CRYING_10_PERCENT,
ImmutableList.of(new RuleProcessor(ImmutableList.of(new ProcessorRule(
new RandomBlockMatchTest(Blocks.OBSIDIAN, 0.1f),
AlwaysTrueTest.INSTANCE,
Blocks.CRYING_OBSIDIAN.defaultBlockState()
))))
);
ProcessorHelper.register( ProcessorHelper.register(
bootstapContext, bootstapContext,
EndProcessors.WEATHERED_10_PERCENT, EndProcessors.WEATHERED_10_PERCENT,

View file

@ -13,5 +13,7 @@ public class StructureDataProvider {
public static void bootstrapSets(BootstapContext<StructureSet> ctx) { public static void bootstrapSets(BootstapContext<StructureSet> ctx) {
BCLStructureBuilder.registerUnboundSets(ctx); BCLStructureBuilder.registerUnboundSets(ctx);
} }
} }