Readd configurable feature seed patch

This commit is contained in:
Nassim Jahnke 2021-11-25 13:05:53 +01:00
parent caec3ad3b2
commit d1eb5f28fd

View File

@ -78,34 +78,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public int getBehaviorTickRate(String typeName, String entityType, int def) { public int getBehaviorTickRate(String typeName, String entityType, int def) {
return getIntOrDefault(behaviorTickRates, typeName, entityType, def); return getIntOrDefault(behaviorTickRates, typeName, entityType, def);
} }
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -0,0 +0,0 @@ public final class Biome { @@ -0,0 +0,0 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource {
public void generate(StructureFeatureManager structureAccessor, ChunkGenerator chunkGenerator, WorldGenRegion region, long populationSeed, WorldgenRandom random, BlockPos origin) { try {
List<List<Supplier<ConfiguredFeature<?, ?>>>> list = this.generationSettings.features(); Registry<PlacedFeature> iregistry = generatoraccessseed.registryAccess().registryOrThrow(Registry.PLACED_FEATURE_REGISTRY);
- Registry<ConfiguredFeature<?, ?>> registry = region.registryAccess().registryOrThrow(Registry.CONFIGURED_FEATURE_REGISTRY); - Registry<StructureFeature<?>> iregistry1 = generatoraccessseed.registryAccess().registryOrThrow(Registry.STRUCTURE_FEATURE_REGISTRY);
+ Registry<ConfiguredFeature<?, ?>> registry = region.registryAccess().registryOrThrow(Registry.CONFIGURED_FEATURE_REGISTRY); // Paper - diff on change + Registry<StructureFeature<?>> iregistry1 = generatoraccessseed.registryAccess().registryOrThrow(Registry.STRUCTURE_FEATURE_REGISTRY); // Paper - diff on change
Registry<StructureFeature<?>> registry2 = region.registryAccess().registryOrThrow(Registry.STRUCTURE_FEATURE_REGISTRY); int k = Math.max(GenerationStep.Decoration.values().length, j);
int i = GenerationStep.Decoration.values().length;
@@ -0,0 +0,0 @@ public final class Biome { for (int l = 0; l < k; ++l) {
Supplier<String> supplier3 = () -> { @@ -0,0 +0,0 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource {
return registry.getResourceKey(configuredFeature).map(Object::toString).orElseGet(configuredFeature::toString); for (iterator = list1.iterator(); iterator.hasNext(); ++i1) {
}; StructureFeature<?> structuregenerator = (StructureFeature) iterator.next();
- random.setFeatureSeed(populationSeed, k, j);
+ // Paper start - change populationSeed used in random - seededrandom.setFeatureSeed(i, i1, l);
+ long featurePopulationSeed = populationSeed; + // Paper start - change populationSeed used in random
+ final ResourceLocation location = registry.getKey(configuredFeature); + long featurePopulationSeed = i;
+ final long configFeatureSeed = region.getMinecraftWorld().paperConfig.featureSeeds.getLong(location); + final net.minecraft.resources.ResourceLocation location = iregistry1.getKey(structuregenerator);
+ if (configFeatureSeed != -1) { + final long configFeatureSeed = generatoraccessseed.getMinecraftWorld().paperConfig.featureSeeds.getLong(location);
+ final ChunkPos center = region.getCenter(); + if (configFeatureSeed != -1) {
+ featurePopulationSeed = random.setDecorationSeed(configFeatureSeed, center.getMinBlockX(), center.getMinBlockZ()); // See ChunkGenerator#addVanillaDecorations + featurePopulationSeed = seededrandom.setDecorationSeed(configFeatureSeed, blockposition.getX(), blockposition.getZ()); // See seededrandom.setDecorationSeed from above
+ } + }
+ random.setFeatureSeed(featurePopulationSeed, k, j); + seededrandom.setFeatureSeed(featurePopulationSeed, i1, l);;
+ // Paper end + // Paper end
Supplier<String> supplier = () -> { // CraftBukkit - decompile error
Optional optional = iregistry1.getResourceKey(structuregenerator).map(Object::toString);
try {
region.setCurrentlyGenerating(supplier3);