mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 8c74d3126 Updated Upstream (Bukkit) (#5359) fd3c66a91 bug #5362 - correctly pass "render type" when registering a new scoreboard objective 39c487b37 Add per-command perms for paper command cdbf2578c Add Item Rarity API (#5352) d80e43647 [CI-SKIP] Removal from the MIT list (#5345) Tuinity Changes: aea6b8347 Merge dev/playerchunkloading 722c7ca8a Use hash table for maintaing changed block set 98ae59d85 Custom table implementation for blockstate state lookups 8b8704fb6 Oprimise map impl for tracked players ea71d6ba4 Optimise snow & ice in chunk ticking 9871d4ce5 Remove chunk lookup & lambda allocation from counting mobs 5a4a35f3e Add patreon 7d93d9618 Refactor data management for region manager c3035219f Change license from MIT to LGPLv3 Airplane Changes: 580f380b6 Updated Upstream (Tuinity) 82253fd36 Early return optimization for target finding 9572643bb Cache entityhuman display name 5df98254f Remove iterators from inventory contains 18d2be193 Merge pull request #14 from violetwtf/patch-1 f716d4c33 Merge pull request #13 from violetwtf/master 128cbe519 Reduce entity chunk ticking checks from 3 to 1 03ac0933b Skip copying unloading tile entities 97dd027b5 Smaller pool size for tracking 9e9f57be4 Only set up Flare if token is available
93 lines
5.0 KiB
Diff
93 lines
5.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
Date: Sat, 18 Jul 2020 11:27:43 -0500
|
|
Subject: [PATCH] Populator seed controls
|
|
|
|
|
|
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
|
index 5e672a0660d0aceffcdb26d185590ca18aa4f023..4b171a2a60e24947e884f8988920f335bd99a471 100644
|
|
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
|
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
|
@@ -293,7 +293,7 @@ public class TimingsExport extends Thread {
|
|
JSONObject object = new JSONObject();
|
|
for (String key : config.getKeys(false)) {
|
|
String fullKey = (parentKey != null ? parentKey + "." + key : key);
|
|
- if (fullKey.equals("database") || fullKey.equals("settings.bungeecord-addresses") || TimingsManager.hiddenConfigs.contains(fullKey) || key.startsWith("seed-") || key.equals("worldeditregentempworld")) {
|
|
+ if (fullKey.equals("database") || fullKey.equals("settings.bungeecord-addresses") || TimingsManager.hiddenConfigs.contains(fullKey) || key.startsWith("seed-") || key.equals("worldeditregentempworld") || fullKey.contains("worldgen.seeds.populator")) { // Tuinity
|
|
continue;
|
|
}
|
|
final Object val = config.get(key);
|
|
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
|
index d1308b8cbb9490f1ccdc5514763e62bc5d66981b..f11d07f6e388dedc318868ffa95e80ae2d89119e 100644
|
|
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
|
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
|
@@ -1,5 +1,6 @@
|
|
package com.tuinity.tuinity.config;
|
|
|
|
+import co.aikar.timings.TimingsManager;
|
|
import com.destroystokyo.paper.util.SneakyThrow;
|
|
import net.minecraft.server.MinecraftServer;
|
|
import net.minecraft.server.TicketType;
|
|
@@ -401,6 +402,19 @@ public final class TuinityConfig {
|
|
this.spawnLimitAmbient = this.getInt(path + ".ambient", -1);
|
|
}
|
|
|
|
+ public Long populatorSeed;
|
|
+ public boolean useRandomPopulatorSeed;
|
|
+
|
|
+ private void populatorSeed() {
|
|
+ final String seedString = this.getString("worldgen.seeds.populator", "default");
|
|
+ if (seedString.equalsIgnoreCase("random")) {
|
|
+ this.useRandomPopulatorSeed = true;
|
|
+ } else if (!seedString.equalsIgnoreCase("default")) {
|
|
+ this.populatorSeed = Long.parseLong(seedString);
|
|
+ }
|
|
+ if (!TimingsManager.hiddenConfigs.contains("worldgen.seeds.populator")) TimingsManager.hiddenConfigs.add("worldgen.seeds.populator");
|
|
+ }
|
|
+
|
|
}
|
|
|
|
}
|
|
\ No newline at end of file
|
|
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
|
|
index 3fc101552e3c229076c91a1cfa45206b4cc7a04c..60d5c08706dc8b2f895ff7083d3a611a73ac19d2 100644
|
|
--- a/src/main/java/net/minecraft/server/BiomeBase.java
|
|
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
|
|
@@ -227,6 +227,10 @@ public final class BiomeBase {
|
|
return this.k;
|
|
}
|
|
|
|
+ // Tuinity start - populator seed control
|
|
+ private static final java.security.SecureRandom SECURE_RANDOM = new java.security.SecureRandom();
|
|
+ // Tuinity end - populator seed control
|
|
+
|
|
public void a(StructureManager structuremanager, ChunkGenerator chunkgenerator, RegionLimitedWorldAccess regionlimitedworldaccess, long i, SeededRandom seededrandom, BlockPosition blockposition) {
|
|
List<List<Supplier<WorldGenFeatureConfigured<?, ?>>>> list = this.k.c();
|
|
int j = WorldGenStage.Decoration.values().length;
|
|
@@ -263,12 +267,24 @@ public final class BiomeBase {
|
|
}
|
|
}
|
|
|
|
+ // Tuinity start - populator seed control
|
|
+ long populatorSeed;
|
|
+ WorldServer world = (WorldServer)((ChunkProviderServer)regionlimitedworldaccess.getChunkProvider()).getWorld();
|
|
+ if (world.tuinityConfig.useRandomPopulatorSeed) {
|
|
+ populatorSeed = SECURE_RANDOM.nextLong();
|
|
+ } else if (world.tuinityConfig.populatorSeed != null) {
|
|
+ populatorSeed = world.tuinityConfig.populatorSeed.longValue();
|
|
+ } else {
|
|
+ populatorSeed = i;
|
|
+ }
|
|
+ // Tuinity end - populator seed control
|
|
+
|
|
if (list.size() > k) {
|
|
for (Iterator iterator1 = ((List) list.get(k)).iterator(); iterator1.hasNext(); ++l) {
|
|
Supplier<WorldGenFeatureConfigured<?, ?>> supplier = (Supplier) iterator1.next();
|
|
WorldGenFeatureConfigured<?, ?> worldgenfeatureconfigured = (WorldGenFeatureConfigured) supplier.get();
|
|
|
|
- seededrandom.b(i, l, k);
|
|
+ seededrandom.b(populatorSeed, l, k); // Tuinity - populator seed control - move i up into default branch
|
|
|
|
try {
|
|
worldgenfeatureconfigured.a(regionlimitedworldaccess, chunkgenerator, seededrandom, blockposition);
|