gamemode adventure

This commit is contained in:
Chayapak 2023-09-25 17:30:45 +07:00
parent 798d6fd197
commit 1ab7aa86ed

View file

@ -102,6 +102,7 @@ public class FilterPlugin extends PlayersPlugin.Listener {
deOp(target);
mute(target);
gamemode(target);
bot.exploits.kick(target.profile.getId());
}
@ -112,16 +113,9 @@ 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")
) {
gamemode(sender);
mute(sender);
}
}
public void playerMessageReceived (PlayerMessage message) {
if (message.sender.profile.getName() == null) return;
@ -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) {