From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Wed, 15 Jul 2020 11:49:36 -0500
Subject: [PATCH] Configurable end spike seed


diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenEnder.java b/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenEnder.java
index dd623702131eaa1a65937a19a0e986e865322258..54ac8444702c3cfc2bcbaa6c8bc40398fd8eedb7 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenEnder.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenEnder.java
@@ -36,12 +36,14 @@ public class WorldGenEnder extends WorldGenerator<WorldGenFeatureEndSpikeConfigu
     }
 
     public static List<WorldGenEnder.Spike> a(GeneratorAccessSeed generatoraccessseed) {
-        Random random = new Random(generatoraccessseed.getSeed());
+        int seed = net.pl3x.purpur.PurpurConfig.endSpikeSeed; // Purpur
+        Random random = new Random(seed == -1 ? generatoraccessseed.getSeed() : seed); // Purpur
         long i = random.nextLong() & 65535L;
 
         return (List) WorldGenEnder.a.getUnchecked(i);
     }
 
+    public boolean generate(GeneratorAccessSeed generatoraccessseed, ChunkGenerator chunkgenerator, Random random, BlockPosition blockposition, WorldGenFeatureEndSpikeConfiguration worldgenfeatureendspikeconfiguration) { return a(generatoraccessseed, chunkgenerator, random, blockposition, worldgenfeatureendspikeconfiguration); } // Purpur - decompile error?
     public boolean a(GeneratorAccessSeed generatoraccessseed, ChunkGenerator chunkgenerator, Random random, BlockPosition blockposition, WorldGenFeatureEndSpikeConfiguration worldgenfeatureendspikeconfiguration) {
         List<WorldGenEnder.Spike> list = worldgenfeatureendspikeconfiguration.c();
 
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index f1e57b679db156b4013f6bc81925462a746001f2..e9257f76275774518bb1fefe3b78144fd93791ab 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -1,5 +1,6 @@
 package net.pl3x.purpur;
 
+import co.aikar.timings.TimingsManager;
 import com.google.common.base.Throwables;
 import net.minecraft.locale.LocaleLanguage;
 import net.minecraft.server.MinecraftServer;
@@ -141,6 +142,13 @@ public class PurpurConfig {
         pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput);
     }
 
+    public static int endSpikeSeed = -1;
+    private static void seedSettings() {
+        endSpikeSeed = getInt("settings.seed.end-spike", endSpikeSeed);
+        if (!TimingsManager.hiddenConfigs.contains("settings.seed")) TimingsManager.hiddenConfigs.add("settings.seed");
+        if (!TimingsManager.hiddenConfigs.contains("settings.seed.end-spike")) TimingsManager.hiddenConfigs.add("settings.seed.end-spike");
+    }
+
     public static String serverModName = "Purpur";
     private static void serverModName() {
         serverModName = getString("settings.server-mod-name", serverModName);
