mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: 0514fc4e2 Add missing effects 8f5d9effd Add getMainThreadExecutor to BukkitScheduler 313b5020b Allow adding items to BlockDropItemEvent (#5093) 9a556d9da [CI-SKIP] [Auto] Rebuild Patches 72b2768ad Inline shift fields in EnumDirection (#5082) ffff53fa7 added option to disable pathfinding updates on block changes (#5123) b67081fd7 add DragonEggFormEvent (fixes #5110) (#5112) 3eefafbaf Fix javadoc build 0081ed1c4 Add javadoc step to GH Actions 01082503e Add dropLeash variable to EntityUnleashEvent (#5130) 31f9f869a [CI-SKIP] Fix YourKit links in readme, fixes #5091 8ac27aa38 [Auto] Updated Upstream (CraftBukkit) c4d9cc831 [Auto] Updated Upstream (Bukkit/CraftBukkit) d0477d326 [Auto] Updated Upstream (CraftBukkit) d9f5f7018 EntityMoveEvent (#4614)
This commit is contained in:
92
patches/server/0096-Populator-seed-controls.patch
Normal file
92
patches/server/0096-Populator-seed-controls.patch
Normal file
@@ -0,0 +1,92 @@
|
||||
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 dae2e5d70756c5b61163d57099b65f7e415b288c..55b67f1057224101272f9d6023a93872c4423405 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 42ce3b80217b574a1852e12f500b366a912e23e2..03e4d9d8bd29587492afbaab9400f3ae1e5e6dea 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 0854ac9ef586b378420d9899f3afd2755e6f9f33..df6874c1cf5fc5764dc575866aab87883b6cf035 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