diff --git a/Spigot-API-Patches/Add-command-to-reload-permissions.yml.patch b/Spigot-API-Patches/Add-command-to-reload-permissions.yml-and-require-co.patch similarity index 86% rename from Spigot-API-Patches/Add-command-to-reload-permissions.yml.patch rename to Spigot-API-Patches/Add-command-to-reload-permissions.yml-and-require-co.patch index c3fad7917c..81218cd5d3 100644 --- a/Spigot-API-Patches/Add-command-to-reload-permissions.yml.patch +++ b/Spigot-API-Patches/Add-command-to-reload-permissions.yml-and-require-co.patch @@ -1,9 +1,9 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 18 Mar 2016 03:28:07 -0400 -Subject: [PATCH] Add command to reload permissions.yml +Subject: [PATCH] Add command to reload permissions.yml and require confirm to + reload -https://github.com/PaperMC/Paper/issues/49 diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -53,16 +53,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (!testPermission(sender)) return true; -+ // Paper start - Reload permissions.yml (PAPER-49) ++ // Paper start - Reload permissions.yml & require confirm ++ boolean confirmed = false; + if (args.length == 1) { + if (args[0].equalsIgnoreCase("permissions")) { + Bukkit.getServer().reloadPermissions(); + Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Permissions successfully reloaded."); + return true; -+ } else { -+ return false; ++ } else if ("confirm".equalsIgnoreCase(args[0])) { ++ confirmed = true; + } + } ++ if (!confirmed) { ++ Command.broadcastCommandMessage(sender, ChatColor.RED + "Are you sure you wish to reload your server? Doing so may cause bugs and memory leaks. It is recommended to restart instead of using /reload. To confirm, please type " + ChatColor.YELLOW + "/reload confirm"); ++ return true; ++ } + // Paper end + Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues when using some plugins.");