From 950c4e427234c145caeda6962a0fa9b8ac64a5c0 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 6 Mar 2022 14:27:26 +0100 Subject: [PATCH 1/2] Add error message for user when executing command --- SpigotCore_Main/src/SpigotCore.properties | 2 ++ SpigotCore_Main/src/de/steamwar/command/SWCommand.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/SpigotCore_Main/src/SpigotCore.properties b/SpigotCore_Main/src/SpigotCore.properties index 8a7692d..2e52c4c 100644 --- a/SpigotCore_Main/src/SpigotCore.properties +++ b/SpigotCore_Main/src/SpigotCore.properties @@ -17,6 +17,8 @@ # along with this program. If not, see . # +COMMAND_SYSTEM_ERROR = §cFehler beim ausführen des Befehls! + SWLISINV_NEXT_PAGE_ACTIVE = §eSeite vor SWLISINV_NEXT_PAGE_INACTIVE = §7Seite vor SWLISINV_PREVIOUS_PAGE_ACTIVE = §eSeite zurück diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java index 6d58c5b..a96275d 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java @@ -19,6 +19,7 @@ package de.steamwar.command; +import de.steamwar.core.Core; import de.steamwar.message.Message; import lombok.Setter; import net.md_5.bungee.api.chat.ClickEvent; @@ -105,6 +106,7 @@ public abstract class SWCommand { if (Bukkit.getServer() != null) { Bukkit.getLogger().log(Level.SEVERE, "", e); } + Core.MESSAGE.send("COMMAND_SYSTEM_ERROR", sender); throw e; } } From 86faec3041ba44850c67759bd7dafb7200779a4f Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 7 Mar 2022 13:44:45 +0100 Subject: [PATCH 2/2] Fix SpigotCore.properties --- SpigotCore_Main/src/SpigotCore.properties | 2 +- SpigotCore_Main/src/de/steamwar/command/SWCommand.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SpigotCore_Main/src/SpigotCore.properties b/SpigotCore_Main/src/SpigotCore.properties index 2e52c4c..894dbf0 100644 --- a/SpigotCore_Main/src/SpigotCore.properties +++ b/SpigotCore_Main/src/SpigotCore.properties @@ -17,7 +17,7 @@ # along with this program. If not, see . # -COMMAND_SYSTEM_ERROR = §cFehler beim ausführen des Befehls! +COMMAND_SYSTEM_ERROR = §cFehler beim Ausführen des Befehls! SWLISINV_NEXT_PAGE_ACTIVE = §eSeite vor SWLISINV_NEXT_PAGE_INACTIVE = §7Seite vor diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java index a96275d..a5377df 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java @@ -106,7 +106,9 @@ public abstract class SWCommand { if (Bukkit.getServer() != null) { Bukkit.getLogger().log(Level.SEVERE, "", e); } - Core.MESSAGE.send("COMMAND_SYSTEM_ERROR", sender); + if (Core.MESSAGE != null) { + Core.MESSAGE.send("COMMAND_SYSTEM_ERROR", sender); + } throw e; } }