mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 14:38:45 +00:00
Level data now persists across restarts/reloads
This commit is contained in:
1 parent
2ce2235280
commit
ce19d564e2
6 files changed
+120
-19
No files matched your search
@@ -35,7 +35,7 @@ public class EventListener implements Listener
|
||||
private static final Anticheat PLUGIN = Anticheat.getPlugin();
|
||||
private static final PlayerManager PLAYER_MANAGER = AnticheatManager.PLAYER_MANAGER;
|
||||
|
||||
public static void log(String message,Player player, CheckType type)
|
||||
public void log(String message,Player player, CheckType type)
|
||||
{
|
||||
if(AnticheatManager.CONFIGURATION.logConsole())
|
||||
{
|
||||
@@ -46,17 +46,17 @@ public class EventListener implements Listener
|
||||
logCheat(type);
|
||||
}
|
||||
|
||||
private static void logCheat(CheckType type)
|
||||
private void logCheat(CheckType type)
|
||||
{
|
||||
usageList.put(type, getCheats(type)+1);
|
||||
}
|
||||
|
||||
public static void resetCheck(CheckType type)
|
||||
public void resetCheck(CheckType type)
|
||||
{
|
||||
usageList.put(type, 0);
|
||||
}
|
||||
|
||||
public static int getCheats(CheckType type)
|
||||
public int getCheats(CheckType type)
|
||||
{
|
||||
int x = 0;
|
||||
if(usageList.get(type) != null)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package net.h31ix.anticheat.event;
|
||||
|
||||
import net.h31ix.anticheat.manage.*;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -60,6 +61,11 @@ public class PlayerListener extends EventListener
|
||||
if(checkManager.willCheck(player, CheckType.SPAM))
|
||||
{
|
||||
backend.logChat(player);
|
||||
if(backend.checkSpam(player, event.getMessage()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
player.sendMessage(ChatColor.RED+"Please do not spam.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,6 +165,10 @@ public class PlayerListener extends EventListener
|
||||
player.sendMessage("§f §f §4 §0 §9 §6");
|
||||
}
|
||||
backend.logJoin(event.getPlayer());
|
||||
if(!AnticheatManager.PLAYER_MANAGER.hasLevel(player))
|
||||
{
|
||||
AnticheatManager.PLAYER_MANAGER.setLevel(player, AnticheatManager.CONFIGURATION.getLevel(player.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
|
||||
Reference in new issue
Block a user