mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
44 lines
2.3 KiB
Diff
44 lines
2.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Wed, 15 Jul 2020 12:40:25 -0500
|
|
Subject: [PATCH] Configurable dungeon seed
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/WorldGenDecoratorDungeon.java b/src/main/java/net/minecraft/server/WorldGenDecoratorDungeon.java
|
|
index 70d2229960..cfdb2bf4da 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldGenDecoratorDungeon.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldGenDecoratorDungeon.java
|
|
@@ -14,10 +14,12 @@ public class WorldGenDecoratorDungeon extends WorldGenDecorator<WorldGenDecorato
|
|
public Stream<BlockPosition> a(GeneratorAccess generatoraccess, ChunkGenerator chunkgenerator, Random random, WorldGenDecoratorDungeonConfiguration worldgendecoratordungeonconfiguration, BlockPosition blockposition) {
|
|
int i = worldgendecoratordungeonconfiguration.b;
|
|
|
|
+ int seed = net.pl3x.purpur.PurpurConfig.endSpikeSeed; // Purpur
|
|
+ final Random rand = seed == -1 ? random : new Random(seed); // Purpur
|
|
return IntStream.range(0, i).mapToObj((j) -> {
|
|
- int k = random.nextInt(16) + blockposition.getX();
|
|
- int l = random.nextInt(16) + blockposition.getZ();
|
|
- int i1 = random.nextInt(chunkgenerator.getGenerationDepth());
|
|
+ int k = rand.nextInt(16) + blockposition.getX(); // Purpur
|
|
+ int l = rand.nextInt(16) + blockposition.getZ(); // Purpur
|
|
+ int i1 = rand.nextInt(chunkgenerator.getGenerationDepth()); // Purpur
|
|
|
|
return new BlockPosition(k, i1, l);
|
|
});
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
index a4fd1dff61..cd524cabcd 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -141,9 +141,11 @@ public class PurpurConfig {
|
|
pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput);
|
|
cannotRideMob = getString("settings.messages.cannot-ride-mob", cannotRideMob);
|
|
}
|
|
-
|
|
+
|
|
+ public static int dungeonSeed = -1;
|
|
public static int endSpikeSeed = -1;
|
|
private static void seedSettings() {
|
|
+ dungeonSeed = getInt("settings.seed.dungeon", dungeonSeed);
|
|
endSpikeSeed = getInt("settings.seed.end-spike", endSpikeSeed);
|
|
}
|
|
|