diff --git a/src/main/java/io/github/frqnny/mostructures/init/Events.java b/src/main/java/io/github/frqnny/mostructures/init/Events.java index 5d7256f..4bde5c3 100644 --- a/src/main/java/io/github/frqnny/mostructures/init/Events.java +++ b/src/main/java/io/github/frqnny/mostructures/init/Events.java @@ -2,32 +2,23 @@ import io.github.frqnny.mostructures.MoStructures; import io.github.frqnny.mostructures.config.StructureConfigEntry; -import io.github.frqnny.mostructures.mixin.RandomSpreadStructurePlacementAccessor; -import io.github.frqnny.mostructures.mixin.StructureSetAccessor; +import io.github.frqnny.mostructures.structure.ModStructurePlacement; import net.fabricmc.fabric.api.event.registry.DynamicRegistrySetupCallback; import net.minecraft.registry.RegistryKeys; -import net.minecraft.world.gen.chunk.placement.RandomSpreadStructurePlacement; - -import java.util.List; public class Events { public static void init() { - DynamicRegistrySetupCallback.EVENT.register(view -> { - view.registerEntryAdded(RegistryKeys.STRUCTURE_SET, (rawId, id, structureSet) -> { - StructureConfigEntry entry = MoStructures.CONFIG.get(id); + DynamicRegistrySetupCallback.EVENT.register(view -> view.registerEntryAdded(RegistryKeys.STRUCTURE_SET, (rawId, id, structureSet) -> { + StructureConfigEntry entry = MoStructures.CONFIG.get(id); - if (entry != null) { // id matches some structure in the config - if (structureSet.placement() instanceof RandomSpreadStructurePlacement) { - ((RandomSpreadStructurePlacementAccessor) structureSet.placement()).setSpacing(entry.spacing); - ((RandomSpreadStructurePlacementAccessor) structureSet.placement()).setSeparation(entry.separation); - if (!entry.activated) { - ((StructureSetAccessor) (Object) structureSet).setStructures(List.of()); - } - } + if (entry != null) { // id matches some structure in the config + if (structureSet.placement() instanceof ModStructurePlacement p) { + p.setSpacing(entry.spacing); + p.setSeparation(entry.separation); + p.setActivated(entry.activated); } - }); - - }); + } + })); } } diff --git a/src/main/java/io/github/frqnny/mostructures/init/Structures.java b/src/main/java/io/github/frqnny/mostructures/init/Structures.java index a68f952..5081604 100644 --- a/src/main/java/io/github/frqnny/mostructures/init/Structures.java +++ b/src/main/java/io/github/frqnny/mostructures/init/Structures.java @@ -2,22 +2,22 @@ import io.github.frqnny.mostructures.MoStructures; import io.github.frqnny.mostructures.structure.ModStructure; +import io.github.frqnny.mostructures.structure.ModStructurePlacement; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.tag.TagKey; -import net.minecraft.structure.StructurePieceType; +import net.minecraft.world.gen.chunk.placement.StructurePlacementType; import net.minecraft.world.gen.structure.Structure; import net.minecraft.world.gen.structure.StructureType; public class Structures { public static final StructureType GENERIC = () -> ModStructure.CODEC; public static final TagKey NO_LAKES = TagKey.of(RegistryKeys.STRUCTURE, MoStructures.id("no_lakes")); - public static StructurePieceType VOLCANIC_VENT_TYPE; + public static final StructurePlacementType TYPE = () -> ModStructurePlacement.CODEC; public static void init() { Registry.register(Registries.STRUCTURE_TYPE, MoStructures.id("generic"), GENERIC); - - + Registry.register(Registries.STRUCTURE_PLACEMENT, MoStructures.id("type"), TYPE); } } diff --git a/src/main/java/io/github/frqnny/mostructures/mixin/RandomSpreadStructurePlacementAccessor.java b/src/main/java/io/github/frqnny/mostructures/mixin/RandomSpreadStructurePlacementAccessor.java deleted file mode 100644 index 8ad3727..0000000 --- a/src/main/java/io/github/frqnny/mostructures/mixin/RandomSpreadStructurePlacementAccessor.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.github.frqnny.mostructures.mixin; - -import net.minecraft.world.gen.chunk.placement.RandomSpreadStructurePlacement; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.gen.Accessor; - -@Mixin(RandomSpreadStructurePlacement.class) -public interface RandomSpreadStructurePlacementAccessor { - @Mutable - @Accessor(value = "spacing") - void setSpacing(int spacing); - - @Mutable - @Accessor(value = "separation") - void setSeparation(int separation); - -} diff --git a/src/main/java/io/github/frqnny/mostructures/structure/ModStructure.java b/src/main/java/io/github/frqnny/mostructures/structure/ModStructure.java index 8c48285..fd9736a 100644 --- a/src/main/java/io/github/frqnny/mostructures/structure/ModStructure.java +++ b/src/main/java/io/github/frqnny/mostructures/structure/ModStructure.java @@ -2,6 +2,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import io.github.frqnny.mostructures.init.Structures; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.structure.pool.StructurePool; import net.minecraft.structure.pool.StructurePoolBasedGenerator; @@ -43,6 +44,7 @@ public class ModStructure extends Structure { private final int maxDistanceFromCenter; + public ModStructure(Structure.Config config, RegistryEntry startPool, Optional startJigsawName, int size, HeightProvider startHeight, boolean useExpansionHack, Optional projectStartToHeightmap, int maxDistanceFromCenter, int heightRange) { super(config); this.startPool = startPool; @@ -55,8 +57,9 @@ public ModStructure(Structure.Config config, RegistryEntry startP this.heightRange = heightRange; } + @Override public Optional getStructurePosition(Structure.Context context) { - if (canGenerate(context.chunkGenerator(), context.seed(), context.chunkPos(), context.world(), context.noiseConfig())) { + if (canGenerate(context.chunkGenerator(), context.chunkPos(), context.world(), context.noiseConfig())) { ChunkPos chunkPos = context.chunkPos(); int y = this.startHeight.get(context.random(), new HeightContext(context.chunkGenerator(), context.world())); BlockPos blockPos = new BlockPos(chunkPos.getStartX(), y, chunkPos.getStartZ()); @@ -66,8 +69,7 @@ public Optional getStructurePosition(Structure.Cont } } - public boolean canGenerate(ChunkGenerator chunkGenerator, long worldSeed, ChunkPos pos, HeightLimitView world, NoiseConfig noiseConfig) { - + public boolean canGenerate(ChunkGenerator chunkGenerator, ChunkPos pos, HeightLimitView world, NoiseConfig noiseConfig) { int heightRange = this.heightRange; if (heightRange != -1) { int maxTerrainHeight = Integer.MIN_VALUE; @@ -88,7 +90,7 @@ public boolean canGenerate(ChunkGenerator chunkGenerator, long worldSeed, ChunkP @Override public StructureType getType() { - return null;//todo + return Structures.GENERIC; } diff --git a/src/main/java/io/github/frqnny/mostructures/structure/ModStructurePlacement.java b/src/main/java/io/github/frqnny/mostructures/structure/ModStructurePlacement.java index 4551e4f..e295de9 100644 --- a/src/main/java/io/github/frqnny/mostructures/structure/ModStructurePlacement.java +++ b/src/main/java/io/github/frqnny/mostructures/structure/ModStructurePlacement.java @@ -2,6 +2,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import io.github.frqnny.mostructures.init.Structures; import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.entry.RegistryElementCodec; import net.minecraft.registry.entry.RegistryEntry; @@ -11,50 +12,60 @@ import net.minecraft.util.math.Vec3i; import net.minecraft.util.math.random.CheckedRandom; import net.minecraft.util.math.random.ChunkRandom; -import net.minecraft.world.gen.chunk.placement.SpreadType; -import net.minecraft.world.gen.chunk.placement.StructurePlacement; -import net.minecraft.world.gen.chunk.placement.StructurePlacementCalculator; -import net.minecraft.world.gen.chunk.placement.StructurePlacementType; +import net.minecraft.world.gen.chunk.placement.*; +import java.util.ArrayList; import java.util.List; import java.util.Optional; -public class ModStructurePlacement extends StructurePlacement { +public class ModStructurePlacement extends RandomSpreadStructurePlacement { public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( Vec3i.createOffsetCodec(16).optionalFieldOf("locate_offset", Vec3i.ZERO).forGetter(ModStructurePlacement::getLocateOffset), FrequencyReductionMethod.CODEC.optionalFieldOf("frequency_reduction_method", FrequencyReductionMethod.DEFAULT).forGetter(ModStructurePlacement::getFrequencyReductionMethod), Codec.floatRange(0.0f, 1.0f).optionalFieldOf("frequency", 1.0f).forGetter(ModStructurePlacement::getFrequency), Codecs.NONNEGATIVE_INT.fieldOf("salt").forGetter(ModStructurePlacement::getSalt), - ModExclusionZone.CODEC.listOf().optionalFieldOf("exclusion_zone").forGetter(placement -> placement.exclusionZones), + RegistryElementCodec.of(RegistryKeys.STRUCTURE_SET, StructureSet.CODEC, false).listOf().fieldOf("structure_set_to_avoid").orElse(new ArrayList<>(20)).forGetter(config -> config.structureSetToAvoid), Codec.intRange(0, 4096).fieldOf("spacing").forGetter(ModStructurePlacement::getSpacing), Codec.intRange(0, 4096).fieldOf("separation").forGetter(ModStructurePlacement::getSeparation), SpreadType.CODEC.optionalFieldOf("spread_type", SpreadType.LINEAR).forGetter(ModStructurePlacement::getSpreadType)) .apply(instance, ModStructurePlacement::new)); - private final Optional> exclusionZones; - private final int spacing; - private final int separation; + public final List> structureSetToAvoid; + private int spacing; + private int separation; private final SpreadType spreadType; + private boolean activated; - public ModStructurePlacement(Vec3i locateOffset, StructurePlacement.FrequencyReductionMethod frequencyReductionMethod, float frequency, int salt, Optional> exclusionZones, int spacing, int separation, SpreadType spreadType) { - super(locateOffset, frequencyReductionMethod, frequency, salt, Optional.empty()); + public ModStructurePlacement(Vec3i locateOffset, StructurePlacement.FrequencyReductionMethod frequencyReductionMethod, float frequency, int salt, List> structureSetToAvoid, int spacing, int separation, SpreadType spreadType) { + super(locateOffset, frequencyReductionMethod, frequency, salt, Optional.empty(), spacing, separation, spreadType); this.spacing = spacing; this.separation = separation; this.spreadType = spreadType; - this.exclusionZones = exclusionZones; + this.structureSetToAvoid = structureSetToAvoid; } - public ModStructurePlacement(int spacing, int separation, SpreadType spreadType, int salt) { - this(Vec3i.ZERO, StructurePlacement.FrequencyReductionMethod.DEFAULT, 1.0f, salt, Optional.empty(), spacing, separation, spreadType); + public void setActivated(boolean activated) { + this.activated = activated; } + @Override public int getSpacing() { return this.spacing; } + @Override public int getSeparation() { return this.separation; } + public void setSeparation(int separation) { + this.separation = separation; + } + + public void setSpacing(int spacing) { + this.spacing = spacing; + } + + @Override public SpreadType getSpreadType() { return this.spreadType; } @@ -78,6 +89,10 @@ protected boolean isStartChunk(StructurePlacementCalculator calculator, int chun @Override public boolean shouldGenerate(StructurePlacementCalculator calculator, int chunkX, int chunkZ) { + if (!activated) { + return false; + } + if (!this.isStartChunk(calculator, chunkX, chunkZ)) { return false; } @@ -85,32 +100,42 @@ public boolean shouldGenerate(StructurePlacementCalculator calculator, int chunk return false; } - if (exclusionZones.isPresent()) { - var list = exclusionZones.get(); - for (ModExclusionZone zone : list) { - if (zone.shouldExclude(calculator, chunkX, chunkZ)) { + if (!structureSetToAvoid.isEmpty()) { + for (RegistryEntry entry : structureSetToAvoid) { + if (shouldExclude(calculator, entry, chunkX, chunkZ, 3)) { return false; } } } + return true; } - @Override - public StructurePlacementType getType() { - return StructurePlacementType.RANDOM_SPREAD; + public boolean shouldGenerateNoExclusionCheck(StructurePlacementCalculator calculator, int chunkX, int chunkZ) { + if (!activated) { + return false; + } + if (!this.isStartChunk(calculator, chunkX, chunkZ)) { + return false; + } + return !(this.getFrequency() < 1.0f) || this.getFrequencyReductionMethod().shouldGenerate(calculator.getStructureSeed(), this.getSalt(), chunkX, chunkZ, this.getFrequency()); } + public static boolean shouldExclude(StructurePlacementCalculator calculator, RegistryEntry structureSetEntry, int centerChunkX, int centerChunkZ, int chunkCount) { + if (structureSetEntry.value().placement() instanceof ModStructurePlacement structurePlacement) { + for (int i = centerChunkX - chunkCount; i <= centerChunkX + chunkCount; ++i) { + for (int j = centerChunkZ - chunkCount; j <= centerChunkZ + chunkCount; ++j) { + if (!structurePlacement.shouldGenerateNoExclusionCheck(calculator, i, j)) continue; + return true; + } + } + } - public record ModExclusionZone(RegistryEntry otherSet, int chunkCount) { - public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( - RegistryElementCodec.of(RegistryKeys.STRUCTURE_SET, StructureSet.CODEC, false).fieldOf("other_set").forGetter(ModExclusionZone::otherSet), - Codec.intRange(1, 16).fieldOf("chunk_count").forGetter(ModExclusionZone::chunkCount)) - .apply(instance, ModExclusionZone::new) - ); + return false; + } - boolean shouldExclude(StructurePlacementCalculator calculator, int centerChunkX, int centerChunkZ) { - return calculator.canGenerate(this.otherSet, centerChunkX, centerChunkZ, this.chunkCount); - } + @Override + public StructurePlacementType getType() { + return Structures.TYPE; } } diff --git a/src/main/resources/data/mostructures/worldgen/structure/air_balloon.json b/src/main/resources/data/mostructures/worldgen/structure/air_balloon.json index d461c7e..e59576e 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/air_balloon.json +++ b/src/main/resources/data/mostructures/worldgen/structure/air_balloon.json @@ -1,9 +1,6 @@ { "type": "mostructures:generic", "start_pool": "mostructures:air/balloons", - "structure_set_to_avoid": [ - "mostructures:the_castle_in_the_sky" - ], "size": 7, "max_distance_from_center": 80, "step": "surface_structures", @@ -11,10 +8,10 @@ "start_height": { "type": "uniform", "min_inclusive": { - "above_bottom": 45 + "above_bottom": 105 }, "max_inclusive": { - "above_bottom": 100 + "above_bottom": 150 } }, "use_expansion_hack": false, diff --git a/src/main/resources/data/mostructures/worldgen/structure/barn_house.json b/src/main/resources/data/mostructures/worldgen/structure/barn_house.json index f0ac6e7..48beb68 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/barn_house.json +++ b/src/main/resources/data/mostructures/worldgen/structure/barn_house.json @@ -1,14 +1,7 @@ { "type": "mostructures:generic", "start_pool": "mostructures:barn_house/base_plates", - "structure_set_to_avoid": [ - "mostructures:abandoned_church", - "mostructures:killer_bunny_castle", - "mostructures:lighthouse", - "mostructures:moai", - "mostructures:tavern", - "mostructures:villager_market" - ], + "size": 7, "heightRange": 40, "biomes": "#mostructures:has_structure/barn_house", diff --git a/src/main/resources/data/mostructures/worldgen/structure/big_pyramid.json b/src/main/resources/data/mostructures/worldgen/structure/big_pyramid.json index d537e9d..aa3198e 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/big_pyramid.json +++ b/src/main/resources/data/mostructures/worldgen/structure/big_pyramid.json @@ -1,9 +1,6 @@ { "type": "mostructures:generic", "start_pool": "mostructures:pyramid/base", - "structure_set_to_avoid": [ - "mostructures:abandoned_church" - ], "size": 7, "heightRange": 40, "biomes": "#mostructures:has_structure/big_pyramid", diff --git a/src/main/resources/data/mostructures/worldgen/structure/desert_abandoned_church.json b/src/main/resources/data/mostructures/worldgen/structure/desert_abandoned_church.json index 3a163e5..030640f 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/desert_abandoned_church.json +++ b/src/main/resources/data/mostructures/worldgen/structure/desert_abandoned_church.json @@ -1,12 +1,6 @@ { "type": "mostructures:generic", "start_pool": "mostructures:abandoned/village/plates_desert", - "structure_set_to_avoid": [ - "mostructures:big_pyramid", - "mostructures:lighthouse", - "mostructures:moai", - "mostructures:villager_tower" - ], "size": 7, "heightRange": 40, "biomes": "#mostructures:has_structure/desert_abandoned_church", diff --git a/src/main/resources/data/mostructures/worldgen/structure/ice_tower.json b/src/main/resources/data/mostructures/worldgen/structure/ice_tower.json index 6c915d0..7f06c84 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/ice_tower.json +++ b/src/main/resources/data/mostructures/worldgen/structure/ice_tower.json @@ -1,12 +1,6 @@ { "type": "mostructures:generic", "start_pool": "mostructures:ice_tower/base", - "structure_set_to_avoid": [ - "mostructures:abandoned_church", - "mostructures:lighthouse", - "mostructures:moai", - "mostructures:villager_tower" - ], "size": 7, "heightRange": 40, "biomes": "#mostructures:has_structure/ice_tower", diff --git a/src/main/resources/data/mostructures/worldgen/structure/jungle_pyramid.json b/src/main/resources/data/mostructures/worldgen/structure/jungle_pyramid.json index 6ee67b5..23a1a7d 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/jungle_pyramid.json +++ b/src/main/resources/data/mostructures/worldgen/structure/jungle_pyramid.json @@ -1,7 +1,6 @@ { "type": "mostructures:generic", "start_pool": "mostructures:jungle_pyramid/base", - "structure_set_to_avoid": [], "size": 7, "heightRange": 40, "biomes": "#mostructures:has_structure/jungle_pyramid", diff --git a/src/main/resources/data/mostructures/worldgen/structure/killer_bunny_castle.json b/src/main/resources/data/mostructures/worldgen/structure/killer_bunny_castle.json index dac5e54..479d9c7 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/killer_bunny_castle.json +++ b/src/main/resources/data/mostructures/worldgen/structure/killer_bunny_castle.json @@ -1,18 +1,8 @@ { "type": "mostructures:generic", "start_pool": "mostructures:bunny/base", - "structure_set_to_avoid": [ - "mostructures:abandoned_church", - "mostructures:big_pyramid", - "mostructures:ice_tower", - "mostructures:jungle_pyramid", - "mostructures:lighthouse", - "mostructures:moai", - "mostructures:pillager_factory", - "mostructures:villager_tower" - ], "size": 7, - "heightRange": 40, + "heightRange": 20, "biomes": "#mostructures:has_structure/killer_bunny_castle", "use_expansion_hack": true, "terrain_adaptation": "beard_thin", diff --git a/src/main/resources/data/mostructures/worldgen/structure/lighthouse.json b/src/main/resources/data/mostructures/worldgen/structure/lighthouse.json index db2ea17..1d81844 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/lighthouse.json +++ b/src/main/resources/data/mostructures/worldgen/structure/lighthouse.json @@ -1,18 +1,7 @@ { "type": "mostructures:generic", "start_pool": "mostructures:lighthouse/towers", - "structure_set_to_avoid": [ - "mostructures:abandoned_church", - "mostructures:big_pyramid", - "mostructures:ice_tower", - "mostructures:jungle_pyramid", - "mostructures:killer_bunny_castle", - "mostructures:barn_house", - "mostructures:pillager_factory", - "mostructures:tavern", - "mostructures:villager_market", - "mostructures:villager_tower" - ], + "size": 7, "heightRange": 40, "max_distance_from_center": 80, diff --git a/src/main/resources/data/mostructures/worldgen/structure/moai.json b/src/main/resources/data/mostructures/worldgen/structure/moai.json index f646a30..f708b79 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/moai.json +++ b/src/main/resources/data/mostructures/worldgen/structure/moai.json @@ -1,25 +1,14 @@ { "type": "mostructures:generic", "start_pool": "mostructures:moai/moai", - "structure_set_to_avoid": [ - "mostructures:abandoned_church", - "mostructures:big_pyramid", - "mostructures:ice_tower", - "mostructures:jungle_pyramid", - "mostructures:killer_bunny_castle", - "mostructures:lighthouse", - "mostructures:barn_house", - "mostructures:pillager_factory", - "mostructures:tavern", - "mostructures:villager_market", - "mostructures:villager_tower" - ], + "size": 7, "heightRange": 40, "biomes": "#mostructures:has_structure/moai", "start_height": { - "below_top": 3 + "absolute": -3 }, + "project_start_to_heightmap": "WORLD_SURFACE_WG", "max_distance_from_center": 80, "step": "surface_structures", "use_expansion_hack": false, diff --git a/src/main/resources/data/mostructures/worldgen/structure/pillager_factory.json b/src/main/resources/data/mostructures/worldgen/structure/pillager_factory.json index 1b61d91..27c71b3 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/pillager_factory.json +++ b/src/main/resources/data/mostructures/worldgen/structure/pillager_factory.json @@ -1,15 +1,8 @@ { "type": "mostructures:generic", "start_pool": "mostructures:factory/base", - "structure_set_to_avoid": [ - "mostructures:ice_tower", - "mostructures:barn_house", - "mostructures:killer_bunny_castle", - "mostructures:lighthouse", - "mostructures:moai" - ], "size": 7, - "heightRange": 40, + "heightRange": 25, "biomes": "#mostructures:has_structure/pillager_factory", "use_expansion_hack": true, "terrain_adaptation": "beard_thin", diff --git a/src/main/resources/data/mostructures/worldgen/structure/tavern.json b/src/main/resources/data/mostructures/worldgen/structure/tavern.json index 52adf95..e516c34 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/tavern.json +++ b/src/main/resources/data/mostructures/worldgen/structure/tavern.json @@ -1,16 +1,6 @@ { "type": "mostructures:generic", "start_pool": "mostructures:tavern/base_plates", - "structure_set_to_avoid": [ - "mostructures:ice_tower", - "mostructures:killer_bunny_castle", - "mostructures:lighthouse", - "mostructures:moai", - "mostructures:pillager_factory", - "mostructures:barn_house", - "mostructures:villager_market", - "mostructures:villager_tower" - ], "size": 7, "heightRange": 40, "biomes": "#mostructures:has_structure/tavern", diff --git a/src/main/resources/data/mostructures/worldgen/structure/the_castle_in_the_sky.json b/src/main/resources/data/mostructures/worldgen/structure/the_castle_in_the_sky.json index 7be8138..d3c6ba7 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/the_castle_in_the_sky.json +++ b/src/main/resources/data/mostructures/worldgen/structure/the_castle_in_the_sky.json @@ -3,7 +3,13 @@ "biomes": "#mostructures:has_structure/the_castle_in_the_sky", "project_start_to_heightmap": "WORLD_SURFACE_WG", "start_height": { - "above_bottom": 35 + "type": "uniform", + "min_inclusive": { + "above_bottom": 90 + }, + "max_inclusive": { + "above_bottom": 120 + } }, "use_expansion_hack": false, "max_distance_from_center": 80, diff --git a/src/main/resources/data/mostructures/worldgen/structure/villager_market.json b/src/main/resources/data/mostructures/worldgen/structure/villager_market.json index 0057f9c..0415cc8 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/villager_market.json +++ b/src/main/resources/data/mostructures/worldgen/structure/villager_market.json @@ -1,13 +1,6 @@ { "type": "mostructures:generic", "start_pool": "mostructures:market/main", - "structure_set_to_avoid": [ - "mostructures:killer_bunny_castle", - "mostructures:lighthouse", - "mostructures:moai", - "mostructures:pillager_factory", - "mostructures:barn_house" - ], "size": 7, "heightRange": 40, "biomes": "#mostructures:has_structure/villager_market", diff --git a/src/main/resources/data/mostructures/worldgen/structure/villager_tower.json b/src/main/resources/data/mostructures/worldgen/structure/villager_tower.json index 40e27a2..78b0227 100644 --- a/src/main/resources/data/mostructures/worldgen/structure/villager_tower.json +++ b/src/main/resources/data/mostructures/worldgen/structure/villager_tower.json @@ -1,15 +1,6 @@ { "type": "mostructures:generic", "start_pool": "mostructures:villager/tower_plates", - "structure_set_to_avoid": [ - "mostructures:abandoned_church", - "mostructures:killer_bunny_castle", - "mostructures:lighthouse", - "mostructures:moai", - "mostructures:pillager_factory", - "mostructures:villager_market", - "mostructures:barn_house" - ], "size": 7, "heightRange": 40, "biomes": "#mostructures:has_structure/villager_tower", diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/abandoned_church.json b/src/main/resources/data/mostructures/worldgen/structure_set/abandoned_church.json index 11295ac..b470347 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/abandoned_church.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/abandoned_church.json @@ -22,7 +22,8 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [], "spacing": 26, "separation": 14, "salt": 16996840 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/air_balloon.json b/src/main/resources/data/mostructures/worldgen/structure_set/air_balloon.json index 21442a9..294bf8e 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/air_balloon.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/air_balloon.json @@ -6,7 +6,11 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [ + "mostructures:the_castle_in_the_sky", + "mostructures:moai" + ], "spacing": 20, "separation": 10, "salt": 19483148 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/barn_house.json b/src/main/resources/data/mostructures/worldgen/structure_set/barn_house.json index 9014361..dba578c 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/barn_house.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/barn_house.json @@ -6,7 +6,12 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [ + "mostructures:abandoned_church", + "mostructures:killer_bunny_castle", + "mostructures:villager_market" + ], "spacing": 24, "separation": 13, "salt": 265757306 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/big_pyramid.json b/src/main/resources/data/mostructures/worldgen/structure_set/big_pyramid.json index 22fb997..0af0b48 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/big_pyramid.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/big_pyramid.json @@ -6,7 +6,10 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [ + "mostructures:abandoned_church" + ], "spacing": 20, "separation": 16, "salt": 139284294 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/ice_tower.json b/src/main/resources/data/mostructures/worldgen/structure_set/ice_tower.json index a446e94..15f1753 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/ice_tower.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/ice_tower.json @@ -6,7 +6,13 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [ + "mostructures:abandoned_church", + "mostructures:lighthouse", + "mostructures:moai", + "mostructures:villager_tower" + ], "spacing": 22, "separation": 14, "salt": 964058305 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/jungle_pyramid.json b/src/main/resources/data/mostructures/worldgen/structure_set/jungle_pyramid.json index ddf4a47..e12d344 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/jungle_pyramid.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/jungle_pyramid.json @@ -6,7 +6,8 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [], "spacing": 16, "separation": 14, "salt": 112178642 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/killer_bunny_castle.json b/src/main/resources/data/mostructures/worldgen/structure_set/killer_bunny_castle.json index a542d80..7f95e1a 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/killer_bunny_castle.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/killer_bunny_castle.json @@ -6,7 +6,17 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [ + "mostructures:abandoned_church", + "mostructures:big_pyramid", + "mostructures:ice_tower", + "mostructures:jungle_pyramid", + "mostructures:lighthouse", + "mostructures:moai", + "mostructures:pillager_factory", + "mostructures:villager_tower" + ], "spacing": 30, "separation": 22, "salt": 181239001 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/lighthouse.json b/src/main/resources/data/mostructures/worldgen/structure_set/lighthouse.json index d809543..e228b20 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/lighthouse.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/lighthouse.json @@ -6,7 +6,19 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [ + "mostructures:abandoned_church", + "mostructures:big_pyramid", + "mostructures:ice_tower", + "mostructures:jungle_pyramid", + "mostructures:killer_bunny_castle", + "mostructures:barn_house", + "mostructures:pillager_factory", + "mostructures:tavern", + "mostructures:villager_market", + "mostructures:villager_tower" + ], "spacing": 24, "separation": 14, "salt": 19502322 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/moai.json b/src/main/resources/data/mostructures/worldgen/structure_set/moai.json index 5989bab..86843e0 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/moai.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/moai.json @@ -6,7 +6,20 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [ + "mostructures:abandoned_church", + "mostructures:big_pyramid", + "mostructures:ice_tower", + "mostructures:jungle_pyramid", + "mostructures:killer_bunny_castle", + "mostructures:lighthouse", + "mostructures:barn_house", + "mostructures:pillager_factory", + "mostructures:tavern", + "mostructures:villager_market", + "mostructures:villager_tower" + ], "spacing": 17, "separation": 15, "salt": 12994829 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/pillager_factory.json b/src/main/resources/data/mostructures/worldgen/structure_set/pillager_factory.json index ac89c8c..45a236c 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/pillager_factory.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/pillager_factory.json @@ -6,7 +6,14 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [ + "mostructures:ice_tower", + "mostructures:barn_house", + "mostructures:killer_bunny_castle", + "mostructures:lighthouse", + "mostructures:moai" + ], "spacing": 30, "separation": 14, "salt": 139204924 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/pirate_ship.json b/src/main/resources/data/mostructures/worldgen/structure_set/pirate_ship.json index c2ffd03..98e3532 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/pirate_ship.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/pirate_ship.json @@ -6,7 +6,8 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [], "spacing": 32, "separation": 14, "salt": 583957395 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/tavern.json b/src/main/resources/data/mostructures/worldgen/structure_set/tavern.json index 00e9803..4185dbb 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/tavern.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/tavern.json @@ -6,7 +6,17 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [ + "mostructures:ice_tower", + "mostructures:killer_bunny_castle", + "mostructures:lighthouse", + "mostructures:moai", + "mostructures:pillager_factory", + "mostructures:barn_house", + "mostructures:villager_market", + "mostructures:villager_tower" + ], "spacing": 30, "separation": 13, "salt": 19296726 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/the_castle_in_the_sky.json b/src/main/resources/data/mostructures/worldgen/structure_set/the_castle_in_the_sky.json index ac29567..695d7a6 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/the_castle_in_the_sky.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/the_castle_in_the_sky.json @@ -6,7 +6,8 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [], "spacing": 23, "separation": 15, "salt": 423494938 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/villager_market.json b/src/main/resources/data/mostructures/worldgen/structure_set/villager_market.json index 8fd71a8..0b6c425 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/villager_market.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/villager_market.json @@ -6,7 +6,14 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [ + "mostructures:killer_bunny_castle", + "mostructures:lighthouse", + "mostructures:moai", + "mostructures:pillager_factory", + "mostructures:barn_house" + ], "spacing": 30, "separation": 16, "salt": 184939542 diff --git a/src/main/resources/data/mostructures/worldgen/structure_set/villager_tower.json b/src/main/resources/data/mostructures/worldgen/structure_set/villager_tower.json index 859203a..61e4798 100644 --- a/src/main/resources/data/mostructures/worldgen/structure_set/villager_tower.json +++ b/src/main/resources/data/mostructures/worldgen/structure_set/villager_tower.json @@ -6,7 +6,16 @@ } ], "placement": { - "type": "minecraft:random_spread", + "type": "mostructures:type", + "structure_set_to_avoid": [ + "mostructures:abandoned_church", + "mostructures:killer_bunny_castle", + "mostructures:lighthouse", + "mostructures:moai", + "mostructures:pillager_factory", + "mostructures:villager_market", + "mostructures:barn_house" + ], "spacing": 29, "separation": 16, "salt": 150292492 diff --git a/src/main/resources/data/mostructures/worldgen/template_pool/market/main.json b/src/main/resources/data/mostructures/worldgen/template_pool/market/main.json index b5ca968..f569388 100644 --- a/src/main/resources/data/mostructures/worldgen/template_pool/market/main.json +++ b/src/main/resources/data/mostructures/worldgen/template_pool/market/main.json @@ -3,7 +3,7 @@ "fallback": "minecraft:empty", "elements": [ { - "weight": 1, + "weight": 3, "element": { "element_type": "minecraft:legacy_single_pool_element", "location": "mostructures:market/main_1", @@ -12,7 +12,7 @@ } }, { - "weight": 1, + "weight": 2, "element": { "element_type": "minecraft:legacy_single_pool_element", "location": "mostructures:market/main_2", diff --git a/src/main/resources/mostructures.mixins.json b/src/main/resources/mostructures.mixins.json index d23a6f7..32a16c6 100644 --- a/src/main/resources/mostructures.mixins.json +++ b/src/main/resources/mostructures.mixins.json @@ -7,7 +7,6 @@ "MixinMobEntity", "MixinLivingEntity", "ChunkRegionAccessor", - "RandomSpreadStructurePlacementAccessor", "StructurePlacementAccessor", "StructureSetAccessor" ],