From 8e8daa457bdd8b0afc22224659e705103218708a Mon Sep 17 00:00:00 2001 From: speed <43330808+speedxx@users.noreply.github.com> Date: Mon, 27 Jul 2020 23:37:10 -0400 Subject: [PATCH] fix clearchat --- .../totalfreedommod/command/Command_clearchat.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_clearchat.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_clearchat.java index 1fee90d2..35ed9dee 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_clearchat.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_clearchat.java @@ -1,28 +1,30 @@ package me.totalfreedom.totalfreedommod.command; -import java.util.stream.IntStream; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.util.FUtil; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH) -@CommandParameters(description = "Clears the chat for players who are not opt-out.", usage = "/", aliases = "cc") +@CommandParameters(description = "Clears the chat.", usage = "/", aliases = "cc") public class Command_clearchat extends FreedomCommand { @Override public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - for (Player player : server.getOnlinePlayers()) { if (!plugin.al.isAdmin(player)) { - IntStream.range(0, 100).mapToObj(i -> "").forEach(player::sendMessage); + for (int i = 0; i < 100; i++) + { + player.sendMessage(""); + } } } - + FUtil.adminAction(sender.getName(), "Cleared chat", true); return true; } -} \ No newline at end of file +}