Skip to content

Commit

Permalink
Cache world data when world loading
Browse files Browse the repository at this point in the history
  • Loading branch information
killerprojecte committed Jun 30, 2023
1 parent d6dd14f commit ae2980b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions patches/server/0030-Cache-world-data-when-world-loading.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: killerprojecte <[email protected]>
Date: Fri, 30 Jun 2023 20:30:03 +0800
Date: Fri, 30 Jun 2023 20:34:22 +0800
Subject: [PATCH] Cache world data when world loading


Expand All @@ -26,7 +26,7 @@ index ee9f5e1f3387998cddbeb1dc6dc6e2b1ea7cd670..70cc11031e5ed5d9c4c5e68aca9a1b79
tickThreadRunner.currentTickingWorldRegionizedData = null;
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index d5d05bcbbbc883d9ff6d545af9f72ac58f09fb0e..ed6642bcc96eb8c274ef7f22474f17f168c3f570 100644
index d5d05bcbbbc883d9ff6d545af9f72ac58f09fb0e..d6affe652df308b329865424e55d27fb8687f3d4 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1,5 +1,6 @@
Expand All @@ -50,7 +50,7 @@ index d5d05bcbbbc883d9ff6d545af9f72ac58f09fb0e..ed6642bcc96eb8c274ef7f22474f17f1
region.world.checkInitialised.set(ServerLevel.WORLD_INIT_CHECKED);
+ // DirtyFolia - Start
+ CachedWorldData.update(region.world.getWorld().getName(), region.world.getCurrentWorldData());
+ MinecraftServer.LOGGER.info("World " + region.world.getWorld().getName() + " data status: " + (CachedWorldData.get(level.getWorld().getName()) == null ? "(Unavailable)" : "(Cached)"));
+ MinecraftServer.LOGGER.info("World " + region.world.getWorld().getName() + " data status: " + (CachedWorldData.get(region.world.getWorld().getName()) == null ? "(Unavailable)" : "(Cached)"));
+ // DirtyFolia - End
LOGGER.info("Initialised world '" + region.world.getWorld().getName() + "'");
} // else: must be checked
Expand Down

0 comments on commit ae2980b

Please sign in to comment.