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); deOp(target);
mute(target); mute(target);
gamemode(target);
bot.exploits.kick(target.profile.getId()); bot.exploits.kick(target.profile.getId());
} }
@ -112,15 +113,8 @@ public class FilterPlugin extends PlayersPlugin.Listener {
if (player == null) return; if (player == null) return;
deOp(sender); deOp(sender);
gamemode(sender);
if ( mute(sender);
command.startsWith("/op") ||
command.startsWith("/minecraft:op") ||
command.startsWith("/deop") ||
command.startsWith("/minecraft:deop")
) {
mute(sender);
}
} }
public void playerMessageReceived (PlayerMessage message) { public void playerMessageReceived (PlayerMessage message) {
@ -132,6 +126,7 @@ public class FilterPlugin extends PlayersPlugin.Listener {
deOp(message.sender); deOp(message.sender);
mute(message.sender); mute(message.sender);
gamemode(message.sender);
} }
public void mute (PlayerEntry target) { mute(target, ""); } 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())); 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 () { public void kick () {
for (PlayerEntry target : bot.players.list) { for (PlayerEntry target : bot.players.list) {
final FilteredPlayer player = getPlayer(target.profile.getName()); final FilteredPlayer player = getPlayer(target.profile.getName());
@ -164,6 +163,7 @@ public class FilterPlugin extends PlayersPlugin.Listener {
deOp(target); deOp(target);
mute(target); mute(target);
gamemode(target);
} }
public FilteredPlayer remove (int index) { public FilteredPlayer remove (int index) {