aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0683-Option-to-have-default-CustomSpawners-in-custom-worl.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-05-29 13:58:57 -0700
committerGitHub <[email protected]>2024-05-29 22:58:57 +0200
commita31dc90741ed9c121a13a3c124c9ebf5bafd0da7 (patch)
tree81963bd94fe7772ee08bd21710230de21b6b25da /patches/server/0683-Option-to-have-default-CustomSpawners-in-custom-worl.patch
parented85aac53cfd93d29fa24e6071dbdddd0e49624b (diff)
downloadPaper-a31dc90741ed9c121a13a3c124c9ebf5bafd0da7.tar.gz
Paper-a31dc90741ed9c121a13a3c124c9ebf5bafd0da7.zip
Several fixes and new api for experience merging/stacking (#9242)
Diffstat (limited to 'patches/server/0683-Option-to-have-default-CustomSpawners-in-custom-worl.patch')
-rw-r--r--patches/server/0683-Option-to-have-default-CustomSpawners-in-custom-worl.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/patches/server/0683-Option-to-have-default-CustomSpawners-in-custom-worl.patch b/patches/server/0683-Option-to-have-default-CustomSpawners-in-custom-worl.patch
new file mode 100644
index 0000000000..db238fea90
--- /dev/null
+++ b/patches/server/0683-Option-to-have-default-CustomSpawners-in-custom-worl.patch
@@ -0,0 +1,32 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Sat, 19 Feb 2022 20:15:41 -0800
+Subject: [PATCH] Option to have default CustomSpawners in custom worlds
+
+By default, only LevelStem's that specifically match the ResourceKey for
+OVERWORLD will have the 5 (currently) impls of CustomSpawner (for
+phantoms, wandering traders, etc.). This adds an option to instead of
+just looking at the LevelStem key, look at the DimensionType key which
+is one level below that. Defaults to off to keep vanilla behavior.
+
+diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
+index 6d80102287f3976ea7f0912bcbd5ff0a2088a0e1..b72b5fb2fa1d372f914ad1084e43b21b14f4fffb 100644
+--- a/src/main/java/net/minecraft/server/MinecraftServer.java
++++ b/src/main/java/net/minecraft/server/MinecraftServer.java
+@@ -625,7 +625,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+ this.commandStorage = new CommandStorage(worldpersistentdata);
+ } else {
+ ChunkProgressListener worldloadlistener = this.progressListenerFactory.create(this.worldData.getGameRules().getInt(GameRules.RULE_SPAWN_CHUNK_RADIUS));
+- world = new ServerLevel(this, this.executor, worldSession, iworlddataserver, worldKey, worlddimension, worldloadlistener, flag, j, ImmutableList.of(), true, this.overworld().getRandomSequences(), org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider);
++ // Paper start - option to use the dimension_type to check if spawners should be added. I imagine mojang will add some datapack-y way of managing this in the future.
++ final List<CustomSpawner> spawners;
++ if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.useDimensionTypeForCustomSpawners && this.registryAccess().registryOrThrow(Registries.DIMENSION_TYPE).getResourceKey(worlddimension.type().value()).orElseThrow() == net.minecraft.world.level.dimension.BuiltinDimensionTypes.OVERWORLD) {
++ spawners = list;
++ } else {
++ spawners = Collections.emptyList();
++ }
++ world = new ServerLevel(this, this.executor, worldSession, iworlddataserver, worldKey, worlddimension, worldloadlistener, flag, j, spawners, true, this.overworld().getRandomSequences(), org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider);
++ // Paper end - option to use the dimension_type to check if spawners should be added
+ }
+
+ worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());