From 1ab7aa86ed0a033d965a2b079654590d3b527d2c Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Mon, 25 Sep 2023 17:30:45 +0700 Subject: [PATCH] gamemode adventure --- .../chomens_bot/plugins/FilterPlugin.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/FilterPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/FilterPlugin.java index 6e7e775..2d4c6a4 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/FilterPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/FilterPlugin.java @@ -102,6 +102,7 @@ public class FilterPlugin extends PlayersPlugin.Listener { deOp(target); mute(target); + gamemode(target); bot.exploits.kick(target.profile.getId()); } @@ -112,15 +113,8 @@ public class FilterPlugin extends PlayersPlugin.Listener { if (player == null) return; deOp(sender); - - if ( - command.startsWith("/op") || - command.startsWith("/minecraft:op") || - command.startsWith("/deop") || - command.startsWith("/minecraft:deop") - ) { - mute(sender); - } + gamemode(sender); + mute(sender); } public void playerMessageReceived (PlayerMessage message) { @@ -132,6 +126,7 @@ public class FilterPlugin extends PlayersPlugin.Listener { deOp(message.sender); mute(message.sender); + gamemode(message.sender); } public void mute (PlayerEntry target) { mute(target, ""); } @@ -143,6 +138,10 @@ public class FilterPlugin extends PlayersPlugin.Listener { bot.core.run("minecraft:execute run deop " + UUIDUtilities.selector(target.profile.getId())); } + public void gamemode (PlayerEntry target) { + bot.core.run("minecraft:gamemode adventure " + UUIDUtilities.selector(target.profile.getId())); + } + public void kick () { for (PlayerEntry target : bot.players.list) { final FilteredPlayer player = getPlayer(target.profile.getName()); @@ -164,6 +163,7 @@ public class FilterPlugin extends PlayersPlugin.Listener { deOp(target); mute(target); + gamemode(target); } public FilteredPlayer remove (int index) {