2022-03-01 02:08:53 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
Date: Thu, 13 Jan 2022 23:05:53 -0800
|
|
|
|
Subject: [PATCH] Add config for stronghold seed
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
2022-06-10 16:11:41 +02:00
|
|
|
index ef53c68c1996e99bc6b6048d5b1bc290cf218158..cdfe2589ca598263d58a11a978e176ab3ecb87e6 100644
|
2022-03-01 02:08:53 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
2022-06-08 15:12:28 +02:00
|
|
|
@@ -236,7 +236,13 @@ public abstract class ChunkGenerator {
|
|
|
|
HolderSet<Biome> holderset = concentricringsstructureplacement.preferredBiomes();
|
|
|
|
RandomSource randomsource = RandomSource.create();
|
2022-03-01 02:08:53 +01:00
|
|
|
|
|
|
|
+ // Paper start
|
2022-04-16 10:29:50 +02:00
|
|
|
+ if (this.conf.strongholdSeed != null && this.structureSets.getResourceKey(holder).orElse(null) == net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS) {
|
2022-06-08 15:12:28 +02:00
|
|
|
+ randomsource.setSeed(this.conf.strongholdSeed);
|
2022-03-01 02:08:53 +01:00
|
|
|
+ } else {
|
2022-06-08 15:12:28 +02:00
|
|
|
randomsource.setSeed(this instanceof FlatLevelSource ? 0L : randomstate.legacyLevelSeed());
|
|
|
|
+ }
|
2022-03-01 02:08:53 +01:00
|
|
|
+ // Paper end
|
2022-06-08 15:12:28 +02:00
|
|
|
double d0 = randomsource.nextDouble() * 3.141592653589793D * 2.0D;
|
2022-03-01 02:08:53 +01:00
|
|
|
int l = 0;
|
|
|
|
int i1 = 0;
|
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2022-06-13 18:06:25 +02:00
|
|
|
index cf96f9fdc4ae561f01d44503b9851c60140e4ea7..bbf15fbb889670e57bd86377590a1b3abe80b96d 100644
|
2022-03-01 02:08:53 +01:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2022-06-13 18:06:25 +02:00
|
|
|
@@ -366,6 +366,7 @@ public class SpigotWorldConfig
|
2022-03-01 02:08:53 +01:00
|
|
|
public int mansionSeed;
|
|
|
|
public int fossilSeed;
|
|
|
|
public int portalSeed;
|
|
|
|
+ public Long strongholdSeed; // Paper
|
|
|
|
private void initWorldGenSeeds()
|
|
|
|
{
|
|
|
|
this.villageSeed = this.getInt( "seed-village", 10387312 );
|
2022-06-13 18:06:25 +02:00
|
|
|
@@ -383,6 +384,10 @@ public class SpigotWorldConfig
|
2022-03-01 02:08:53 +01:00
|
|
|
this.mansionSeed = this.getInt( "seed-mansion", 10387319 );
|
|
|
|
this.fossilSeed = this.getInt( "seed-fossil", 14357921 );
|
|
|
|
this.portalSeed = this.getInt( "seed-portal", 34222645 );
|
|
|
|
+ // Paper start
|
|
|
|
+ final String strongholdSeedString = this.getString("seed-stronghold", "default");
|
|
|
|
+ this.strongholdSeed = org.apache.commons.lang3.math.NumberUtils.isParsable(strongholdSeedString) ? Long.parseLong(strongholdSeedString) : null;
|
|
|
|
+ // Paper end
|
|
|
|
this.log( "Custom Map Seeds: Village: " + this.villageSeed + " Desert: " + this.desertSeed + " Igloo: " + this.iglooSeed + " Jungle: " + this.jungleSeed + " Swamp: " + this.swampSeed + " Monument: " + this.monumentSeed
|
|
|
|
+ " Ocean: " + this.oceanSeed + " Shipwreck: " + this.shipwreckSeed + " End City: " + this.endCitySeed + " Slime: " + this.slimeSeed + " Nether: " + this.netherSeed + " Mansion: " + this.mansionSeed + " Fossil: " + this.fossilSeed + " Portal: " + this.portalSeed );
|
|
|
|
}
|