mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: 821ce25d9 Significantly improve performance of the end generation 2b2e4fd65 Add Wandering Trader spawn rate config options 7263cbca7 [CI-SKIP] [Auto] Rebuild Patches 1c63aff6d Villager resetOffers API 8d8d74a5f Patch 2 references an invalid variable e6d7bdca1 [CI-SKIP] fixed sed -i for bsd sed (#4782) 7ae47d4eb [CI-SKIP] Remove Waving banner fix (#4786)
This commit is contained in:
@@ -1,92 +0,0 @@
|
||||
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 dae2e5d70..55b67f105 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 42ce3b802..03e4d9d8b 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;
|
||||
@@ -376,6 +377,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 0854ac9ef..df6874c1c 100644
|
||||
--- a/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
@@ -189,6 +189,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;
|
||||
@@ -225,12 +229,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);
|
||||
Reference in New Issue
Block a user