Make /reload require typing confirm to actually reload
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: William <admin@domnian.com>
|
From: William <admin@domnian.com>
|
||||||
Date: Fri, 18 Mar 2016 03:28:07 -0400
|
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
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
@@ -53,16 +53,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+
|
+
|
||||||
if (!testPermission(sender)) return true;
|
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.length == 1) {
|
||||||
+ if (args[0].equalsIgnoreCase("permissions")) {
|
+ if (args[0].equalsIgnoreCase("permissions")) {
|
||||||
+ Bukkit.getServer().reloadPermissions();
|
+ Bukkit.getServer().reloadPermissions();
|
||||||
+ Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Permissions successfully reloaded.");
|
+ Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Permissions successfully reloaded.");
|
||||||
+ return true;
|
+ return true;
|
||||||
+ } else {
|
+ } else if ("confirm".equalsIgnoreCase(args[0])) {
|
||||||
+ return false;
|
+ 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
|
+ // Paper end
|
||||||
+
|
+
|
||||||
Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues when using some plugins.");
|
Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues when using some plugins.");
|
||||||
Reference in New Issue
Block a user