mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Fix advancement saving before reloads (#8003)
This commit is contained in:
parent
a3f2d9b81e
commit
fe2520594d
@ -202,8 +202,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.resources.managers.updateRegistryTags(this.registryAccess());
|
||||
+ io.papermc.paper.registry.PaperRegistry.clearCaches(); // Paper
|
||||
new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
||||
if (Thread.currentThread() != this.serverThread) return; // Paper
|
||||
//this.getPlayerList().saveAll(); // Paper - we don't need to do this
|
||||
// Paper start
|
||||
if (Thread.currentThread() != this.serverThread) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
|
@ -27,9 +27,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.worldData.setDataPackConfig(MinecraftServer.getSelectedPacks(this.packRepository));
|
||||
this.resources.managers.updateRegistryTags(this.registryAccess());
|
||||
+ new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
||||
if (Thread.currentThread() != this.serverThread) return; // Paper
|
||||
//this.getPlayerList().saveAll(); // Paper - we don't need to do this
|
||||
this.getPlayerList().reloadResources();
|
||||
// Paper start
|
||||
if (Thread.currentThread() != this.serverThread) {
|
||||
return;
|
||||
diff --git a/src/main/java/net/minecraft/server/commands/ReloadCommand.java b/src/main/java/net/minecraft/server/commands/ReloadCommand.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/commands/ReloadCommand.java
|
||||
|
@ -33,8 +33,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
io.papermc.paper.registry.PaperRegistry.clearCaches(); // Paper
|
||||
+ net.minecraft.world.item.alchemy.PotionBrewing.reload(); // Paper
|
||||
new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
||||
if (Thread.currentThread() != this.serverThread) return; // Paper
|
||||
//this.getPlayerList().saveAll(); // Paper - we don't need to do this
|
||||
// Paper start
|
||||
if (Thread.currentThread() != this.serverThread) {
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java b/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
||||
|
@ -20,8 +20,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ // Paper end
|
||||
new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
||||
if (Thread.currentThread() != this.serverThread) return; // Paper
|
||||
//this.getPlayerList().saveAll(); // Paper - we don't need to do this
|
||||
// Paper start
|
||||
if (Thread.currentThread() != this.serverThread) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
|
@ -224,8 +224,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.worldData.setDataPackConfig(MinecraftServer.getSelectedPacks(this.packRepository));
|
||||
this.resources.managers.updateRegistryTags(this.registryAccess());
|
||||
- this.getPlayerList().saveAll();
|
||||
+ if (Thread.currentThread() != this.serverThread) return; // Paper
|
||||
+ //this.getPlayerList().saveAll(); // Paper - we don't need to do this
|
||||
+ // Paper start
|
||||
+ if (Thread.currentThread() != this.serverThread) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // this.getPlayerList().saveAll(); // Paper - we don't need to save everything, just advancements
|
||||
+ for (ServerPlayer player : this.getPlayerList().getPlayers()) {
|
||||
+ player.getAdvancements().save();
|
||||
+ }
|
||||
+ // Paper end
|
||||
this.getPlayerList().reloadResources();
|
||||
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
||||
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
||||
|
Loading…
Reference in New Issue
Block a user