Merge remote-tracking branch 'origin/master'

This commit is contained in:
Ghost_chu committed 2021-06-15 13:33:00 +08:00
commit e92d213fb0
7 files changed
+115 -31

No files matched your search

@@ -26,32 +26,12 @@ import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
//For backward compatibility, have migrate to ICommandProcessor
@Deprecated
public interface CommandProcesser {
/**
* Accept the onCommand, it will call when have Command Event cmdArg not contains
* CommandContainer's prefix. E.g: Register the CommandContainer with Prefix: unlimited
* Permission: quickshop.unlimited
*
* <p>When player type /qs unlimited 123 cmdArg's content is 123
*
* @param sender Sender
* @param cmdArg Args
* @param commandLabel The command prefix /qs is qs
*/
void onCommand(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg);
/**
* Accept the onTabComplete, it will call when have Tab Event cmdArg not contains
* CommandContainer's prefix. E.g: Register the CommandContainer with Prefix: unlimited
* Permission: quickshop.unlimited
*
* <p>When player type /qs unlimited 123 cmdArg's content is 123
*
* @param sender Sender
* @param cmdArg Args
* @param commandLabel The command prefix /qs is qs
* @return The result for tab-complete lists
*/
@Nullable
default List<String> onTabComplete(
@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg) {
@@ -0,0 +1,46 @@
package org.maxgamer.quickshop.command.processor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
//For backward compatibility, implement CommandProcesser
public abstract class CommonCommandProcessor implements ICommandProcessor {
/**
* Accept the onCommand, it will call when have Command Event cmdArg not contains
* CommandContainer's prefix. E.g: Register the CommandContainer with Prefix: unlimited
* Permission: quickshop.unlimited
*
* <p>When player type /qs unlimited 123 the content of cmdArg is ["123"]
*
* @param sender Sender
* @param cmdArg Args
* @param commandLabel The command prefix /qs is qs
*/
public void onCommand(
@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg) {
throw new UnsupportedOperationException("Unimplemented command");
}
/**
* Accept the onTabComplete, it will call when have Tab Event cmdArg not contains
* CommandContainer's prefix. E.g: Register the CommandContainer with Prefix: unlimited
* Permission: quickshop.unlimited
*
* <p>When player type /qs unlimited 123 cmdArg's content is 123
*
* @param sender Sender
* @param cmdArg Args
* @param commandLabel The command prefix /qs is qs
* @return The result for tab-complete lists
*/
@Nullable
public List<String> onTabComplete(
@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg) {
return Collections.emptyList();
}
}
@@ -0,0 +1,20 @@
package org.maxgamer.quickshop.command.processor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.jetbrains.annotations.NotNull;
import org.maxgamer.quickshop.util.MsgUtil;
public abstract class ConsoleOnlyCommandProcessor implements ICommandProcessor {
public void onCommand(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg) {
if (sender instanceof ConsoleCommandSender) {
onCommand((ConsoleCommandSender) sender, commandLabel, cmdArg);
} else {
MsgUtil.sendMessage(sender, "This command is console only!");
}
}
abstract public void onCommand(@NotNull ConsoleCommandSender consoleCommandSender, @NotNull String commandLabel, @NotNull String[] cmdArg);
}
@@ -0,0 +1,20 @@
package org.maxgamer.quickshop.command.processor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.maxgamer.quickshop.command.CommandProcesser;
import java.util.Collections;
import java.util.List;
//For backward compatibility, extended CommandProcesser
interface ICommandProcessor extends CommandProcesser {
void onCommand(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg);
@Nullable
default List<String> onTabComplete(
@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg) {
return Collections.emptyList();
}
}
@@ -0,0 +1,18 @@
package org.maxgamer.quickshop.command.processor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.maxgamer.quickshop.util.MsgUtil;
public abstract class PlayerOnlyCommandProcessor implements ICommandProcessor {
public void onCommand(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] cmdArg) {
if (sender instanceof Player) {
onCommand((Player) sender, commandLabel, cmdArg);
} else {
MsgUtil.sendMessage(sender, "This command is player only!");
}
}
public abstract void onCommand(@NotNull Player player, @NotNull String commandLabel, @NotNull String[] cmdArg);
}
+6 -6
View File
@@ -7,8 +7,8 @@
"translation-country": "Language Zone: English (en_US)",
"language-version": "56",
"not-looking-at-shop": "&cCould not find a QuickShop. You need to look at one.",
"no-anythings-in-your-hand": "&cThere is nothing in your hand.",
"no-permission": "&cYou do not have permission to do that.",
"no-anythings-in-your-hand": "&Não tens nada na mão.",
"no-permission": "&cNão tens permissão para fazer isso.",
"integrations-check-failed-create": "&cIntegration {0} denied the shop-creation",
"integrations-check-failed-trade": "&cIntegration {0} denied the Shop trading",
"3rd-plugin-build-check-failed": "&c3rd party plugin &l{0}&r&c denied the permission checks, did you have permission setup in there?",
@@ -17,15 +17,15 @@
"supertool-is-disabled": "&cSupertool is disabled. Cannot break any shops.",
"no-double-chests": "&cYou cannot create the double chest shop.",
"not-managed-shop": "&cYou are not the owner or moderator of this Shop",
"shop-already-owned": "&cThis is already a shop.",
"chest-was-removed": "&cThe chest was removed.",
"shop-already-owned": "&cIsto já é uma loja.",
"chest-was-removed": "&cO baú foi removido.",
"price-too-cheap": "&cPrice must be greater than &e${0}",
"no-price-change": "&cThis wouldn't result in a price change!",
"you-cant-afford-a-new-shop": "&cIt costs {0} to create a new shop.",
"player-bought-from-your-store-tax": "&c{0} purchased {1} {2} from your shop, and you earned {3} ({4} in taxes).",
"you-cant-afford-to-change-price": "&cIt costs {0} to change the price in your shop.",
"success-created-shop": "&cShop created.",
"success-removed-shop": "&aShop removed.",
"success-created-shop": "&cLoja criada.",
"success-removed-shop": "&cLoja removida.",
"shops-arent-locked": "&cRemember, shops are NOT protected from theft! If you want to stop thieves, lock it with LWC, Lockette, etc!",
"shop-creation-cancelled": "&cShop creation cancelled.",
"shop-purchase-cancelled": "&cShop purchase cancelled.",
+2 -2
View File
@@ -22,7 +22,7 @@
"price-too-cheap": "&c價格必須大於 &e${0}",
"no-price-change": "&c這不會導致價格變動 !",
"you-cant-afford-a-new-shop": "&c需要花費 {0} 元才能建立商店。",
"player-bought-from-your-store-tax": "&c{0} 從你的商店購買了 {1} {2},你總共賺了 {3} 元 ({4} 元稅) 。",
"player-bought-from-your-store-tax": "&c{0} 從你的商店購買了 {1} {2},你總共賺了 {3} 元 ({4} 元的稅) 。",
"you-cant-afford-to-change-price": "&c你需要花費 {0} 元來修改商品價格。",
"success-created-shop": "&c已建立商店。",
"success-removed-shop": "&a已刪除商店。",
@@ -315,7 +315,7 @@
"item-not-exist": "&c物品&e {0}&c不存在,請檢查你的拼寫。 ",
"backup-success": "&a備份成功。",
"console-only": "&c該指令只能在控制台執行。",
"console-only-danger": "&c由於這個是一個有風險的指令 , 請你在控制台中執行。",
"console-only-danger": "&c由於這個是一個有風險的指令,請你在控制台中執行。",
"clean-warning": "&e此指令將清除&c&未裝載的世界商店&e及&c所有&e已損壞的、在不允許的世界中建立、或購買/販賣不允許商品的商店,請確保你已完全備份商店數據並使用 &b/qs cleanghost confirm &e以繼續。",
"shop-creation-failed": "&c商店建立失敗,請與伺服器管理員聯繫。",
"shop-owner-self-trade": "&e你正在跟自己開的商店進行交易 , 所以你的存款不會改變。",