mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +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());
|
this.resources.managers.updateRegistryTags(this.registryAccess());
|
||||||
+ io.papermc.paper.registry.PaperRegistry.clearCaches(); // Paper
|
+ io.papermc.paper.registry.PaperRegistry.clearCaches(); // Paper
|
||||||
new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
||||||
if (Thread.currentThread() != this.serverThread) return; // Paper
|
// Paper start
|
||||||
//this.getPlayerList().saveAll(); // Paper - we don't need to do this
|
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
|
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
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
--- 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.worldData.setDataPackConfig(MinecraftServer.getSelectedPacks(this.packRepository));
|
||||||
this.resources.managers.updateRegistryTags(this.registryAccess());
|
this.resources.managers.updateRegistryTags(this.registryAccess());
|
||||||
+ new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
+ new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
||||||
if (Thread.currentThread() != this.serverThread) return; // Paper
|
// Paper start
|
||||||
//this.getPlayerList().saveAll(); // Paper - we don't need to do this
|
if (Thread.currentThread() != this.serverThread) {
|
||||||
this.getPlayerList().reloadResources();
|
return;
|
||||||
diff --git a/src/main/java/net/minecraft/server/commands/ReloadCommand.java b/src/main/java/net/minecraft/server/commands/ReloadCommand.java
|
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
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/commands/ReloadCommand.java
|
--- a/src/main/java/net/minecraft/server/commands/ReloadCommand.java
|
||||||
|
@ -33,8 +33,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
io.papermc.paper.registry.PaperRegistry.clearCaches(); // Paper
|
io.papermc.paper.registry.PaperRegistry.clearCaches(); // Paper
|
||||||
+ net.minecraft.world.item.alchemy.PotionBrewing.reload(); // Paper
|
+ net.minecraft.world.item.alchemy.PotionBrewing.reload(); // Paper
|
||||||
new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
||||||
if (Thread.currentThread() != this.serverThread) return; // Paper
|
// Paper start
|
||||||
//this.getPlayerList().saveAll(); // Paper - we don't need to do this
|
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
|
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
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
--- a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
||||||
|
@ -20,8 +20,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
||||||
if (Thread.currentThread() != this.serverThread) return; // Paper
|
// Paper start
|
||||||
//this.getPlayerList().saveAll(); // Paper - we don't need to do this
|
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
|
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
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- 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.worldData.setDataPackConfig(MinecraftServer.getSelectedPacks(this.packRepository));
|
||||||
this.resources.managers.updateRegistryTags(this.registryAccess());
|
this.resources.managers.updateRegistryTags(this.registryAccess());
|
||||||
- this.getPlayerList().saveAll();
|
- this.getPlayerList().saveAll();
|
||||||
+ if (Thread.currentThread() != this.serverThread) return; // Paper
|
+ // Paper start
|
||||||
+ //this.getPlayerList().saveAll(); // Paper - we don't need to do this
|
+ 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.getPlayerList().reloadResources();
|
||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user