Add @Override

This commit is contained in:
Ghost_chu committed 2021-06-15 13:39:23 +08:00
1 parent 481f2f1a2b
commit dd98bc9bfb
4 files changed
+44

No files matched your search

@@ -1,3 +1,22 @@
/*
* This file is a part of project QuickShop, the name is CommonCommandProcessor.java
* Copyright (C) PotatoCraft Studio and contributors
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.maxgamer.quickshop.command.processor;
import org.bukkit.command.CommandSender;
@@ -20,6 +39,7 @@ public abstract class CommonCommandProcessor implements ICommandProcessor {
* @param cmdArg Args
* @param commandLabel The command prefix /qs is qs
*/
@Override
public void onCommand(
@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg) {
@@ -38,6 +58,7 @@ public abstract class CommonCommandProcessor implements ICommandProcessor {
* @param commandLabel The command prefix /qs is qs
* @return The result for tab-complete lists
*/
@Override
@Nullable
public List<String> onTabComplete(
@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg) {
@@ -26,6 +26,7 @@ import org.maxgamer.quickshop.util.MsgUtil;
public abstract class ConsoleOnlyCommandProcessor implements ICommandProcessor {
@Override
public void onCommand(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg) {
if (sender instanceof ConsoleCommandSender) {
onCommand((ConsoleCommandSender) sender, commandLabel, cmdArg);
@@ -1,3 +1,22 @@
/*
* This file is a part of project QuickShop, the name is ICommandProcessor.java
* Copyright (C) PotatoCraft Studio and contributors
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.maxgamer.quickshop.command.processor;
import org.bukkit.command.CommandSender;
@@ -10,8 +29,10 @@ import java.util.List;
//For backward compatibility, extended CommandProcesser
interface ICommandProcessor extends CommandProcesser {
@Override
void onCommand(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg);
@Override
@Nullable
default List<String> onTabComplete(
@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg) {
@@ -25,6 +25,7 @@ import org.jetbrains.annotations.NotNull;
import org.maxgamer.quickshop.util.MsgUtil;
public abstract class PlayerOnlyCommandProcessor implements ICommandProcessor {
@Override
public void onCommand(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg) {
if (sender instanceof Player) {
onCommand((Player) sender, commandLabel, cmdArg);