From 6cf9665d3570eaef72039f7d7628d3a636763fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9D=8F=E9=BB=91?= Date: Wed, 4 Jul 2018 21:59:08 +0800 Subject: [PATCH] =?UTF-8?q?+=20HikariHandler=20=E6=96=B0=E5=A2=9E=20create?= =?UTF-8?q?DataSource=20=E6=96=B9=E6=B3=95=E7=94=A8=E4=BA=8E=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=AF=BC=E5=85=A5=20HikariCP=20=E5=BA=93=E7=9A=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BD=BF=E7=94=A8=E3=80=82=20+=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20/texecute=20=E6=8C=87=E4=BB=A4=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E5=BC=BA=E5=88=B6=E7=9B=AE=E6=A0=87=E6=89=A7=E8=A1=8C=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E6=88=96=E5=8F=91=E9=80=81=E8=81=8A=E5=A4=A9=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E3=80=82=20+=20=E6=96=B0=E5=A2=9E=20hikarisettings.ym?= =?UTF-8?q?l=20=E9=85=8D=E7=BD=AE=E7=94=A8=E4=BA=8E=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=BF=9E=E6=8E=A5=E6=B1=A0=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E3=80=82=20o=20=E4=BF=AE=E5=A4=8D=20HikariHandler=20=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=88=9B=E5=BB=BA=E8=BF=9E=E6=8E=A5=E6=B1=A0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82=20o=20=E4=BF=AE=E5=A4=8D=20SQLTable?= =?UTF-8?q?=20=E4=B8=AD=20addColumn=20=E6=96=B9=E6=B3=95=E6=97=A0=E6=95=88?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/me/skymc/taboolib/Main.java | 31 ++--- .../commands/TabooLibExecuteCommand.java | 116 ++++++++++++++++++ ...ommand.java => TabooLibPluginCommand.java} | 2 +- .../skymc/taboolib/mysql/builder/SQLHost.java | 5 +- .../taboolib/mysql/builder/SQLTable.java | 12 +- .../taboolib/mysql/hikari/HikariHandler.java | 87 ++++++------- .../me/skymc/taboolib/update/UpdateTask.java | 1 - src/main/resources/hikarisettings.yml | 32 +++++ src/main/resources/lang/zh_CN.yml | 14 +++ src/main/resources/plugin.yml | 3 + 10 files changed, 223 insertions(+), 80 deletions(-) create mode 100644 src/main/java/me/skymc/taboolib/commands/TabooLibExecuteCommand.java rename src/main/java/me/skymc/taboolib/commands/plugin/{TabooLibPluginMainCommand.java => TabooLibPluginCommand.java} (99%) create mode 100644 src/main/resources/hikarisettings.yml diff --git a/src/main/java/me/skymc/taboolib/Main.java b/src/main/java/me/skymc/taboolib/Main.java index 20f0dd5..c4bc82a 100644 --- a/src/main/java/me/skymc/taboolib/Main.java +++ b/src/main/java/me/skymc/taboolib/Main.java @@ -8,11 +8,12 @@ import com.ilummc.tlib.util.IO; import com.ilummc.tlib.util.Strings; import me.skymc.taboolib.anvil.AnvilContainerAPI; import me.skymc.taboolib.bstats.Metrics; +import me.skymc.taboolib.commands.TabooLibExecuteCommand; import me.skymc.taboolib.commands.TabooLibMainCommand; import me.skymc.taboolib.commands.internal.TBaseCommand; import me.skymc.taboolib.commands.language.Language2Command; import me.skymc.taboolib.commands.locale.TabooLibLocaleCommand; -import me.skymc.taboolib.commands.plugin.TabooLibPluginMainCommand; +import me.skymc.taboolib.commands.plugin.TabooLibPluginCommand; import me.skymc.taboolib.commands.taboolib.listener.ListenerItemListCommand; import me.skymc.taboolib.commands.taboolib.listener.ListenerSoundsCommand; import me.skymc.taboolib.database.GlobalDataManager; @@ -45,6 +46,7 @@ import me.skymc.taboolib.update.UpdateTask; import me.skymc.tlm.TLM; import me.skymc.tlm.command.TLMCommands; import me.skymc.tlm.module.TabooLibraryModule; +import net.milkbowl.vault.economy.Economy; import org.bukkit.Bukkit; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.event.Listener; @@ -74,25 +76,15 @@ public class Main extends JavaPlugin implements Listener { } private static Plugin inst; - - private static net.milkbowl.vault.economy.Economy Economy; - + private static Economy economy; private static File playerDataFolder; - private static File serverDataFolder; - private static StorageType storageType = StorageType.LOCAL; - - private static boolean disable = false; - private static MySQLConnection connection = null; - private static Language2 exampleLanguage2; - - private static boolean started; - + private static boolean disable = false; + private static boolean started = false; private static boolean isInternetOnline = false; - private FileConfiguration config = null; @Override @@ -132,6 +124,8 @@ public class Main extends JavaPlugin implements Listener { setupLibraries(); // 载入牛逼玩意儿 TLib.initPost(); + // 注册连接池 + HikariHandler.init(); } @Override @@ -348,7 +342,8 @@ public class Main extends JavaPlugin implements Listener { getCommand("taboolibrarymodule").setExecutor(new TLMCommands()); TBaseCommand.registerCommand("taboolib", new TabooLibMainCommand()); TBaseCommand.registerCommand("tabooliblocale", new TabooLibLocaleCommand()); - TBaseCommand.registerCommand("taboolibplugin", new TabooLibPluginMainCommand()); + TBaseCommand.registerCommand("taboolibplugin", new TabooLibPluginCommand()); + TBaseCommand.registerCommand("taboolibexecute", new TabooLibExecuteCommand()); TBaseCommand.registerCommand("translateuuid", new TranslateUUIDCommand()); } @@ -390,11 +385,11 @@ public class Main extends JavaPlugin implements Listener { } public static net.milkbowl.vault.economy.Economy getEconomy() { - return Economy; + return economy; } - public static void setEconomy(net.milkbowl.vault.economy.Economy economy) { - Economy = economy; + public static void setEconomy(Economy economy) { + this.economy = economy; } public static File getPlayerDataFolder() { diff --git a/src/main/java/me/skymc/taboolib/commands/TabooLibExecuteCommand.java b/src/main/java/me/skymc/taboolib/commands/TabooLibExecuteCommand.java new file mode 100644 index 0000000..f83d847 --- /dev/null +++ b/src/main/java/me/skymc/taboolib/commands/TabooLibExecuteCommand.java @@ -0,0 +1,116 @@ +package me.skymc.taboolib.commands; + +import com.ilummc.tlib.resources.TLocale; +import com.ilummc.tlib.util.Strings; +import me.skymc.taboolib.commands.internal.BaseMainCommand; +import me.skymc.taboolib.commands.internal.BaseSubCommand; +import me.skymc.taboolib.commands.internal.type.CommandArgument; +import me.skymc.taboolib.commands.internal.type.CommandRegister; +import me.skymc.taboolib.string.ArrayUtils; +import org.bukkit.Bukkit; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.bukkit.event.server.ServerCommandEvent; + +/** + * @Author sky + * @Since 2018-07-04 21:32 + */ +public class TabooLibExecuteCommand extends BaseMainCommand { + + @Override + public String getCommandTitle() { + return TLocale.asString("COMMANDS.TEXECUTE.COMMAND-TITLE"); + } + + @CommandRegister(priority = 1) + BaseSubCommand chat = new BaseSubCommand() { + @Override + public String getLabel() { + return "chat"; + } + + @Override + public String getDescription() { + return TLocale.asString("COMMANDS.TEXECUTE.CHAT.DESCRIPTION"); + } + + @Override + public CommandArgument[] getArguments() { + return new CommandArgument[] { + new CommandArgument(TLocale.asString("COMMANDS.TEXECUTE.CHAT.ARGUMENTS.0")), + new CommandArgument(TLocale.asString("COMMANDS.TEXECUTE.CHAT.ARGUMENTS.1")) + }; + } + + @Override + public void onCommand(CommandSender sender, Command command, String label, String[] args) { + Player player = Bukkit.getPlayerExact(args[0]); + if (player == null) { + TLocale.sendTo(sender, "INVALID-PLAYER-OFFLINE", args[0]); + return; + } + player.chat(ArrayUtils.arrayJoin(args, 1)); + } + }; + + @CommandRegister(priority = 1) + BaseSubCommand command = new BaseSubCommand() { + @Override + public String getLabel() { + return "command"; + } + + @Override + public String getDescription() { + return TLocale.asString("COMMANDS.TEXECUTE.COMMAND.DESCRIPTION"); + } + + @Override + public CommandArgument[] getArguments() { + return new CommandArgument[] { + new CommandArgument(TLocale.asString("COMMANDS.TEXECUTE.COMMAND.ARGUMENTS.0")), + new CommandArgument(TLocale.asString("COMMANDS.TEXECUTE.COMMAND.ARGUMENTS.1")) + }; + } + + @Override + public void onCommand(CommandSender sender, Command command, String label, String[] args) { + if (args[0].equalsIgnoreCase("console")) { + dispatchCommand(Bukkit.getConsoleSender(), ArrayUtils.arrayJoin(args, 1)); + return; + } + Player player = Bukkit.getPlayerExact(args[0]); + if (player == null) { + TLocale.sendTo(sender, "INVALID-TARGET-NOT-FOUND", args[0]); + return; + } + dispatchCommand(player, ArrayUtils.arrayJoin(args, 1)); + } + }; + + public static boolean dispatchCommand(CommandSender sender, String command) { + try { + if ((sender instanceof Player)) { + PlayerCommandPreprocessEvent e = new PlayerCommandPreprocessEvent((Player) sender, "/" + command); + Bukkit.getPluginManager().callEvent(e); + if (e.isCancelled() || Strings.isBlank(e.getMessage()) || !e.getMessage().startsWith("/")) { + return false; + } + return Bukkit.dispatchCommand(e.getPlayer(), e.getMessage().substring(1)); + } else { + ServerCommandEvent e = new ServerCommandEvent(sender, command); + Bukkit.getPluginManager().callEvent(e); + if (e.isCancelled() || Strings.isBlank(e.getCommand())) { + return false; + } + return Bukkit.dispatchCommand(e.getSender(), e.getCommand()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } +} diff --git a/src/main/java/me/skymc/taboolib/commands/plugin/TabooLibPluginMainCommand.java b/src/main/java/me/skymc/taboolib/commands/plugin/TabooLibPluginCommand.java similarity index 99% rename from src/main/java/me/skymc/taboolib/commands/plugin/TabooLibPluginMainCommand.java rename to src/main/java/me/skymc/taboolib/commands/plugin/TabooLibPluginCommand.java index 42a0a86..2cc8b40 100644 --- a/src/main/java/me/skymc/taboolib/commands/plugin/TabooLibPluginMainCommand.java +++ b/src/main/java/me/skymc/taboolib/commands/plugin/TabooLibPluginCommand.java @@ -25,7 +25,7 @@ import java.util.stream.Collectors; * @Author sky * @Since 2018-05-07 20:14 */ -public class TabooLibPluginMainCommand extends BaseMainCommand { +public class TabooLibPluginCommand extends BaseMainCommand { @Override public String getCommandTitle() { diff --git a/src/main/java/me/skymc/taboolib/mysql/builder/SQLHost.java b/src/main/java/me/skymc/taboolib/mysql/builder/SQLHost.java index 2c5448c..13e9c15 100644 --- a/src/main/java/me/skymc/taboolib/mysql/builder/SQLHost.java +++ b/src/main/java/me/skymc/taboolib/mysql/builder/SQLHost.java @@ -78,13 +78,12 @@ public class SQLHost { Objects.equals(getUser(), sqlHost.getUser()) && Objects.equals(getPort(), sqlHost.getPort()) && Objects.equals(getPassword(), sqlHost.getPassword()) && - Objects.equals(getDatabase(), sqlHost.getDatabase()) && - Objects.equals(getPlugin(), sqlHost.getPlugin()); + Objects.equals(getDatabase(), sqlHost.getDatabase()); } @Override public int hashCode() { - return Objects.hash(getHost(), getUser(), getPort(), getPassword(), getDatabase(), getPlugin()); + return Objects.hash(getHost(), getUser(), getPort(), getPassword(), getDatabase()); } @Override diff --git a/src/main/java/me/skymc/taboolib/mysql/builder/SQLTable.java b/src/main/java/me/skymc/taboolib/mysql/builder/SQLTable.java index 7b61de4..ed2e5f5 100644 --- a/src/main/java/me/skymc/taboolib/mysql/builder/SQLTable.java +++ b/src/main/java/me/skymc/taboolib/mysql/builder/SQLTable.java @@ -1,11 +1,12 @@ package me.skymc.taboolib.mysql.builder; -import com.google.common.base.Preconditions; import com.ilummc.tlib.util.Strings; import me.skymc.taboolib.mysql.builder.query.RunnableQuery; import me.skymc.taboolib.mysql.builder.query.RunnableUpdate; import me.skymc.taboolib.string.ArrayUtils; +import java.util.Arrays; + /** * @Author sky * @Since 2018-05-14 19:07 @@ -26,19 +27,16 @@ public class SQLTable { public SQLTable addColumn(SQLColumn sqlColumn) { if (columns == null) { - columns = new SQLColumn[]{sqlColumn}; + columns = new SQLColumn[] {sqlColumn}; } else { - ArrayUtils.arrayAppend(columns, sqlColumn); + columns = ArrayUtils.arrayAppend(columns, sqlColumn); } return this; } public String createQuery() { - Preconditions.checkNotNull(columns); StringBuilder builder = new StringBuilder(); - for (SQLColumn sqlColumn : columns) { - builder.append(sqlColumn.convertToCommand()).append(", "); - } + Arrays.stream(columns).forEach(sqlColumn -> builder.append(sqlColumn.convertToCommand()).append(", ")); return Strings.replaceWithOrder("create table if not exists `{0}` ({1})", tableName, builder.substring(0, builder.length() - 2)); } diff --git a/src/main/java/me/skymc/taboolib/mysql/hikari/HikariHandler.java b/src/main/java/me/skymc/taboolib/mysql/hikari/HikariHandler.java index 4a65e96..410c3f5 100644 --- a/src/main/java/me/skymc/taboolib/mysql/hikari/HikariHandler.java +++ b/src/main/java/me/skymc/taboolib/mysql/hikari/HikariHandler.java @@ -5,8 +5,13 @@ import com.ilummc.tlib.resources.TLocale; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; import me.skymc.taboolib.Main; +import me.skymc.taboolib.fileutils.ConfigUtils; +import me.skymc.taboolib.fileutils.FileUtils; import me.skymc.taboolib.mysql.builder.SQLHost; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; +import javax.sql.DataSource; import java.util.concurrent.ConcurrentHashMap; /** @@ -16,14 +21,16 @@ import java.util.concurrent.ConcurrentHashMap; public class HikariHandler { private static ConcurrentHashMap dataSource = new ConcurrentHashMap<>(); + private static FileConfiguration settings; + + public static void init() { + settings = ConfigUtils.saveDefaultConfig(Main.getInst(), "hikarisettings.yml"); + } + + public static DataSource createDataSource(SQLHost host) { + return createDataSource(host, null); + } - /** - * 根据数据库地址创建连接池,如果已经存在则返回引用 - * - * @param host 数据库地址 - * @return {@link HikariDataSource} - * @throws java.sql.SQLException 数据库连接失败异常 - */ public static HikariDataSource createDataSource(SQLHost host, HikariConfig hikariConfig) { MapDataSource mapDataSource = dataSource.computeIfAbsent(host, x -> new MapDataSource(x, new HikariDataSource(hikariConfig == null ? createConfig(host) : hikariConfig))); mapDataSource.getActivePlugin().getAndIncrement(); @@ -35,21 +42,11 @@ public class HikariHandler { return mapDataSource.getHikariDataSource(); } - /** - * 强制注销所有已注册的连接池 - * 只能在 TabooLib 卸载后调用 - */ public static void closeDataSourceForce() { Preconditions.checkArgument(Main.isDisable(), "Cannot be invoked when the server is running."); dataSource.values().forEach(x -> x.getHikariDataSource().close()); } - /** - * 注销连接池 - * 如果连接池有 1 个以上的插件正在使用则跳过,反之则注销并从缓存中移除 - * - * @param host 地址 - */ public static void closeDataSource(SQLHost host) { if (host != null && dataSource.containsKey(host)) { MapDataSource mapDataSource = dataSource.get(host); @@ -63,45 +60,35 @@ public class HikariHandler { } } - /** - * 根据数据库地址创建 HikariConfig 对象 - * - * @param sqlHost 数据库地址 - * @return {@link HikariConfig} - */ public static HikariConfig createConfig(SQLHost sqlHost) { HikariConfig config = new HikariConfig(); - config.setDriverClassName("com.mysql.jdbc.Driver"); + config.setDriverClassName(settings.getString("DefaultSettings.DriverClassName", "com.mysql.jdbc.Driver")); config.setJdbcUrl(sqlHost.getConnectionUrl()); config.setUsername(sqlHost.getUser()); config.setPassword(sqlHost.getPassword()); config.setConnectionTestQuery("SELECT 1"); - config.setAutoCommit(true); - config.setMinimumIdle(1); - config.setMaximumPoolSize(10); - // 用来指定验证连接有效性的超时时间(毫秒/默认: 5秒) - config.setValidationTimeout(3000); - // 等待连接池分配连接的最大时长(毫秒/默认: 30秒),超过这个时长还没可用的连接则发生 SQLException - config.setConnectionTimeout(10000); - // 一个连接idle状态的最大时长(毫秒/默认: 10分钟),超时则被释放 - config.setIdleTimeout(60000); - // 一个连接的生命时长(毫秒/默认: 30分钟),超时而且没被使用则被释放 - config.setMaxLifetime(60000); - // 是否自定义配置,为true时下面两个参数才生效 - config.addDataSourceProperty("cachePrepStmts", "true"); - // 连接池大小默认25,官方推荐250-500 - config.addDataSourceProperty("prepStmtCacheSize", "250"); - // 单条语句最大长度默认256,官方推荐2048 - config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); - // 新版本MySQL支持服务器端准备,开启能够得到显著性能提升 - config.addDataSourceProperty("useServerPrepStmts", "true"); - config.addDataSourceProperty("useLocalSessionState", "true"); - config.addDataSourceProperty("useLocalTransactionState", "true"); - config.addDataSourceProperty("rewriteBatchedStatements", "true"); - config.addDataSourceProperty("cacheResultSetMetadata", "true"); - config.addDataSourceProperty("cacheServerConfiguration", "true"); - config.addDataSourceProperty("elideSetAutoCommits", "true"); - config.addDataSourceProperty("maintainTimeStats", "false"); + config.setAutoCommit(settings.getBoolean("DefaultSettings.AutoCommit", true)); + config.setMinimumIdle(settings.getInt("DefaultSettings.MinimumIdle", 1)); + config.setMaximumPoolSize(settings.getInt("DefaultSettings.MaximumPoolSize", 10)); + config.setValidationTimeout(settings.getInt("DefaultSettings.ValidationTimeout", 3000)); + config.setConnectionTimeout(settings.getInt("DefaultSettings.ConnectionTimeout", 10000)); + config.setIdleTimeout(settings.getInt("DefaultSettings.IdleTimeout", 60000)); + config.setMaxLifetime(settings.getInt("DefaultSettings.MaxLifetime", 60000)); + if (settings.contains("DefaultSettings.DataSourceProperty")) { + settings.getConfigurationSection("DefaultSettings.DataSourceProperty").getKeys(false).forEach(key -> config.addDataSourceProperty(key, settings.getString("DefaultSettings.DataSourceProperty." + key))); + } else { + config.addDataSourceProperty("cachePrepStmts", "true"); + config.addDataSourceProperty("prepStmtCacheSize", "250"); + config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); + config.addDataSourceProperty("useServerPrepStmts", "true"); + config.addDataSourceProperty("useLocalSessionState", "true"); + config.addDataSourceProperty("useLocalTransactionState", "true"); + config.addDataSourceProperty("rewriteBatchedStatements", "true"); + config.addDataSourceProperty("cacheResultSetMetadata", "true"); + config.addDataSourceProperty("cacheServerConfiguration", "true"); + config.addDataSourceProperty("elideSetAutoCommits", "true"); + config.addDataSourceProperty("maintainTimeStats", "false"); + } return config; } } diff --git a/src/main/java/me/skymc/taboolib/update/UpdateTask.java b/src/main/java/me/skymc/taboolib/update/UpdateTask.java index 790e709..0bb475f 100644 --- a/src/main/java/me/skymc/taboolib/update/UpdateTask.java +++ b/src/main/java/me/skymc/taboolib/update/UpdateTask.java @@ -6,7 +6,6 @@ import com.google.gson.JsonParser; import com.ilummc.tlib.resources.TLocale; import me.skymc.taboolib.Main; import me.skymc.taboolib.TabooLib; -import me.skymc.taboolib.commands.plugin.TabooLibPluginMainCommand; import me.skymc.taboolib.fileutils.FileUtils; import org.bukkit.Bukkit; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/main/resources/hikarisettings.yml b/src/main/resources/hikarisettings.yml new file mode 100644 index 0000000..81b6f5b --- /dev/null +++ b/src/main/resources/hikarisettings.yml @@ -0,0 +1,32 @@ +# 默认连接池配置 +DefaultSettings: + DriverClassName: 'com.mysql.jdbc.Driver' + AutoCommit: true + MinimumIdle: 1 + # 连接池大小 + MaximumPoolSize: 10 + # 用来指定验证连接有效性的超时时间(毫秒/默认: 5秒) + ValidationTimeout: 3000 + # 等待连接池分配连接的最大时长(毫秒/默认: 30秒) + # 超过这个时长还没可用的连接则发生 SQLException + ConnectionTimeout: 10000 + # 一个连接idle状态的最大时长(毫秒/默认: 10分钟),超时则被释放 + IdleTimeout: 60000 + # 一个连接的生命时长(毫秒/默认: 30分钟),超时而且没被使用则被释放 + MaxLifetime: 60000 + # 是否自定义配置,为true时下面两个参数才生效 + DataSourceProperty: + cachePrepStmts: true + # 连接池大小默认25,官方推荐250-500 + prepStmtCacheSize: 250 + # 单条语句最大长度默认256,官方推荐2048 + prepStmtCacheSqlLimit: 2048 + # 新版本MySQL支持服务器端准备,开启能够得到显著性能提升 + useServerPrepStmts: true + useLocalSessionState: true + useLocalTransactionState: true + rewriteBatchedStatements: true + cacheResultSetMetadata: true + cacheServerConfiguration: true + elideSetAutoCommits: true + maintainTimeStats: false \ No newline at end of file diff --git a/src/main/resources/lang/zh_CN.yml b/src/main/resources/lang/zh_CN.yml index e1f72cd..a727276 100644 --- a/src/main/resources/lang/zh_CN.yml +++ b/src/main/resources/lang/zh_CN.yml @@ -533,6 +533,20 @@ COMMANDS: RELOAD: DESCRIPTION: '重载配置及数据库' SUCCESS: '&8[&3&lTabooLib&8] &7请求已发送, 详细信息请查看控制台' + TEXECUTE: + COMMAND-TITLE: '&e&l----- &6&lTabooLibExecute Commands &e&l-----' + CHAT: + DESCRIPTION: '使玩家输入聊天内容' + ARGUMENTS: + 0: '玩家' + 1: '内容' + INVALID-PLAYER-OFFLINE: '&8[&3&lTabooLib&8] &4玩家 &c{0} &4不在线.' + COMMAND: + DESCRIPTION: '使目标输入执行指令' + ARGUMENTS: + 0: '目标' + 1: '内容' + INVALID-TARGET-NOT-FOUND: '&8[&3&lTabooLib&8] &4目标 &c{0} &4不存在.' DATABASE: CONNECTION-ESTABLISHED: '成功连接到 {0} 数据库,连接池大小 {1}' diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index ccf4e28..2a0c06d 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -21,6 +21,9 @@ commands: taboolibplugin: aliases: [tabooplugin, tplugin] permission: taboolib.admin + taboolibexecute: + aliases: [texecute] + permission: taboolib.admin taboolibrarymodule: aliases: [tlm] translateuuid: