mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 07:47:36 +01:00
Fire reload event after everything has been reloaded (#9003)
This event is going to be more important very shortly (hopefully)
This commit is contained in:
parent
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
|
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
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/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
|
@@ -2009,7 +2009,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@ -13,7 +13,7 @@ index 7fe23adc486e33e70d02e3855d8080a31a0eeeb5..eb365f8166a233e3e636722072c7130e
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ // Paper start - add cause
|
+ // Paper start - add cause
|
||||||
+ @Deprecated
|
+ @Deprecated @io.papermc.paper.annotation.DoNotUse
|
||||||
public CompletableFuture<Void> reloadResources(Collection<String> dataPacks) {
|
public CompletableFuture<Void> reloadResources(Collection<String> dataPacks) {
|
||||||
+ return this.reloadResources(dataPacks, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.PLUGIN);
|
+ 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);
|
RegistryAccess.Frozen iregistrycustom_dimension = this.registries.getAccessForLoading(RegistryLayer.RELOADABLE);
|
||||||
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
|
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
|
||||||
Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error
|
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);
|
if (this.isSameThread()) {
|
||||||
this.resources.managers.updateRegistryTags(this.registryAccess());
|
|
||||||
+ 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/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 7108be7931e0a9e6240c18433d103659254b99af..2247d4452edbffb7c6c5dae4fe6e8e8f1fce4b5f 100644
|
index 7108be7931e0a9e6240c18433d103659254b99af..2247d4452edbffb7c6c5dae4fe6e8e8f1fce4b5f 100644
|
||||||
--- a/src/main/java/net/minecraft/server/commands/ReloadCommand.java
|
--- 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
|
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
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/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
|
@@ -2058,6 +2058,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@ -32,9 +32,9 @@ index 65a041165919b988d0e2113d12cdb035fbbcdbcc..0182d477dde8ed54bb6b0093a5040f38
|
|||||||
this.worldData.setDataConfiguration(worlddataconfiguration);
|
this.worldData.setDataConfiguration(worlddataconfiguration);
|
||||||
this.resources.managers.updateRegistryTags(this.registryAccess());
|
this.resources.managers.updateRegistryTags(this.registryAccess());
|
||||||
+ 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
|
|
||||||
// Paper start
|
// Paper start
|
||||||
if (Thread.currentThread() != this.serverThread) {
|
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
|
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
|
index 9fe5a680c0ad5624cebcd61fd8812e88d29fc209..6f5246f3cfc6b6757fad2a634299921df9d10223 100644
|
||||||
--- a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
--- a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
||||||
|
Loading…
Reference in New Issue
Block a user