From 79eac788e9a015666ec795fff75d59c2d5769825 Mon Sep 17 00:00:00 2001 From: Tomachi <8929706+book000@users.noreply.github.com> Date: Wed, 10 Aug 2022 19:09:09 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Verified=E4=BB=A5=E4=B8=8B=E3=81=AB?= =?UTF-8?q?=E3=82=88=E3=82=8B=E4=BB=96=E4=BA=BA=E3=82=92=E5=AF=BE=E8=B1=A1?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=9Feffect=E3=82=B3=E3=83=9E=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=82=92=E6=8B=92=E5=90=A6=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=20(#905)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/Event_AntiProblemCommand.java | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/jaoafa/mymaid4/event/Event_AntiProblemCommand.java b/src/main/java/com/jaoafa/mymaid4/event/Event_AntiProblemCommand.java index dd4c76396..4598a290a 100644 --- a/src/main/java/com/jaoafa/mymaid4/event/Event_AntiProblemCommand.java +++ b/src/main/java/com/jaoafa/mymaid4/event/Event_AntiProblemCommand.java @@ -64,6 +64,7 @@ public class Event_AntiProblemCommand extends MyMaidLibrary implements Listener, antiCommandMap.put("/advancement", new AntiCmd_Advancement()); antiCommandMap.put("/minecraft:advancement", new AntiCmd_Advancement()); antiCommandMap.put("/login", new AntiCmd_Login()); + antiCommandMap.put("/effect", new AntiCmd_Effect()); } static void autoHistoryAdd(Player player, String prefix, String details) { @@ -302,7 +303,6 @@ public void execute(PlayerCommandPreprocessEvent event, Player player, String[] static class AntiCmd_KickCmd implements AntiCommand { @Override public void execute(PlayerCommandPreprocessEvent event, Player player, String[] args) { - Main.getMyMaidLogger().info("args.length: " + args.length); if (args.length >= 2 && (args[1].equalsIgnoreCase(player.getName()) || args[1].equalsIgnoreCase("me") || @@ -394,4 +394,31 @@ public void execute(PlayerCommandPreprocessEvent event, Player player, String[] autoHistoryAdd(player, "loginコマンドの実行", "(" + String.join(" ", args) + ")"); } } + + static class AntiCmd_Effect implements AntiCommand { + @Override + public void execute(PlayerCommandPreprocessEvent event, Player player, String[] args) { + if (isAMR(player)) { + return; + } + + // effect give [] [] [] + // effect clear [] [] + if (args.length < 3 || !args[1].equalsIgnoreCase("give")) { + return; + } + + String target = args[2]; + if (target.equalsIgnoreCase(player.getName())) { + return; + } + + player.chat("メロンパン2つ買ったら、おっぱい盛るためにメロンパン2つ買ったと思われるかな、思われるよね"); + player.chat("メロンパン2つ買う理由なんておっぱいにもるため以外にないもんね"); + player.chat("(私は\"" + String.join(" ", args) + "\"コマンドを使用しました。)"); + checkSpam(player); + autoHistoryAdd(player, "他人を対象としたeffectコマンドの実行", "(" + String.join(" ", args) + ")"); + event.setCancelled(true); + } + } }