From f2147e62823d57f8d508f10e7877cdd43774e9d1 Mon Sep 17 00:00:00 2001 From: huda0209 Date: Fri, 10 Sep 2021 02:39:12 +0900 Subject: [PATCH] =?UTF-8?q?[del]cnewswitchgroup=E3=82=B3=E3=83=9E=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=82=92=E5=89=8A=E9=99=A4=20-NewSwitchGroupCommandEx?= =?UTF-8?q?ecutor.java=20=E5=89=8A=E9=99=A4=20-AziSwitch.java=20cnewswitch?= =?UTF-8?q?group=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=E3=81=AE=E7=99=BB?= =?UTF-8?q?=E9=8C=B2=E3=82=92=E5=89=8A=E9=99=A4=20-plugin.yml=20cnewswitch?= =?UTF-8?q?group=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=E3=81=AE=E7=99=BB?= =?UTF-8?q?=E9=8C=B2=E3=82=92=E5=89=8A=E9=99=A4=20-build.gradle=20?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=921.2.0?= =?UTF-8?q?=E3=81=AB=E3=82=A2=E3=83=83=E3=83=97=E3=83=87=E3=83=BC=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- .../github/mori01231/aziswitch/AziSwitch.java | 1 - .../NewSwitchGroupCommandExecutor.java | 73 ------------------- src/main/resources/plugin.yml | 3 - 4 files changed, 1 insertion(+), 78 deletions(-) delete mode 100644 src/main/java/com/github/mori01231/aziswitch/NewSwitchGroupCommandExecutor.java diff --git a/build.gradle b/build.gradle index b4cdf1b..4911942 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ import org.apache.tools.ant.filters.ReplaceTokens apply plugin: 'java' group = 'com.github.Mori01231' -version = '1.1.0' +version = '1.2.0' sourceCompatibility = '1.8' targetCompatibility = '1.8' diff --git a/src/main/java/com/github/mori01231/aziswitch/AziSwitch.java b/src/main/java/com/github/mori01231/aziswitch/AziSwitch.java index d63aa37..208fa77 100644 --- a/src/main/java/com/github/mori01231/aziswitch/AziSwitch.java +++ b/src/main/java/com/github/mori01231/aziswitch/AziSwitch.java @@ -23,7 +23,6 @@ public void onEnable() { configManager.loadConfig(); this.getCommand("switch").setExecutor(new SwitchCommandExecutor()); - this.getCommand("newswitchgroup").setExecutor(new NewSwitchGroupCommandExecutor()); getServer().getPluginManager().registerEvents(new PlayerJoinEventListener(),this); } diff --git a/src/main/java/com/github/mori01231/aziswitch/NewSwitchGroupCommandExecutor.java b/src/main/java/com/github/mori01231/aziswitch/NewSwitchGroupCommandExecutor.java deleted file mode 100644 index 1f9b51b..0000000 --- a/src/main/java/com/github/mori01231/aziswitch/NewSwitchGroupCommandExecutor.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.github.mori01231.aziswitch; - -import org.bukkit.ChatColor; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; - -import java.util.List; - -import static org.bukkit.Bukkit.getServer; - -public class NewSwitchGroupCommandExecutor implements CommandExecutor { - private final String pluginName = AziSwitch.getInstance().getDescription().getPrefix(); - - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - - // First argument is the group name. - String groupName = args[0]; - - // Initial variable to indicate mode. - String creationMode = "all"; - - // Determine mode - if(args.length >= 2){ - // Set creation mode to single if the second argument is "single" - if(args[1].equalsIgnoreCase("single")){ - creationMode = "single"; - } - - // if the second argument is invalid, give an error and return - else if(!args[1].equalsIgnoreCase("all")){ - sender.sendMessage(ChatColor.translateAlternateColorCodes('&',"&7[&b"+pluginName+"&7]&r &cモードはsingleもしくはallで設定してください。" )); - return true; - } - } - - // Make a group a switch group for a single server. - if(creationMode.equalsIgnoreCase("single")){ - // Add the group to the list of single server groups in config. - List singleServerGroups = AziSwitch.getInstance().getConfig().getStringList("SingleServerGroups"); - singleServerGroups.add(groupName); - configManager.setSingleServerGroups(singleServerGroups); - - createGroups(groupName); - } - - // Make a group a switch group for all servers. - else{ - // Add the group to the list of all server groups in config. - List allServerGroups = AziSwitch.getInstance().getConfig().getStringList("AllServerGroups"); - allServerGroups.add(groupName); - configManager.setAllServerGroups(allServerGroups); - - createGroups(groupName); - } - - return true; - } - - public void createGroups(String groupName){ - sendCommand("lp creategroup " + groupName); - sendCommand("lp g " + groupName + " permission set aziswitch.* false"); - sendCommand("lp g " + groupName + " permission set aziswitch.is" + groupName + " true"); - sendCommand("lp creategroup switch" + groupName); - sendCommand("lp g switch" + groupName + " permission set aziswitch.* false"); - sendCommand("lp g switch" + groupName + " permission set aziswitch.switch" + groupName + " true"); - } - - public void sendCommand(String command){ - getServer().dispatchCommand(getServer().getConsoleSender(), command); - } -} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index b88189e..aa77b14 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -10,9 +10,6 @@ commands: switch: description: 運営モードとサバ民モードを行き来する。 usage: エラー。/switchで運営モードを変更できます。 - newswitchgroup: - description: Switch可能なグループを作成する。 - usage: エラー。/newswitchgroup グループ名 でグループの作成が可能です。 permissions: aziswitch.*: