From 9da236fe6a5f9bc3d078ae384298ca87ce7f8630 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Mon, 28 Feb 2022 17:08:53 -0800 Subject: [PATCH] re-add config for stronghold seed patch --- ...Hostname-to-AsyncPlayerPreLoginEvent.patch | 19 ------- .../0858-Add-config-for-stronghold-seed.patch | 57 ------------------- .../0858-Add-config-for-stronghold-seed.patch | 47 +++++++++++++++ ...h => 0859-Implement-regenerateChunk.patch} | 0 ...tions-thrown-during-chat-processing.patch} | 0 ...lled-powdered-snow-bucket-placement.patch} | 0 ...ate-calls-to-CraftServer-getSpawnLi.patch} | 0 ...gs.patch => 0863-Add-GameEvent-tags.patch} | 0 ...-Replace-player-chunk-loader-system.patch} | 0 ...ks-fairly-for-worlds-while-waiting-.patch} | 0 ...866-Replace-ticket-level-propagator.patch} | 0 ...tch => 0867-Furnace-RecipesUsed-API.patch} | 0 ...gurable-sculk-sensor-listener-range.patch} | 0 ...d-missing-block-data-mins-and-maxes.patch} | 0 ...fault-CustomSpawners-in-custom-worl.patch} | 0 ...-worldlist-before-initing-the-world.patch} | 0 ... => 0872-Fix-Entity-Position-Desync.patch} | 0 ...s.patch => 0873-Custom-Potion-Mixes.patch} | 0 ...-LevelStem-in-StructureCheck-from-C.patch} | 0 19 files changed, 47 insertions(+), 76 deletions(-) delete mode 100644 patches/removed/1.18.2/0851-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch delete mode 100644 patches/removed/1.18.2/0858-Add-config-for-stronghold-seed.patch create mode 100644 patches/server/0858-Add-config-for-stronghold-seed.patch rename patches/server/{0858-Implement-regenerateChunk.patch => 0859-Implement-regenerateChunk.patch} (100%) rename patches/server/{0859-Log-exceptions-thrown-during-chat-processing.patch => 0860-Log-exceptions-thrown-during-chat-processing.patch} (100%) rename patches/server/{0860-Fix-cancelled-powdered-snow-bucket-placement.patch => 0861-Fix-cancelled-powdered-snow-bucket-placement.patch} (100%) rename patches/server/{0861-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch => 0862-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch} (100%) rename patches/server/{0862-Add-GameEvent-tags.patch => 0863-Add-GameEvent-tags.patch} (100%) rename patches/server/{0863-Replace-player-chunk-loader-system.patch => 0864-Replace-player-chunk-loader-system.patch} (100%) rename patches/server/{0864-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch => 0865-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch} (100%) rename patches/server/{0865-Replace-ticket-level-propagator.patch => 0866-Replace-ticket-level-propagator.patch} (100%) rename patches/server/{0866-Furnace-RecipesUsed-API.patch => 0867-Furnace-RecipesUsed-API.patch} (100%) rename patches/server/{0867-Configurable-sculk-sensor-listener-range.patch => 0868-Configurable-sculk-sensor-listener-range.patch} (100%) rename patches/server/{0868-Add-missing-block-data-mins-and-maxes.patch => 0869-Add-missing-block-data-mins-and-maxes.patch} (100%) rename patches/server/{0869-Option-to-have-default-CustomSpawners-in-custom-worl.patch => 0870-Option-to-have-default-CustomSpawners-in-custom-worl.patch} (100%) rename patches/server/{0870-Put-world-into-worldlist-before-initing-the-world.patch => 0871-Put-world-into-worldlist-before-initing-the-world.patch} (100%) rename patches/server/{0871-Fix-Entity-Position-Desync.patch => 0872-Fix-Entity-Position-Desync.patch} (100%) rename patches/server/{0872-Custom-Potion-Mixes.patch => 0873-Custom-Potion-Mixes.patch} (100%) rename patches/server/{0873-Fix-missing-Level-LevelStem-in-StructureCheck-from-C.patch => 0874-Fix-missing-Level-LevelStem-in-StructureCheck-from-C.patch} (100%) diff --git a/patches/removed/1.18.2/0851-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch b/patches/removed/1.18.2/0851-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch deleted file mode 100644 index 0a68f370f..000000000 --- a/patches/removed/1.18.2/0851-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: MCMDEV -Date: Fri, 24 Sep 2021 17:59:21 +0200 -Subject: [PATCH] Added getHostname to AsyncPlayerPreLoginEvent - - -diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index bb70d2b4d284727aa5dc88dd99534d09c2e38657..368e32bc12a1a09bf7309f299a1a72554947f43b 100644 ---- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -392,7 +392,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener - - // Paper start - PlayerProfile profile = CraftPlayerProfile.asBukkitMirror(ServerLoginPacketListenerImpl.this.gameProfile); -- AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile); -+ AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile, ServerLoginPacketListenerImpl.this.hostname); - server.getPluginManager().callEvent(asyncEvent); - profile = asyncEvent.getPlayerProfile(); - profile.complete(true); diff --git a/patches/removed/1.18.2/0858-Add-config-for-stronghold-seed.patch b/patches/removed/1.18.2/0858-Add-config-for-stronghold-seed.patch deleted file mode 100644 index af8d20a64..000000000 --- a/patches/removed/1.18.2/0858-Add-config-for-stronghold-seed.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -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 -index 3f0d83a90e1319baa0622b708b3ba940d3cee64a..0009af6e9c6a48a63736ada2653665f74ac396ca 100644 ---- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -@@ -197,6 +197,7 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource { - skipExistingChunks = event.shouldFindUnexplored(); - structureFeature = StructureFeature.STRUCTURES_REGISTRY.get(event.getType().getName()); - // Paper end -+ this.updateStructureSettings(world, this.settings); // Spigot // Paper - move up to include strongholds - if (structureFeature == StructureFeature.STRONGHOLD) { - this.generateStrongholds(); - BlockPos blockposition1 = null; -@@ -221,7 +222,6 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource { - - return blockposition1; - } else { -- this.updateStructureSettings(world, this.settings); // Spigot - StructureFeatureConfiguration structuresettingsfeature = this.settings.getConfig(structureFeature); - ImmutableMultimap, ResourceKey> immutablemultimap = this.settings.structures(structureFeature); - -@@ -528,6 +528,7 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource { - java.util.Map, StructureFeatureConfiguration> original = settings.structureConfig(); - java.util.Map, StructureFeatureConfiguration> updated = new java.util.HashMap<>(); - org.spigotmc.SpigotWorldConfig conf = world.spigotConfig; -+ this.strongholdSeed = Objects.requireNonNullElse(conf.strongholdSeed, this.strongholdSeed); // Paper - - for (java.util.Map.Entry, StructureFeatureConfiguration> entry : original.entrySet()) { - String name = Registry.STRUCTURE_FEATURE.getKey(entry.getKey()).getPath(); -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index a7a0b94ed22e6e3b9063a17d086f96140c6e95cf..463010859c604812091399e6068e5c2e2daa99ce 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -365,6 +365,7 @@ public class SpigotWorldConfig - public int mansionSeed; - public int fossilSeed; - public int portalSeed; -+ public Long strongholdSeed; // Paper - private void initWorldGenSeeds() - { - this.villageSeed = this.getInt( "seed-village", 10387312 ); -@@ -383,6 +384,10 @@ public class SpigotWorldConfig - 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 + " Bastion: " + this.bastionSeed + " Fortress: " + this.fortressSeed + " Mansion: " + this.mansionSeed + " Fossil: " + this.fossilSeed + " Portal: " + this.portalSeed ); - } diff --git a/patches/server/0858-Add-config-for-stronghold-seed.patch b/patches/server/0858-Add-config-for-stronghold-seed.patch new file mode 100644 index 000000000..4f078313a --- /dev/null +++ b/patches/server/0858-Add-config-for-stronghold-seed.patch @@ -0,0 +1,47 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +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 +index eb2f0bc997a6823c74f32ec01330ced39a14fdd0..56c41fd1c4aedd43d432e3cb3c4e790d0419c159 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java ++++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +@@ -223,7 +223,13 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource { + int k = placement.spread(); + Random random = new Random(); + ++ // Paper start ++ if (strongholdSet.is(net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS) && this.conf.strongholdSeed != null) { ++ random.setSeed(this.conf.strongholdSeed); ++ } else { ++ // Paper end + random.setSeed(this.ringPlacementSeed); ++ } // Paper + double d0 = random.nextDouble() * 3.141592653589793D * 2.0D; + int l = 0; + int i1 = 0; +diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +index b498b027b127996976a394e9a86cfc90f8a8ed3b..31a447e6e156b7b244b2ac69a9c03c09c7ed388c 100644 +--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java ++++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java +@@ -364,6 +364,7 @@ public class SpigotWorldConfig + public int mansionSeed; + public int fossilSeed; + public int portalSeed; ++ public Long strongholdSeed; // Paper + private void initWorldGenSeeds() + { + this.villageSeed = this.getInt( "seed-village", 10387312 ); +@@ -381,6 +382,10 @@ public class SpigotWorldConfig + 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 ); + } diff --git a/patches/server/0858-Implement-regenerateChunk.patch b/patches/server/0859-Implement-regenerateChunk.patch similarity index 100% rename from patches/server/0858-Implement-regenerateChunk.patch rename to patches/server/0859-Implement-regenerateChunk.patch diff --git a/patches/server/0859-Log-exceptions-thrown-during-chat-processing.patch b/patches/server/0860-Log-exceptions-thrown-during-chat-processing.patch similarity index 100% rename from patches/server/0859-Log-exceptions-thrown-during-chat-processing.patch rename to patches/server/0860-Log-exceptions-thrown-during-chat-processing.patch diff --git a/patches/server/0860-Fix-cancelled-powdered-snow-bucket-placement.patch b/patches/server/0861-Fix-cancelled-powdered-snow-bucket-placement.patch similarity index 100% rename from patches/server/0860-Fix-cancelled-powdered-snow-bucket-placement.patch rename to patches/server/0861-Fix-cancelled-powdered-snow-bucket-placement.patch diff --git a/patches/server/0861-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch b/patches/server/0862-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch similarity index 100% rename from patches/server/0861-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch rename to patches/server/0862-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch diff --git a/patches/server/0862-Add-GameEvent-tags.patch b/patches/server/0863-Add-GameEvent-tags.patch similarity index 100% rename from patches/server/0862-Add-GameEvent-tags.patch rename to patches/server/0863-Add-GameEvent-tags.patch diff --git a/patches/server/0863-Replace-player-chunk-loader-system.patch b/patches/server/0864-Replace-player-chunk-loader-system.patch similarity index 100% rename from patches/server/0863-Replace-player-chunk-loader-system.patch rename to patches/server/0864-Replace-player-chunk-loader-system.patch diff --git a/patches/server/0864-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch b/patches/server/0865-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch similarity index 100% rename from patches/server/0864-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch rename to patches/server/0865-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch diff --git a/patches/server/0865-Replace-ticket-level-propagator.patch b/patches/server/0866-Replace-ticket-level-propagator.patch similarity index 100% rename from patches/server/0865-Replace-ticket-level-propagator.patch rename to patches/server/0866-Replace-ticket-level-propagator.patch diff --git a/patches/server/0866-Furnace-RecipesUsed-API.patch b/patches/server/0867-Furnace-RecipesUsed-API.patch similarity index 100% rename from patches/server/0866-Furnace-RecipesUsed-API.patch rename to patches/server/0867-Furnace-RecipesUsed-API.patch diff --git a/patches/server/0867-Configurable-sculk-sensor-listener-range.patch b/patches/server/0868-Configurable-sculk-sensor-listener-range.patch similarity index 100% rename from patches/server/0867-Configurable-sculk-sensor-listener-range.patch rename to patches/server/0868-Configurable-sculk-sensor-listener-range.patch diff --git a/patches/server/0868-Add-missing-block-data-mins-and-maxes.patch b/patches/server/0869-Add-missing-block-data-mins-and-maxes.patch similarity index 100% rename from patches/server/0868-Add-missing-block-data-mins-and-maxes.patch rename to patches/server/0869-Add-missing-block-data-mins-and-maxes.patch diff --git a/patches/server/0869-Option-to-have-default-CustomSpawners-in-custom-worl.patch b/patches/server/0870-Option-to-have-default-CustomSpawners-in-custom-worl.patch similarity index 100% rename from patches/server/0869-Option-to-have-default-CustomSpawners-in-custom-worl.patch rename to patches/server/0870-Option-to-have-default-CustomSpawners-in-custom-worl.patch diff --git a/patches/server/0870-Put-world-into-worldlist-before-initing-the-world.patch b/patches/server/0871-Put-world-into-worldlist-before-initing-the-world.patch similarity index 100% rename from patches/server/0870-Put-world-into-worldlist-before-initing-the-world.patch rename to patches/server/0871-Put-world-into-worldlist-before-initing-the-world.patch diff --git a/patches/server/0871-Fix-Entity-Position-Desync.patch b/patches/server/0872-Fix-Entity-Position-Desync.patch similarity index 100% rename from patches/server/0871-Fix-Entity-Position-Desync.patch rename to patches/server/0872-Fix-Entity-Position-Desync.patch diff --git a/patches/server/0872-Custom-Potion-Mixes.patch b/patches/server/0873-Custom-Potion-Mixes.patch similarity index 100% rename from patches/server/0872-Custom-Potion-Mixes.patch rename to patches/server/0873-Custom-Potion-Mixes.patch diff --git a/patches/server/0873-Fix-missing-Level-LevelStem-in-StructureCheck-from-C.patch b/patches/server/0874-Fix-missing-Level-LevelStem-in-StructureCheck-from-C.patch similarity index 100% rename from patches/server/0873-Fix-missing-Level-LevelStem-in-StructureCheck-from-C.patch rename to patches/server/0874-Fix-missing-Level-LevelStem-in-StructureCheck-from-C.patch