From 481f2f1a2bbdf434de1478c69df546dc004c4291 Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Tue, 15 Jun 2021 13:38:34 +0800 Subject: [PATCH] sendMessage -> sendDirectMessage --- .../ConsoleOnlyCommandProcessor.java | 21 ++++++++++++++++++- .../processor/PlayerOnlyCommandProcessor.java | 21 ++++++++++++++++++- .../org/maxgamer/quickshop/util/MsgUtil.java | 1 + 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/command/processor/ConsoleOnlyCommandProcessor.java b/src/main/java/org/maxgamer/quickshop/command/processor/ConsoleOnlyCommandProcessor.java index 4a17b8f31..b767c6fcb 100644 --- a/src/main/java/org/maxgamer/quickshop/command/processor/ConsoleOnlyCommandProcessor.java +++ b/src/main/java/org/maxgamer/quickshop/command/processor/ConsoleOnlyCommandProcessor.java @@ -1,3 +1,22 @@ +/* + * This file is a part of project QuickShop, the name is ConsoleOnlyCommandProcessor.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 . + * + */ + package org.maxgamer.quickshop.command.processor; import org.bukkit.command.CommandSender; @@ -11,7 +30,7 @@ public abstract class ConsoleOnlyCommandProcessor implements ICommandProcessor { if (sender instanceof ConsoleCommandSender) { onCommand((ConsoleCommandSender) sender, commandLabel, cmdArg); } else { - MsgUtil.sendMessage(sender, "This command is console only!"); + MsgUtil.sendDirectMessage(sender, "This command is console only!"); } } diff --git a/src/main/java/org/maxgamer/quickshop/command/processor/PlayerOnlyCommandProcessor.java b/src/main/java/org/maxgamer/quickshop/command/processor/PlayerOnlyCommandProcessor.java index 027edef38..d2a92af4e 100644 --- a/src/main/java/org/maxgamer/quickshop/command/processor/PlayerOnlyCommandProcessor.java +++ b/src/main/java/org/maxgamer/quickshop/command/processor/PlayerOnlyCommandProcessor.java @@ -1,3 +1,22 @@ +/* + * This file is a part of project QuickShop, the name is PlayerOnlyCommandProcessor.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 . + * + */ + package org.maxgamer.quickshop.command.processor; import org.bukkit.command.CommandSender; @@ -10,7 +29,7 @@ public abstract class PlayerOnlyCommandProcessor implements ICommandProcessor { if (sender instanceof Player) { onCommand((Player) sender, commandLabel, cmdArg); } else { - MsgUtil.sendMessage(sender, "This command is player only!"); + MsgUtil.sendDirectMessage(sender, "This command is player only!"); } } diff --git a/src/main/java/org/maxgamer/quickshop/util/MsgUtil.java b/src/main/java/org/maxgamer/quickshop/util/MsgUtil.java index c3e6fcef0..c5cdc1195 100644 --- a/src/main/java/org/maxgamer/quickshop/util/MsgUtil.java +++ b/src/main/java/org/maxgamer/quickshop/util/MsgUtil.java @@ -115,6 +115,7 @@ public class MsgUtil { for (String msg : msgs) { if (p.getPlayer() != null) { Util.debugLog("Accepted the msg for player " + p.getName() + " : " + msg); + // TODO: Use json message instead ########## stupid thing String[] msgData = msg.split("##########"); if (msgData.length == 3) { try {