commit 2ccedd7c424cdd9520206791e2b56cc136fa943a
parent 1689c75ebcd32314e65e093b33362241761f6c76
Author: chunksize <reisingerluca@gmail.com>
Date: Fri, 6 Sep 2024 03:51:51 +0200
feat: Added reload command
Diffstat:
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/res/plugin.yml b/res/plugin.yml
@@ -10,3 +10,6 @@ commands:
skull:
usage: /skull <player>
description: Gives a skull of the specific player.
+ r:
+ usage: /r
+ description: Reload the server
diff --git a/src/poppy/Main.java b/src/poppy/Main.java
@@ -102,6 +102,8 @@ public class Main extends JavaPlugin {
return setItemAsHead(player, args);
case "skull":
return getSkullForName(player, args);
+ case "r":
+ return reload(player, args);
default:
return false;
}
@@ -124,6 +126,15 @@ public class Main extends JavaPlugin {
}
return true;
}
+
+ private boolean reload(final Player player, final String[] args) {
+ if (!player.isOp()) {
+ player.sendMessage(Constants.Messages.NOT_ENOUGH_PERMISSION);
+ return true;
+ }
+ player.chat("/reload confirm");
+ return true;
+ }
@SuppressWarnings("deprecation")
private boolean getSkullForName(final Player player, final String[] args) {