[Feature] New End-Village with some special loot
This commit is contained in:
parent
d588240c7f
commit
bc75a07d75
22 changed files with 185 additions and 4 deletions
|
@ -5,6 +5,7 @@ import org.betterx.bclib.api.v2.levelgen.surface.SurfaceRuleBuilder;
|
|||
import org.betterx.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndSounds;
|
||||
import org.betterx.betterend.registry.EndStructures;
|
||||
import org.betterx.betterend.world.biome.EndBiome;
|
||||
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
|
@ -31,6 +32,7 @@ public class DustWastelandsBiome extends EndBiome.Config {
|
|||
.loop(EndSounds.AMBIENT_DUST_WASTELANDS)
|
||||
.music(EndSounds.MUSIC_OPENSPACE)
|
||||
.structure(BiomeTags.HAS_END_CITY)
|
||||
.structure(EndStructures.END_VILLAGE.biomeTag)
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 2);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,138 @@
|
|||
package org.betterx.betterend.world.structures.village;
|
||||
|
||||
import org.betterx.bclib.api.v2.levelgen.structures.StructurePools;
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
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.Pools;
|
||||
import net.minecraft.data.worldgen.ProcessorLists;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
import net.minecraft.world.level.levelgen.structure.pools.StructurePoolElement;
|
||||
import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorList;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public class VillagePools {
|
||||
public static ResourceKey<StructureTemplatePool> TERMINATORS_KEY = StructurePools
|
||||
.createKey(BetterEnd.makeID("village/terminators"));
|
||||
public static ResourceKey<StructureTemplatePool> START = StructurePools
|
||||
.createKey(BetterEnd.makeID("village/center_piece"));
|
||||
public static ResourceKey<StructureTemplatePool> HOUSES_KEY = StructurePools
|
||||
.createKey(BetterEnd.makeID("village/houses"));
|
||||
public static ResourceKey<StructureTemplatePool> STREET_KEY = StructurePools
|
||||
.createKey(BetterEnd.makeID("village/streets"));
|
||||
public static ResourceKey<StructureTemplatePool> STREET_DECO_KEY = StructurePools
|
||||
.createKey(BetterEnd.makeID("village/street_decorations"));
|
||||
public static ResourceKey<StructureTemplatePool> DECORATIONS_KEY = StructurePools
|
||||
.createKey(BetterEnd.makeID("village/decorations"));
|
||||
|
||||
public static void bootstrap(BootstapContext<StructureTemplatePool> ctx) {
|
||||
final HolderGetter<StructureProcessorList> processorGetter = ctx.lookup(Registries.PROCESSOR_LIST);
|
||||
final HolderGetter<PlacedFeature> featureGetter = ctx.lookup(Registries.PLACED_FEATURE);
|
||||
final HolderGetter<StructureTemplatePool> poolGetter = ctx.lookup(Registries.TEMPLATE_POOL);
|
||||
HolderGetter<Biome> biomeGetter = ctx.lookup(Registries.BIOME);
|
||||
|
||||
final Holder.Reference<StructureTemplatePool> emptyPool = poolGetter.getOrThrow(Pools.EMPTY);
|
||||
final Holder.Reference<StructureTemplatePool> terminatorPool = poolGetter.getOrThrow(VillagePools.TERMINATORS_KEY);
|
||||
|
||||
final Holder.Reference<StructureProcessorList> emptyProcessor = processorGetter.getOrThrow(ProcessorLists.EMPTY);
|
||||
ctx.register(VillagePools.TERMINATORS_KEY, new StructureTemplatePool(
|
||||
emptyPool,
|
||||
ImmutableList.of(Pair.of(
|
||||
StructurePools.single(
|
||||
BetterEnd.makeID("village/terminators/stree_terminator_01"),
|
||||
emptyProcessor
|
||||
),
|
||||
1
|
||||
)),
|
||||
StructureTemplatePool.Projection.TERRAIN_MATCHING
|
||||
));
|
||||
ctx.register(VillagePools.START, new StructureTemplatePool(
|
||||
terminatorPool,
|
||||
ImmutableList.of(Pair.of(
|
||||
StructurePools.single(BetterEnd.makeID("village/center/light_pyramid_01"), emptyProcessor),
|
||||
1
|
||||
)),
|
||||
StructureTemplatePool.Projection.RIGID
|
||||
));
|
||||
ctx.register(VillagePools.HOUSES_KEY, new StructureTemplatePool(
|
||||
terminatorPool,
|
||||
ImmutableList.of(Pair.of(StructurePoolElement.empty(), 5), Pair.of(
|
||||
StructurePools.single(BetterEnd.makeID("village/houses/small_house_01"), emptyProcessor),
|
||||
1
|
||||
), Pair.of(
|
||||
StructurePools.single(BetterEnd.makeID("village/houses/small_house_02"), emptyProcessor),
|
||||
1
|
||||
), Pair.of(
|
||||
StructurePools.single(BetterEnd.makeID("village/houses/small_house_03"), emptyProcessor),
|
||||
1
|
||||
), Pair.of(
|
||||
StructurePools.single(BetterEnd.makeID("village/houses/small_house_04"), emptyProcessor),
|
||||
1
|
||||
), Pair.of(
|
||||
StructurePools.single(BetterEnd.makeID("village/houses/small_house_05"), emptyProcessor),
|
||||
1
|
||||
), Pair.of(
|
||||
StructurePools.single(BetterEnd.makeID("village/houses/small_house_06"), emptyProcessor),
|
||||
1
|
||||
), Pair.of(
|
||||
StructurePools.single(BetterEnd.makeID("village/houses/small_house_07"), emptyProcessor),
|
||||
1
|
||||
)),
|
||||
StructureTemplatePool.Projection.RIGID
|
||||
));
|
||||
ctx.register(VillagePools.STREET_KEY, new StructureTemplatePool(
|
||||
terminatorPool,
|
||||
ImmutableList.of(Pair.of(
|
||||
StructurePools.single(BetterEnd.makeID("village/streets/street_01"), emptyProcessor),
|
||||
6
|
||||
), Pair.of(
|
||||
StructurePools.single(BetterEnd.makeID("village/streets/street_02"), emptyProcessor),
|
||||
4
|
||||
), Pair.of(
|
||||
StructurePools.single(BetterEnd.makeID("village/streets/curve_01"), emptyProcessor),
|
||||
3
|
||||
), Pair.of(
|
||||
StructurePools.single(BetterEnd.makeID("village/streets/t_crossing_01"), emptyProcessor),
|
||||
1
|
||||
), Pair.of(
|
||||
StructurePools.single(BetterEnd.makeID("village/streets/t_crossing_02"), emptyProcessor),
|
||||
2
|
||||
)),
|
||||
StructureTemplatePool.Projection.TERRAIN_MATCHING
|
||||
));
|
||||
ctx.register(VillagePools.STREET_DECO_KEY, new StructureTemplatePool(
|
||||
terminatorPool,
|
||||
ImmutableList.of(
|
||||
Pair.of(StructurePoolElement.empty(), 5),
|
||||
Pair.of(
|
||||
StructurePools.single(
|
||||
BetterEnd.makeID("village/street_decoration/lamp_02"),
|
||||
emptyProcessor
|
||||
),
|
||||
2
|
||||
),
|
||||
Pair.of(
|
||||
StructurePools.single(
|
||||
BetterEnd.makeID("village/street_decoration/lamp_05"),
|
||||
emptyProcessor
|
||||
),
|
||||
1
|
||||
)
|
||||
),
|
||||
StructureTemplatePool.Projection.RIGID
|
||||
));
|
||||
ctx.register(VillagePools.DECORATIONS_KEY, new StructureTemplatePool(
|
||||
terminatorPool,
|
||||
ImmutableList.of(),
|
||||
StructureTemplatePool.Projection.RIGID
|
||||
));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue