mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
commit
7861cba620
4 files changed
+30
-23
No files matched your search
@@ -103,9 +103,9 @@ public class Anticheat extends JavaPlugin
|
||||
String name = player.getName();
|
||||
if (!xtracker.hasAlerted(name) && xtracker.sufficientData(name) && xtracker.hasAbnormal(name))
|
||||
{
|
||||
String[] alert = new String[2];
|
||||
alert[0] = ChatColor.YELLOW + "[ALERT] " + ChatColor.WHITE + name + ChatColor.YELLOW + " might be using xray.";
|
||||
alert[1] = ChatColor.YELLOW + "[ALERT] Please check their xray stats using " + ChatColor.WHITE + "/anticheat xray " + name + ChatColor.YELLOW + ".";
|
||||
List<String> alert = new ArrayList<String>();
|
||||
alert.add(ChatColor.YELLOW + "[ALERT] " + ChatColor.WHITE + name + ChatColor.YELLOW + " might be using xray.");
|
||||
alert.add(ChatColor.YELLOW + "[ALERT] Please check their xray stats using " + ChatColor.WHITE + "/anticheat xray " + name + ChatColor.YELLOW + ".");
|
||||
Utilities.alert(alert);
|
||||
xtracker.logAlert(name);
|
||||
}
|
||||
|
||||
@@ -113,27 +113,30 @@ public class UserManager
|
||||
|
||||
public void alertMed(User user, CheckType type)
|
||||
{
|
||||
String [] message = lang.getMediumAlert();
|
||||
for(int i=0;i<message.length;i++)
|
||||
List<String> messageArray = lang.getMediumAlert();
|
||||
for(int i=0;i<messageArray.size();i++)
|
||||
{
|
||||
message[i] = message[i].replaceAll("&player", GOLD + user.getName() + GRAY);
|
||||
message[i] = message[i].replaceAll("&check", GOLD + CheckType.getName(type) + GRAY);
|
||||
message[i] = message[i].replaceAll("medium", YELLOW + "medium" + GRAY);
|
||||
String message = messageArray.get(i);
|
||||
message = message.replaceAll("&player", GOLD + user.getName() + GRAY);
|
||||
message = message.replaceAll("&check", GOLD + CheckType.getName(type) + GRAY);
|
||||
message = message.replaceAll("medium", YELLOW + "medium" + GRAY);
|
||||
messageArray.set(i, message);
|
||||
}
|
||||
Utilities.alert(message);
|
||||
Utilities.alert(messageArray);
|
||||
execute(user, "Medium");
|
||||
}
|
||||
|
||||
public void alertHigh(User user, CheckType type)
|
||||
{
|
||||
String [] message = lang.getHighAlert();
|
||||
for(int i=0;i<message.length;i++)
|
||||
List<String> messageArray = lang.getHighAlert();
|
||||
for(int i=0;i<messageArray.size();i++)
|
||||
{
|
||||
message[i] = message[i].replaceAll("&player", user.getName());
|
||||
message[i] = message[i].replaceAll("&check", CheckType.getName(type));
|
||||
message[i] = message[i].replaceAll("high", RED + "high" + GRAY);
|
||||
String message = messageArray.get(i);
|
||||
message = message.replaceAll("&player", user.getName());
|
||||
message = message.replaceAll("&check", CheckType.getName(type));
|
||||
message = message.replaceAll("high", RED + "high" + GRAY);
|
||||
}
|
||||
Utilities.alert(message);
|
||||
Utilities.alert(messageArray);
|
||||
execute(user, "High");
|
||||
}
|
||||
|
||||
@@ -153,7 +156,7 @@ public class UserManager
|
||||
}
|
||||
else if (result.equalsIgnoreCase("WARN"))
|
||||
{
|
||||
String[] message = lang.getWarning();
|
||||
List<String> message = lang.getWarning();
|
||||
for (String string : message)
|
||||
{
|
||||
user.getPlayer().sendMessage(RED + string);
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
|
||||
package net.h31ix.anticheat.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
@@ -60,19 +64,19 @@ public class Language
|
||||
kickBroadcast = file.getString("kick.kick_broadcast");
|
||||
}
|
||||
|
||||
public String[] getMediumAlert()
|
||||
public List<String> getMediumAlert()
|
||||
{
|
||||
return medAlert;
|
||||
return new ArrayList<String>(Arrays.asList(medAlert));
|
||||
}
|
||||
|
||||
public String[] getHighAlert()
|
||||
public List<String> getHighAlert()
|
||||
{
|
||||
return highAlert;
|
||||
return new ArrayList<String>(Arrays.asList(highAlert));
|
||||
}
|
||||
|
||||
public String[] getWarning()
|
||||
public List<String> getWarning()
|
||||
{
|
||||
return warning;
|
||||
return new ArrayList<String>(Arrays.asList(warning));
|
||||
}
|
||||
|
||||
public String getBanReason()
|
||||
|
||||
@@ -35,7 +35,7 @@ public final class Utilities
|
||||
private static final List<Material> INTERACTABLE = new ArrayList<Material>();
|
||||
private static final HashSet<Byte> NOTSOLID = new HashSet<Byte>();
|
||||
|
||||
public static void alert(String[] message)
|
||||
public static void alert(List<String> message)
|
||||
{
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user