From e649e4087652cac466822f14f25089830bd8ea47 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 19 Aug 2022 18:55:49 +0200 Subject: [PATCH] Fix StopCommand Signed-off-by: yoyosource --- .../steamwar/bausystem/features/world/StopCommand.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/StopCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/StopCommand.java index db1fdabd..a3256219 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/StopCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/StopCommand.java @@ -44,9 +44,13 @@ public class StopCommand extends SWCommand { Bukkit.getServer().shutdown(); } - @ClassMapper(value = Player.class, local = true) - public TypeValidator validator() { - return (commandSender, player, messageSender) -> { + @ClassMapper(value = CommandSender.class, local = true) + public TypeValidator validator() { + return (commandSender, sender, messageSender) -> { + if (!(sender instanceof Player)) { + return true; + } + Player player = (Player) sender; if (Permission.hasPermission(player, Permission.WORLD)) { return true; }