geforkt von Mirrors/Paper
ef0e5a642d
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 9ae3f10f SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API 48c0c547 PR-786: Add methods to get sounds from entities CraftBukkit Changes: 5cc9c022a SPIGOT-7152: Handle hand item changing during air interact event 4ffa1acf6 SPIGOT-7154: Players get kicked when interacting with a conversation 4daa21123 SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API e5d6a9bbf PR-1100: Add methods to get sounds from entities b7e9f1c8b SPIGOT-7146: Reduce use of Material switch in ItemMeta Spigot Changes: 4c157bb4 Rebuild patches
55 Zeilen
3.4 KiB
Diff
55 Zeilen
3.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
Date: Wed, 2 Dec 2020 20:04:01 -0800
|
|
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 f02fc7d6d8d0aba84be5e85c8de0ccc0e5a01c78..5c3b5cb0ffc3920da82b525bbc7a8963c981c595 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -1994,7 +1994,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
return this.functionManager;
|
|
}
|
|
|
|
+ // Paper start - add cause
|
|
+ @Deprecated
|
|
public CompletableFuture<Void> reloadResources(Collection<String> dataPacks) {
|
|
+ return this.reloadResources(dataPacks, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.PLUGIN);
|
|
+ }
|
|
+ public CompletableFuture<Void> reloadResources(Collection<String> dataPacks, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause cause) {
|
|
+ // Paper end
|
|
RegistryAccess.Frozen iregistrycustom_dimension = this.registryAccess();
|
|
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
|
|
Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error
|
|
@@ -2020,6 +2026,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.packRepository.setSelected(dataPacks);
|
|
this.worldData.setDataPackConfig(MinecraftServer.getSelectedPacks(this.packRepository));
|
|
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
|
|
index 1eb85de1d10829bfb4dbbfa01efd5656dee70090..19eacd1b1c3aca23f864a1867e004455312e82f7 100644
|
|
--- a/src/main/java/net/minecraft/server/commands/ReloadCommand.java
|
|
+++ b/src/main/java/net/minecraft/server/commands/ReloadCommand.java
|
|
@@ -20,7 +20,7 @@ public class ReloadCommand {
|
|
public ReloadCommand() {}
|
|
|
|
public static void reloadPacks(Collection<String> dataPacks, CommandSourceStack source) {
|
|
- source.getServer().reloadResources(dataPacks).exceptionally((throwable) -> {
|
|
+ source.getServer().reloadResources(dataPacks, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.COMMAND).exceptionally((throwable) -> {
|
|
ReloadCommand.LOGGER.warn("Failed to execute reload", throwable);
|
|
source.sendFailure(Component.translatable("commands.reload.failure"));
|
|
return null;
|
|
@@ -50,7 +50,7 @@ public class ReloadCommand {
|
|
WorldData savedata = minecraftserver.getWorldData();
|
|
Collection<String> collection = resourcepackrepository.getSelectedIds();
|
|
Collection<String> collection1 = ReloadCommand.discoverNewPacks(resourcepackrepository, savedata, collection);
|
|
- minecraftserver.reloadResources(collection1);
|
|
+ minecraftserver.reloadResources(collection1, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.PLUGIN); // Paper
|
|
}
|
|
// CraftBukkit end
|
|
|