mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-03 21:52:05 -07:00
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.
This commit is contained in:
@@ -308,7 +308,7 @@
|
|||||||
if (profiledduration != null) {
|
if (profiledduration != null) {
|
||||||
profiledduration.finish(true);
|
profiledduration.finish(true);
|
||||||
}
|
}
|
||||||
@@ -387,23 +468,232 @@
|
@@ -387,23 +468,240 @@
|
||||||
|
|
||||||
protected void forceDifficulty() {}
|
protected void forceDifficulty() {}
|
||||||
|
|
||||||
@@ -503,7 +503,15 @@
|
|||||||
+ this.commandStorage = new CommandStorage(worldpersistentdata);
|
+ this.commandStorage = new CommandStorage(worldpersistentdata);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ ChunkProgressListener worldloadlistener = this.progressListenerFactory.create(this.worldData.getGameRules().getInt(GameRules.RULE_SPAWN_CHUNK_RADIUS));
|
+ 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().lookupOrThrow(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());
|
+ worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
|
||||||
@@ -555,7 +563,7 @@
|
|||||||
|
|
||||||
if (!iworlddataserver.isInitialized()) {
|
if (!iworlddataserver.isInitialized()) {
|
||||||
try {
|
try {
|
||||||
@@ -427,30 +717,8 @@
|
@@ -427,30 +725,8 @@
|
||||||
iworlddataserver.setInitialized(true);
|
iworlddataserver.setInitialized(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -587,7 +595,7 @@
|
|||||||
|
|
||||||
private static void setInitialSpawn(ServerLevel world, ServerLevelData worldProperties, boolean bonusChest, boolean debugWorld) {
|
private static void setInitialSpawn(ServerLevel world, ServerLevelData worldProperties, boolean bonusChest, boolean debugWorld) {
|
||||||
if (debugWorld) {
|
if (debugWorld) {
|
||||||
@@ -458,6 +726,21 @@
|
@@ -458,6 +734,21 @@
|
||||||
} else {
|
} else {
|
||||||
ServerChunkCache chunkproviderserver = world.getChunkSource();
|
ServerChunkCache chunkproviderserver = world.getChunkSource();
|
||||||
ChunkPos chunkcoordintpair = new ChunkPos(chunkproviderserver.randomState().sampler().findSpawnPosition());
|
ChunkPos chunkcoordintpair = new ChunkPos(chunkproviderserver.randomState().sampler().findSpawnPosition());
|
||||||
@@ -609,7 +617,7 @@
|
|||||||
int i = chunkproviderserver.getGenerator().getSpawnHeight(world);
|
int i = chunkproviderserver.getGenerator().getSpawnHeight(world);
|
||||||
|
|
||||||
if (i < world.getMinY()) {
|
if (i < world.getMinY()) {
|
||||||
@@ -516,31 +799,36 @@
|
@@ -516,31 +807,36 @@
|
||||||
iworlddataserver.setGameType(GameType.SPECTATOR);
|
iworlddataserver.setGameType(GameType.SPECTATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -657,7 +665,7 @@
|
|||||||
ForcedChunksSavedData forcedchunk = (ForcedChunksSavedData) worldserver1.getDataStorage().get(ForcedChunksSavedData.factory(), "chunks");
|
ForcedChunksSavedData forcedchunk = (ForcedChunksSavedData) worldserver1.getDataStorage().get(ForcedChunksSavedData.factory(), "chunks");
|
||||||
|
|
||||||
if (forcedchunk != null) {
|
if (forcedchunk != null) {
|
||||||
@@ -555,10 +843,17 @@
|
@@ -555,10 +851,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -679,7 +687,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public GameType getDefaultGameType() {
|
public GameType getDefaultGameType() {
|
||||||
@@ -588,12 +883,16 @@
|
@@ -588,12 +891,16 @@
|
||||||
worldserver.save((ProgressListener) null, flush, worldserver.noSave && !force);
|
worldserver.save((ProgressListener) null, flush, worldserver.noSave && !force);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -698,7 +706,7 @@
|
|||||||
if (flush) {
|
if (flush) {
|
||||||
Iterator iterator1 = this.getAllLevels().iterator();
|
Iterator iterator1 = this.getAllLevels().iterator();
|
||||||
|
|
||||||
@@ -628,18 +927,45 @@
|
@@ -628,18 +935,45 @@
|
||||||
this.stopServer();
|
this.stopServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -745,7 +753,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
MinecraftServer.LOGGER.info("Saving worlds");
|
MinecraftServer.LOGGER.info("Saving worlds");
|
||||||
@@ -693,6 +1019,15 @@
|
@@ -693,6 +1027,15 @@
|
||||||
} catch (IOException ioexception1) {
|
} catch (IOException ioexception1) {
|
||||||
MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1);
|
MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1);
|
||||||
}
|
}
|
||||||
@@ -761,7 +769,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -709,6 +1044,14 @@
|
@@ -709,6 +1052,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void halt(boolean waitForShutdown) {
|
public void halt(boolean waitForShutdown) {
|
||||||
@@ -776,7 +784,7 @@
|
|||||||
this.running = false;
|
this.running = false;
|
||||||
if (waitForShutdown) {
|
if (waitForShutdown) {
|
||||||
try {
|
try {
|
||||||
@@ -720,6 +1063,64 @@
|
@@ -720,6 +1071,64 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -841,7 +849,7 @@
|
|||||||
protected void runServer() {
|
protected void runServer() {
|
||||||
try {
|
try {
|
||||||
if (!this.initServer()) {
|
if (!this.initServer()) {
|
||||||
@@ -727,9 +1128,16 @@
|
@@ -727,9 +1136,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.nextTickTimeNanos = Util.getNanos();
|
this.nextTickTimeNanos = Util.getNanos();
|
||||||
@@ -859,7 +867,7 @@
|
|||||||
while (this.running) {
|
while (this.running) {
|
||||||
long i;
|
long i;
|
||||||
|
|
||||||
@@ -744,12 +1152,31 @@
|
@@ -744,12 +1160,31 @@
|
||||||
if (j > MinecraftServer.OVERLOADED_THRESHOLD_NANOS + 20L * i && this.nextTickTimeNanos - this.lastOverloadWarningNanos >= MinecraftServer.OVERLOADED_WARNING_INTERVAL_NANOS + 100L * i) {
|
if (j > MinecraftServer.OVERLOADED_THRESHOLD_NANOS + 20L * i && this.nextTickTimeNanos - this.lastOverloadWarningNanos >= MinecraftServer.OVERLOADED_WARNING_INTERVAL_NANOS + 100L * i) {
|
||||||
long k = j / i;
|
long k = j / i;
|
||||||
|
|
||||||
@@ -891,7 +899,7 @@
|
|||||||
boolean flag = i == 0L;
|
boolean flag = i == 0L;
|
||||||
|
|
||||||
if (this.debugCommandProfilerDelayStart) {
|
if (this.debugCommandProfilerDelayStart) {
|
||||||
@@ -757,6 +1184,8 @@
|
@@ -757,6 +1192,8 @@
|
||||||
this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount);
|
this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -900,7 +908,7 @@
|
|||||||
this.nextTickTimeNanos += i;
|
this.nextTickTimeNanos += i;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -830,6 +1259,13 @@
|
@@ -830,6 +1267,13 @@
|
||||||
this.services.profileCache().clearExecutor();
|
this.services.profileCache().clearExecutor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -914,7 +922,7 @@
|
|||||||
this.onServerExit();
|
this.onServerExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -889,9 +1325,16 @@
|
@@ -889,9 +1333,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean haveTime() {
|
private boolean haveTime() {
|
||||||
@@ -932,7 +940,7 @@
|
|||||||
public static boolean throwIfFatalException() {
|
public static boolean throwIfFatalException() {
|
||||||
RuntimeException runtimeexception = (RuntimeException) MinecraftServer.fatalException.get();
|
RuntimeException runtimeexception = (RuntimeException) MinecraftServer.fatalException.get();
|
||||||
|
|
||||||
@@ -903,7 +1346,7 @@
|
@@ -903,7 +1354,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setFatalException(RuntimeException exception) {
|
public static void setFatalException(RuntimeException exception) {
|
||||||
@@ -941,7 +949,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -961,6 +1404,7 @@
|
@@ -961,6 +1412,7 @@
|
||||||
if (super.pollTask()) {
|
if (super.pollTask()) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@@ -949,7 +957,7 @@
|
|||||||
if (this.tickRateManager.isSprinting() || this.haveTime()) {
|
if (this.tickRateManager.isSprinting() || this.haveTime()) {
|
||||||
Iterator iterator = this.getAllLevels().iterator();
|
Iterator iterator = this.getAllLevels().iterator();
|
||||||
|
|
||||||
@@ -968,16 +1412,16 @@
|
@@ -968,16 +1420,16 @@
|
||||||
ServerLevel worldserver = (ServerLevel) iterator.next();
|
ServerLevel worldserver = (ServerLevel) iterator.next();
|
||||||
|
|
||||||
if (worldserver.getChunkSource().pollTask()) {
|
if (worldserver.getChunkSource().pollTask()) {
|
||||||
@@ -969,7 +977,7 @@
|
|||||||
Profiler.get().incrementCounter("runTask");
|
Profiler.get().incrementCounter("runTask");
|
||||||
super.doRunTask(ticktask);
|
super.doRunTask(ticktask);
|
||||||
}
|
}
|
||||||
@@ -1025,6 +1469,7 @@
|
@@ -1025,6 +1477,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
||||||
@@ -977,7 +985,7 @@
|
|||||||
long i = Util.getNanos();
|
long i = Util.getNanos();
|
||||||
int j = this.pauseWhileEmptySeconds() * 20;
|
int j = this.pauseWhileEmptySeconds() * 20;
|
||||||
|
|
||||||
@@ -1041,11 +1486,13 @@
|
@@ -1041,11 +1494,13 @@
|
||||||
this.autoSave();
|
this.autoSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -991,7 +999,7 @@
|
|||||||
++this.tickCount;
|
++this.tickCount;
|
||||||
this.tickRateManager.tick();
|
this.tickRateManager.tick();
|
||||||
this.tickChildren(shouldKeepTicking);
|
this.tickChildren(shouldKeepTicking);
|
||||||
@@ -1055,12 +1502,18 @@
|
@@ -1055,12 +1510,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
--this.ticksUntilAutosave;
|
--this.ticksUntilAutosave;
|
||||||
@@ -1011,7 +1019,7 @@
|
|||||||
gameprofilerfiller.push("tallying");
|
gameprofilerfiller.push("tallying");
|
||||||
long k = Util.getNanos() - i;
|
long k = Util.getNanos() - i;
|
||||||
int l = this.tickCount % 100;
|
int l = this.tickCount % 100;
|
||||||
@@ -1069,12 +1522,17 @@
|
@@ -1069,12 +1530,17 @@
|
||||||
this.aggregatedTickTimesNanos += k;
|
this.aggregatedTickTimesNanos += k;
|
||||||
this.tickTimesNanos[l] = k;
|
this.tickTimesNanos[l] = k;
|
||||||
this.smoothedTickTimeMillis = this.smoothedTickTimeMillis * 0.8F + (float) k / (float) TimeUtil.NANOSECONDS_PER_MILLISECOND * 0.19999999F;
|
this.smoothedTickTimeMillis = this.smoothedTickTimeMillis * 0.8F + (float) k / (float) TimeUtil.NANOSECONDS_PER_MILLISECOND * 0.19999999F;
|
||||||
@@ -1030,7 +1038,7 @@
|
|||||||
MinecraftServer.LOGGER.debug("Autosave started");
|
MinecraftServer.LOGGER.debug("Autosave started");
|
||||||
ProfilerFiller gameprofilerfiller = Profiler.get();
|
ProfilerFiller gameprofilerfiller = Profiler.get();
|
||||||
|
|
||||||
@@ -1123,7 +1581,7 @@
|
@@ -1123,7 +1589,7 @@
|
||||||
private ServerStatus buildServerStatus() {
|
private ServerStatus buildServerStatus() {
|
||||||
ServerStatus.Players serverping_serverpingplayersample = this.buildPlayerStatus();
|
ServerStatus.Players serverping_serverpingplayersample = this.buildPlayerStatus();
|
||||||
|
|
||||||
@@ -1039,7 +1047,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ServerStatus.Players buildPlayerStatus() {
|
private ServerStatus.Players buildPlayerStatus() {
|
||||||
@@ -1133,7 +1591,7 @@
|
@@ -1133,7 +1599,7 @@
|
||||||
if (this.hidesOnlinePlayers()) {
|
if (this.hidesOnlinePlayers()) {
|
||||||
return new ServerStatus.Players(i, list.size(), List.of());
|
return new ServerStatus.Players(i, list.size(), List.of());
|
||||||
} else {
|
} else {
|
||||||
@@ -1048,7 +1056,7 @@
|
|||||||
ObjectArrayList<GameProfile> objectarraylist = new ObjectArrayList(j);
|
ObjectArrayList<GameProfile> objectarraylist = new ObjectArrayList(j);
|
||||||
int k = Mth.nextInt(this.random, 0, list.size() - j);
|
int k = Mth.nextInt(this.random, 0, list.size() - j);
|
||||||
|
|
||||||
@@ -1154,24 +1612,56 @@
|
@@ -1154,24 +1620,56 @@
|
||||||
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
|
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
|
||||||
entityplayer.connection.suspendFlushing();
|
entityplayer.connection.suspendFlushing();
|
||||||
});
|
});
|
||||||
@@ -1058,13 +1066,13 @@
|
|||||||
this.getFunctions().tick();
|
this.getFunctions().tick();
|
||||||
gameprofilerfiller.popPush("levels");
|
gameprofilerfiller.popPush("levels");
|
||||||
Iterator iterator = this.getAllLevels().iterator();
|
Iterator iterator = this.getAllLevels().iterator();
|
||||||
+
|
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ // Run tasks that are waiting on processing
|
+ // Run tasks that are waiting on processing
|
||||||
+ while (!this.processQueue.isEmpty()) {
|
+ while (!this.processQueue.isEmpty()) {
|
||||||
+ this.processQueue.remove().run();
|
+ this.processQueue.remove().run();
|
||||||
+ }
|
+ }
|
||||||
|
+
|
||||||
+ // Send time updates to everyone, it will get the right time from the world the player is in.
|
+ // Send time updates to everyone, it will get the right time from the world the player is in.
|
||||||
+ // Paper start - Perf: Optimize time updates
|
+ // Paper start - Perf: Optimize time updates
|
||||||
+ for (final ServerLevel level : this.getAllLevels()) {
|
+ for (final ServerLevel level : this.getAllLevels()) {
|
||||||
@@ -1105,7 +1113,7 @@
|
|||||||
|
|
||||||
gameprofilerfiller.push("tick");
|
gameprofilerfiller.push("tick");
|
||||||
|
|
||||||
@@ -1186,6 +1676,7 @@
|
@@ -1186,6 +1684,7 @@
|
||||||
|
|
||||||
gameprofilerfiller.pop();
|
gameprofilerfiller.pop();
|
||||||
gameprofilerfiller.pop();
|
gameprofilerfiller.pop();
|
||||||
@@ -1113,7 +1121,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
gameprofilerfiller.popPush("connection");
|
gameprofilerfiller.popPush("connection");
|
||||||
@@ -1267,6 +1758,22 @@
|
@@ -1267,6 +1766,22 @@
|
||||||
return (ServerLevel) this.levels.get(key);
|
return (ServerLevel) this.levels.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1136,7 +1144,7 @@
|
|||||||
public Set<ResourceKey<Level>> levelKeys() {
|
public Set<ResourceKey<Level>> levelKeys() {
|
||||||
return this.levels.keySet();
|
return this.levels.keySet();
|
||||||
}
|
}
|
||||||
@@ -1296,7 +1803,7 @@
|
@@ -1296,7 +1811,7 @@
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
@@ -1145,7 +1153,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public SystemReport fillSystemReport(SystemReport details) {
|
public SystemReport fillSystemReport(SystemReport details) {
|
||||||
@@ -1347,7 +1854,7 @@
|
@@ -1347,7 +1862,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendSystemMessage(Component message) {
|
public void sendSystemMessage(Component message) {
|
||||||
@@ -1154,7 +1162,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public KeyPair getKeyPair() {
|
public KeyPair getKeyPair() {
|
||||||
@@ -1385,11 +1892,14 @@
|
@@ -1385,11 +1900,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1174,7 +1182,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1403,7 +1913,7 @@
|
@@ -1403,7 +1921,7 @@
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
ServerLevel worldserver = (ServerLevel) iterator.next();
|
ServerLevel worldserver = (ServerLevel) iterator.next();
|
||||||
|
|
||||||
@@ -1183,7 +1191,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1481,10 +1991,20 @@
|
@@ -1481,10 +1999,20 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMotd() {
|
public String getMotd() {
|
||||||
@@ -1205,7 +1213,7 @@
|
|||||||
this.motd = motd;
|
this.motd = motd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1507,7 +2027,7 @@
|
@@ -1507,7 +2035,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerConnectionListener getConnection() {
|
public ServerConnectionListener getConnection() {
|
||||||
@@ -1214,7 +1222,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isReady() {
|
public boolean isReady() {
|
||||||
@@ -1632,13 +2152,19 @@
|
@@ -1632,13 +2160,19 @@
|
||||||
return this.functionManager;
|
return this.functionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1236,7 +1244,7 @@
|
|||||||
}, this).thenCompose((immutablelist) -> {
|
}, this).thenCompose((immutablelist) -> {
|
||||||
MultiPackResourceManager resourcemanager = new MultiPackResourceManager(PackType.SERVER_DATA, immutablelist);
|
MultiPackResourceManager resourcemanager = new MultiPackResourceManager(PackType.SERVER_DATA, immutablelist);
|
||||||
List<Registry.PendingTags<?>> list = TagLoader.loadTagsForExistingRegistries(resourcemanager, this.registries.compositeAccess());
|
List<Registry.PendingTags<?>> list = TagLoader.loadTagsForExistingRegistries(resourcemanager, this.registries.compositeAccess());
|
||||||
@@ -1654,6 +2180,7 @@
|
@@ -1654,6 +2188,7 @@
|
||||||
}).thenAcceptAsync((minecraftserver_reloadableresources) -> {
|
}).thenAcceptAsync((minecraftserver_reloadableresources) -> {
|
||||||
this.resources.close();
|
this.resources.close();
|
||||||
this.resources = minecraftserver_reloadableresources;
|
this.resources = minecraftserver_reloadableresources;
|
||||||
@@ -1244,7 +1252,7 @@
|
|||||||
this.packRepository.setSelected(dataPacks);
|
this.packRepository.setSelected(dataPacks);
|
||||||
WorldDataConfiguration worlddataconfiguration = new WorldDataConfiguration(MinecraftServer.getSelectedPacks(this.packRepository, true), this.worldData.enabledFeatures());
|
WorldDataConfiguration worlddataconfiguration = new WorldDataConfiguration(MinecraftServer.getSelectedPacks(this.packRepository, true), this.worldData.enabledFeatures());
|
||||||
|
|
||||||
@@ -1665,6 +2192,8 @@
|
@@ -1665,6 +2200,8 @@
|
||||||
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
||||||
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
||||||
this.fuelValues = FuelValues.vanillaBurnTimes(this.registries.compositeAccess(), this.worldData.enabledFeatures());
|
this.fuelValues = FuelValues.vanillaBurnTimes(this.registries.compositeAccess(), this.worldData.enabledFeatures());
|
||||||
@@ -1253,7 +1261,7 @@
|
|||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
if (this.isSameThread()) {
|
if (this.isSameThread()) {
|
||||||
@@ -1789,14 +2318,15 @@
|
@@ -1789,14 +2326,15 @@
|
||||||
if (this.isEnforceWhitelist()) {
|
if (this.isEnforceWhitelist()) {
|
||||||
PlayerList playerlist = source.getServer().getPlayerList();
|
PlayerList playerlist = source.getServer().getPlayerList();
|
||||||
UserWhiteList whitelist = playerlist.getWhiteList();
|
UserWhiteList whitelist = playerlist.getWhiteList();
|
||||||
@@ -1271,7 +1279,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1952,7 +2482,7 @@
|
@@ -1952,7 +2490,7 @@
|
||||||
final List<String> list = Lists.newArrayList();
|
final List<String> list = Lists.newArrayList();
|
||||||
final GameRules gamerules = this.getGameRules();
|
final GameRules gamerules = this.getGameRules();
|
||||||
|
|
||||||
@@ -1280,7 +1288,7 @@
|
|||||||
@Override
|
@Override
|
||||||
public <T extends GameRules.Value<T>> void visit(GameRules.Key<T> key, GameRules.Type<T> type) {
|
public <T extends GameRules.Value<T>> void visit(GameRules.Key<T> key, GameRules.Type<T> type) {
|
||||||
list.add(String.format(Locale.ROOT, "%s=%s\n", key.getId(), gamerules.getRule(key)));
|
list.add(String.format(Locale.ROOT, "%s=%s\n", key.getId(), gamerules.getRule(key)));
|
||||||
@@ -2058,7 +2588,7 @@
|
@@ -2058,7 +2596,7 @@
|
||||||
try {
|
try {
|
||||||
label51:
|
label51:
|
||||||
{
|
{
|
||||||
@@ -1289,19 +1297,22 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
arraylist = Lists.newArrayList(NativeModuleLister.listModules());
|
arraylist = Lists.newArrayList(NativeModuleLister.listModules());
|
||||||
@@ -2108,6 +2638,21 @@
|
@@ -2105,9 +2643,24 @@
|
||||||
|
if (bufferedwriter != null) {
|
||||||
|
bufferedwriter.close();
|
||||||
}
|
}
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ public boolean isDebugging() {
|
+ public boolean isDebugging() {
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
+ public static MinecraftServer getServer() {
|
+ public static MinecraftServer getServer() {
|
||||||
+ return SERVER; // Paper
|
+ return SERVER; // Paper
|
||||||
+ }
|
}
|
||||||
+
|
|
||||||
+ @Deprecated
|
+ @Deprecated
|
||||||
+ public static RegistryAccess getDefaultRegistryAccess() {
|
+ public static RegistryAccess getDefaultRegistryAccess() {
|
||||||
+ return CraftRegistry.getMinecraftRegistry();
|
+ return CraftRegistry.getMinecraftRegistry();
|
||||||
@@ -1311,7 +1322,7 @@
|
|||||||
private ProfilerFiller createProfiler() {
|
private ProfilerFiller createProfiler() {
|
||||||
if (this.willStartRecordingMetrics) {
|
if (this.willStartRecordingMetrics) {
|
||||||
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
|
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
|
||||||
@@ -2225,18 +2770,24 @@
|
@@ -2225,18 +2778,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void logChatMessage(Component message, ChatType.Bound params, @Nullable String prefix) {
|
public void logChatMessage(Component message, ChatType.Bound params, @Nullable String prefix) {
|
||||||
@@ -1340,7 +1351,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean logIPs() {
|
public boolean logIPs() {
|
||||||
@@ -2379,4 +2930,30 @@
|
@@ -2379,4 +2938,30 @@
|
||||||
public static record ServerResourcePackInfo(UUID id, String url, String hash, boolean isRequired, @Nullable Component prompt) {
|
public static record ServerResourcePackInfo(UUID id, String url, String hash, boolean isRequired, @Nullable Component prompt) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user