Files
Purpur/patches/server/0215-Populator-seed-controls.patch
William Blake Galbreath 31306b4b0e Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
b79bc31 Fix MerchantOffer BuyB Only AssertionError (#6206)
d6c81c8 Don't apply cramming damage to players (#5903)
12942dc Add rate options and timings for sensors and behaviors (#6027)
fc47872 Use mapped names for sensor and behavior timings/config (#6228)
c75a837 Don't expose ASM in API (#6229)
c225bf9 Fix book title and author being improperly serialized as components (#6190)
f25facb Update email & name (DenWav)
44516b1 [ci skip] Put mappings util in a separate class to the stacktrace deobfuscator
2021-07-21 10:49:20 -05:00

55 lines
3.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Fri, 25 Jun 2021 18:23:36 -0400
Subject: [PATCH] Populator seed controls
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
index a7a7e6cd87270e64a92448f03f8b0b0c7e375ec7..9fb19162c0e436122087d03d37b502a19b31cb9e 100644
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java
@@ -219,6 +219,7 @@ public final class Biome {
return this.generationSettings;
}
+ private static final java.security.SecureRandom SECURE_RANDOM = new java.security.SecureRandom(); // Purpur
public void generate(StructureFeatureManager structureAccessor, ChunkGenerator chunkGenerator, WorldGenRegion region, long populationSeed, WorldgenRandom random, BlockPos origin) {
List<List<Supplier<ConfiguredFeature<?, ?>>>> list = this.generationSettings.features();
Registry<ConfiguredFeature<?, ?>> registry = region.registryAccess().registryOrThrow(Registry.CONFIGURED_FEATURE_REGISTRY);
@@ -257,13 +258,20 @@ public final class Biome {
}
}
+ // Purpur start
+ long populatorSeed = populationSeed;
+ if (((net.minecraft.server.level.ServerChunkCache) region.getChunkSource()).getLevel().purpurConfig.randomPopulatorSeed) {
+ populatorSeed = SECURE_RANDOM.nextLong();
+ }
+ // Purpur end
+
if (list.size() > j) {
for(Supplier<ConfiguredFeature<?, ?>> supplier2 : list.get(j)) {
ConfiguredFeature<?, ?> configuredFeature = supplier2.get();
Supplier<String> supplier3 = () -> {
return registry.getResourceKey(configuredFeature).map(Object::toString).orElseGet(configuredFeature::toString);
};
- random.setFeatureSeed(populationSeed, k, j);
+ random.setFeatureSeed(populatorSeed, k, j); // Purpur
try {
region.setCurrentlyGenerating(supplier3);
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index faca09270c21c6312064f2176ceb740457da9628..3c5c9d66ff9bda8d6abfdabd86929fd5a12b701c 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -2258,4 +2258,9 @@ public class PurpurWorldConfig {
zombifiedPiglinJockeyTryExistingChickens = getBoolean("mobs.zombified_piglin.jockey.try-existing-chickens", zombifiedPiglinJockeyTryExistingChickens);
zombifiedPiglinCountAsPlayerKillWhenAngry = getBoolean("mobs.zombified_piglin.count-as-player-kill-when-angry", zombifiedPiglinCountAsPlayerKillWhenAngry);
}
+
+ public boolean randomPopulatorSeed = false;
+ private void seedSettings() {
+ randomPopulatorSeed = getBoolean("seed.random-populator-seed", randomPopulatorSeed);
+ }
}