[ci skip] Cleanup events (#10202)

This commit is contained in:
Lulu13022002
2024-02-01 10:15:57 +01:00
parent d676979ea0
commit f7e469eb2e
187 changed files with 2415 additions and 2258 deletions

View File

@@ -17,6 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.command.CommandSender;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
@@ -25,11 +26,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Thrown when a player executes a command that is not defined
+ */
+public class UnknownCommandEvent extends Event {
+ private static final HandlerList handlers = new HandlerList();
+ @NotNull private CommandSender sender;
+ @NotNull private String commandLine;
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ @NotNull private final CommandSender sender;
+ @NotNull private final String commandLine;
+ @Nullable private Component message;
+
+ @ApiStatus.Internal
+ public UnknownCommandEvent(@NotNull final CommandSender sender, @NotNull final String commandLine, @Nullable final Component message) {
+ super(false);
+ this.sender = sender;
@@ -39,29 +43,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ /**
+ * Gets the CommandSender or ConsoleCommandSender
+ * <p>
+ *
+ * @return Sender of the command
+ */
+ @NotNull
+ public CommandSender getSender() {
+ return sender;
+ return this.sender;
+ }
+
+ /**
+ * Gets the command that was send
+ * <p>
+ * Gets the command that was sent
+ *
+ * @return Command sent
+ */
+ @NotNull
+ public String getCommandLine() {
+ return commandLine;
+ return this.commandLine;
+ }
+
+ /**
+ * Gets message that will be returned
+ * <p>
+ *
+ * @return Unknown command message
+ * @deprecated use {@link #message()}
@@ -75,9 +76,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ /**
+ * Sets message that will be returned
+ * <p>
+ * Set to null to avoid any message being sent
+ * Set to {@code null} to avoid any message being sent
+ *
+ * @param message the message to be returned, or null
+ * @param message the message to be returned, or {@code null}
+ * @deprecated use {@link #message(Component)}
+ */
+ @Deprecated
@@ -87,7 +88,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ /**
+ * Gets message that will be returned
+ * <p>
+ *
+ * @return Unknown command message
+ */
@@ -100,9 +100,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ /**
+ * Sets message that will be returned
+ * <p>
+ * Set to null to avoid any message being sent
+ * Set to {@code null} to avoid any message being sent
+ *
+ * @param message the message to be returned, or null
+ * @param message the message to be returned, or {@code null}
+ */
+ public void message(@Nullable Component message) {
+ this.message = message;
@@ -111,12 +111,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+}
+