mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-01 08:20:51 +01:00
7c2dc4b342
* finish implementing all adventure components in codecs * add some initial tests * Add round trip tests for text and translatable components * Add more round trip test data (score component is failing) * Add more round trip test data * Fix SCORE_COMPONENT_MAP_CODEC * Improve test failure messages * Add failure cases * Add a couple more test data * Make use of AdventureCodecs * Update patches after rebase * Squash changes into adventure patch * Fix AT formatting * update comment --------- Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
33 lines
2.6 KiB
Diff
33 lines
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
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 8f375cc054f6c15537eca4927ea5cb0eb6a93b67..abd20b1bbda4177a3f3be8abf3977866780a9b67 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -623,7 +623,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.commandStorage = new CommandStorage(worldpersistentdata);
|
|
} else {
|
|
ChunkProgressListener worldloadlistener = this.progressListenerFactory.create(11);
|
|
- 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
|
|
}
|
|
|
|
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
|