Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-14 20:10:05 +01:00
Fire reload event after everything has been reloaded (#9003)
This event is going to be more important very shortly (hopefully)
Dieser Commit ist enthalten in:
Ursprung
eb0950290d
Commit
83948f6f59
@ -5,7 +5,7 @@ Subject: [PATCH] Added ServerResourcesReloadedEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 7fe23adc486e33e70d02e3855d8080a31a0eeeb5..eb365f8166a233e3e636722072c7130e9cafc1fb 100644
|
||||
index 7fe23adc486e33e70d02e3855d8080a31a0eeeb5..38b6de0d150f62fbc68b10680752347a05bb7301 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2009,7 +2009,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@ -13,7 +13,7 @@ index 7fe23adc486e33e70d02e3855d8080a31a0eeeb5..eb365f8166a233e3e636722072c7130e
|
||||
}
|
||||
|
||||
+ // Paper start - add cause
|
||||
+ @Deprecated
|
||||
+ @Deprecated @io.papermc.paper.annotation.DoNotUse
|
||||
public CompletableFuture<Void> reloadResources(Collection<String> dataPacks) {
|
||||
+ return this.reloadResources(dataPacks, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.PLUGIN);
|
||||
+ }
|
||||
@ -22,14 +22,14 @@ index 7fe23adc486e33e70d02e3855d8080a31a0eeeb5..eb365f8166a233e3e636722072c7130e
|
||||
RegistryAccess.Frozen iregistrycustom_dimension = this.registries.getAccessForLoading(RegistryLayer.RELOADABLE);
|
||||
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
|
||||
Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error
|
||||
@@ -2037,6 +2043,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2050,6 +2056,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
||||
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
||||
org.bukkit.craftbukkit.block.data.CraftBlockData.reloadCache(); // Paper - cache block data strings, they can be defined by datapacks so refresh it here
|
||||
+ new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper - fire after everything has been reloaded
|
||||
}, this);
|
||||
|
||||
this.worldData.setDataConfiguration(worlddataconfiguration);
|
||||
this.resources.managers.updateRegistryTags(this.registryAccess());
|
||||
+ new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
||||
// Paper start
|
||||
if (Thread.currentThread() != this.serverThread) {
|
||||
return;
|
||||
if (this.isSameThread()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/commands/ReloadCommand.java b/src/main/java/net/minecraft/server/commands/ReloadCommand.java
|
||||
index 7108be7931e0a9e6240c18433d103659254b99af..2247d4452edbffb7c6c5dae4fe6e8e8f1fce4b5f 100644
|
||||
--- a/src/main/java/net/minecraft/server/commands/ReloadCommand.java
|
||||
|
@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..6b0bed550763f34e18c9e92f9a47ec0c
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 65a041165919b988d0e2113d12cdb035fbbcdbcc..0182d477dde8ed54bb6b0093a5040f38441231b4 100644
|
||||
index e0a5b8d736446430433f95ade24a35e47fca889e..a212955bc8aafa1232a11ae2aa7d5fc84b9f9691 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2058,6 +2058,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@ -32,9 +32,9 @@ index 65a041165919b988d0e2113d12cdb035fbbcdbcc..0182d477dde8ed54bb6b0093a5040f38
|
||||
this.worldData.setDataConfiguration(worlddataconfiguration);
|
||||
this.resources.managers.updateRegistryTags(this.registryAccess());
|
||||
+ net.minecraft.world.item.alchemy.PotionBrewing.reload(); // Paper
|
||||
new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
|
||||
// Paper start
|
||||
if (Thread.currentThread() != this.serverThread) {
|
||||
return;
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java b/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
||||
index 9fe5a680c0ad5624cebcd61fd8812e88d29fc209..6f5246f3cfc6b6757fad2a634299921df9d10223 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren