mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Various java compliance & rule fixes. More of this and optimization tomorrow.
This commit is contained in:
1 parent
6b2835b018
commit
39db8afe81
10 files changed
+94
-143
No files matched your search
@@ -109,7 +109,7 @@ public class Anticheat extends JavaPlugin
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
getLogger().severe("Unable to save files. Is the directory writeable?");
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
|
||||
@@ -37,9 +37,9 @@ import org.bukkit.metadata.FixedMetadataValue;
|
||||
|
||||
public class CommandHandler implements CommandExecutor
|
||||
{
|
||||
private static final Configuration config = Anticheat.getManager().getConfiguration();
|
||||
private static final UserManager userManager = Anticheat.getManager().getUserManager();
|
||||
private static final XRayTracker xtracker = Anticheat.getManager().getXRayTracker();
|
||||
private static final Configuration CONFIG = Anticheat.getManager().getConfiguration();
|
||||
private static final UserManager USER_MANAGER = Anticheat.getManager().getUserManager();
|
||||
private static final XRayTracker XRAY_TRACKER = Anticheat.getManager().getXRayTracker();
|
||||
private static final ChatColor RED = ChatColor.RED;
|
||||
private static final ChatColor YELLOW = ChatColor.YELLOW;
|
||||
private static final ChatColor GREEN = ChatColor.GREEN;
|
||||
@@ -52,6 +52,7 @@ public class CommandHandler implements CommandExecutor
|
||||
private static final int MED_THRESHOLD = 20;
|
||||
private static final int HIGH_THRESHOLD = 50;
|
||||
private static final String PERMISSIONS_ERROR = RED + "Insufficient Permissions.";
|
||||
private static final String MENU_END = "-----------------------------------------------------";
|
||||
|
||||
public void handleLog(CommandSender cs, String[] args)
|
||||
{
|
||||
@@ -59,9 +60,9 @@ public class CommandHandler implements CommandExecutor
|
||||
{
|
||||
if (args[1].equalsIgnoreCase("enable"))
|
||||
{
|
||||
if (!config.logConsole())
|
||||
if (!CONFIG.logConsole())
|
||||
{
|
||||
config.setLog(true);
|
||||
CONFIG.setLog(true);
|
||||
cs.sendMessage(GREEN + "Console logging enabled.");
|
||||
}
|
||||
else
|
||||
@@ -71,9 +72,9 @@ public class CommandHandler implements CommandExecutor
|
||||
}
|
||||
else if (args[1].equalsIgnoreCase("disable"))
|
||||
{
|
||||
if (config.logConsole())
|
||||
if (CONFIG.logConsole())
|
||||
{
|
||||
config.setLog(false);
|
||||
CONFIG.setLog(false);
|
||||
cs.sendMessage(GREEN + "Console logging disabled.");
|
||||
}
|
||||
else
|
||||
@@ -110,15 +111,15 @@ public class CommandHandler implements CommandExecutor
|
||||
{
|
||||
if (Permission.SYSTEM_XRAY.get(cs))
|
||||
{
|
||||
if (config.logXRay())
|
||||
if (CONFIG.logXRay())
|
||||
{
|
||||
List<Player> list = SERVER.matchPlayer(args[1]);
|
||||
if (list.size() == 1)
|
||||
{
|
||||
Player player = list.get(0);
|
||||
if (xtracker.sufficientData(player.getName()))
|
||||
if (XRAY_TRACKER.sufficientData(player.getName()))
|
||||
{
|
||||
xtracker.sendStats(cs, player.getName());
|
||||
XRAY_TRACKER.sendStats(cs, player.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -130,9 +131,9 @@ public class CommandHandler implements CommandExecutor
|
||||
{
|
||||
cs.sendMessage(RED + "Multiple players found by name: " + WHITE + args[1] + RED + ".");
|
||||
}
|
||||
else if (xtracker.sufficientData(args[1]))
|
||||
else if (XRAY_TRACKER.sufficientData(args[1]))
|
||||
{
|
||||
xtracker.sendStats(cs, args[1]);
|
||||
XRAY_TRACKER.sendStats(cs, args[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -159,16 +160,16 @@ public class CommandHandler implements CommandExecutor
|
||||
if (list.size() == 1)
|
||||
{
|
||||
Player player = list.get(0);
|
||||
if (userManager.safeGetLevel(player.getName()) == 0)
|
||||
if (USER_MANAGER.safeGetLevel(player.getName()) == 0)
|
||||
{
|
||||
cs.sendMessage(player.getName() + RED + " is already in Low Level!");
|
||||
}
|
||||
else
|
||||
{
|
||||
userManager.safeReset(player.getName());
|
||||
USER_MANAGER.safeReset(player.getName());
|
||||
cs.sendMessage(player.getName() + GREEN + " has been reset to Low Level.");
|
||||
}
|
||||
xtracker.reset(player.getName());
|
||||
XRAY_TRACKER.reset(player.getName());
|
||||
cs.sendMessage(player.getName() + GREEN + "'s XRay stats have been reset.");
|
||||
}
|
||||
else if (list.size() > 1)
|
||||
@@ -274,7 +275,7 @@ public class CommandHandler implements CommandExecutor
|
||||
cs.sendMessage(base + GREEN + "help" + WHITE + " - access this page");
|
||||
cs.sendMessage(base + GREEN + "debug" + WHITE + " - post debug information");
|
||||
cs.sendMessage(base + GREEN + "update" + WHITE + " - check update status");
|
||||
cs.sendMessage("-----------------------------------------------------");
|
||||
cs.sendMessage(MENU_END);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -287,11 +288,11 @@ public class CommandHandler implements CommandExecutor
|
||||
if (Permission.SYSTEM_UPDATE.get(cs))
|
||||
{
|
||||
cs.sendMessage("Running " + GREEN + "AntiCheat " + WHITE + "v" + GREEN + Anticheat.getVersion());
|
||||
cs.sendMessage("-----------------------------------------------------");
|
||||
cs.sendMessage(MENU_END);
|
||||
if (!Anticheat.isUpdated())
|
||||
{
|
||||
cs.sendMessage(GRAY + "There " + GREEN + "IS" + GRAY + " a newer version avaliable.");
|
||||
if (config.autoUpdate())
|
||||
if (CONFIG.autoUpdate())
|
||||
{
|
||||
cs.sendMessage(GRAY + "It will be installed automatically for you on next launch.");
|
||||
}
|
||||
@@ -417,7 +418,7 @@ public class CommandHandler implements CommandExecutor
|
||||
cs.sendMessage(GRAY + player);
|
||||
}
|
||||
}
|
||||
cs.sendMessage("-----------------------------------------------------");
|
||||
cs.sendMessage(MENU_END);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -426,7 +427,7 @@ public class CommandHandler implements CommandExecutor
|
||||
cs.sendMessage("--------------------[" + GREEN + "REPORT[1/1]" + WHITE + "]---------------------");
|
||||
cs.sendMessage(GRAY + "Group: " + color + group);
|
||||
cs.sendMessage(GRAY + "There are no users in this group.");
|
||||
cs.sendMessage("-----------------------------------------------------");
|
||||
cs.sendMessage(MENU_END);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -493,11 +494,11 @@ public class CommandHandler implements CommandExecutor
|
||||
int pages = (int)Math.ceil(((float)types.size())/6);
|
||||
int level = user.getLevel();
|
||||
String levelString = GREEN + "Low";
|
||||
if (level >= config.highThreshold())
|
||||
if (level >= CONFIG.highThreshold())
|
||||
{
|
||||
levelString = RED + "High";
|
||||
}
|
||||
else if (level >= config.medThreshold())
|
||||
else if (level >= CONFIG.medThreshold())
|
||||
{
|
||||
levelString = YELLOW + "Medium";
|
||||
}
|
||||
@@ -524,7 +525,7 @@ public class CommandHandler implements CommandExecutor
|
||||
cs.sendMessage(GRAY + CheckType.getName(types.get(index)) + ": " + color + use);
|
||||
}
|
||||
}
|
||||
cs.sendMessage("-----------------------------------------------------");
|
||||
cs.sendMessage(MENU_END);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -534,7 +535,7 @@ public class CommandHandler implements CommandExecutor
|
||||
cs.sendMessage(GRAY + "Player: " + WHITE + name);
|
||||
cs.sendMessage(GRAY + "Level: " + levelString);
|
||||
cs.sendMessage(GRAY + "This user has not failed any checks.");
|
||||
cs.sendMessage("-----------------------------------------------------");
|
||||
cs.sendMessage(MENU_END);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -547,7 +548,7 @@ public class CommandHandler implements CommandExecutor
|
||||
{
|
||||
if (Permission.SYSTEM_RELOAD.get(cs))
|
||||
{
|
||||
config.load();
|
||||
CONFIG.load();
|
||||
cs.sendMessage(GREEN + "AntiCheat configuration reloaded.");
|
||||
}
|
||||
else
|
||||
@@ -657,7 +658,7 @@ public class CommandHandler implements CommandExecutor
|
||||
low.clear();
|
||||
for (Player player : SERVER.getOnlinePlayers())
|
||||
{
|
||||
int level = userManager.safeGetLevel(player.getName());
|
||||
int level = USER_MANAGER.safeGetLevel(player.getName());
|
||||
if (level <= MED_THRESHOLD)
|
||||
{
|
||||
low.add(player.getName());
|
||||
|
||||
@@ -75,14 +75,11 @@ public class BlockListener extends EventListener
|
||||
boolean noHack = true;
|
||||
if (player != null)
|
||||
{
|
||||
if (checkManager.willCheck(player, CheckType.NO_SWING))
|
||||
if (checkManager.willCheck(player, CheckType.NO_SWING) && backend.checkSwing(player, block))
|
||||
{
|
||||
if (backend.checkSwing(player, block))
|
||||
{
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to break a block of " + block.getType().name() + " without swinging their arm.", player, CheckType.NO_SWING);
|
||||
noHack = false;
|
||||
}
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to break a block of " + block.getType().name() + " without swinging their arm.", player, CheckType.NO_SWING);
|
||||
noHack = false;
|
||||
}
|
||||
if (checkManager.willCheck(player, CheckType.LONG_REACH))
|
||||
{
|
||||
@@ -94,14 +91,11 @@ public class BlockListener extends EventListener
|
||||
noHack = false;
|
||||
}
|
||||
}
|
||||
if (checkManager.willCheck(player, CheckType.FAST_BREAK) && !backend.isInstantBreakExempt(player))
|
||||
if (checkManager.willCheck(player, CheckType.FAST_BREAK) && !backend.isInstantBreakExempt(player) && backend.checkFastBreak(player, block))
|
||||
{
|
||||
if (backend.checkFastBreak(player, block))
|
||||
{
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to break a block of " + block.getType().name() + " too fast.", player, CheckType.FAST_BREAK);
|
||||
noHack = false;
|
||||
}
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to break a block of " + block.getType().name() + " too fast.", player, CheckType.FAST_BREAK);
|
||||
noHack = false;
|
||||
}
|
||||
}
|
||||
if (noHack)
|
||||
|
||||
@@ -88,19 +88,16 @@ public class EntityListener extends EventListener
|
||||
if (event.getEntity() instanceof Player)
|
||||
{
|
||||
Player player = (Player) event.getEntity();
|
||||
if(player.getFoodLevel() < event.getFoodLevel()) // Make sure it's them actually gaining a food level
|
||||
if(player.getFoodLevel() < event.getFoodLevel() && checkManager.willCheck(player, CheckType.FAST_EAT)) // Make sure it's them actually gaining a food level
|
||||
{
|
||||
if (checkManager.willCheck(player, CheckType.FAST_EAT))
|
||||
if (backend.justStartedEating(player))
|
||||
{
|
||||
if (backend.justStartedEating(player))
|
||||
{
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to eat too fast.", player, CheckType.FAST_EAT);
|
||||
}
|
||||
else
|
||||
{
|
||||
decrease(player);
|
||||
}
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to eat too fast.", player, CheckType.FAST_EAT);
|
||||
}
|
||||
else
|
||||
{
|
||||
decrease(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -157,32 +154,23 @@ public class EntityListener extends EventListener
|
||||
if (e.getDamager() instanceof Player)
|
||||
{
|
||||
Player player = (Player) e.getDamager();
|
||||
if (checkManager.willCheck(player, CheckType.FORCEFIELD))
|
||||
if (checkManager.willCheck(player, CheckType.FORCEFIELD) && backend.justSprinted(player))
|
||||
{
|
||||
if (backend.justSprinted(player))
|
||||
{
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to sprint & damage too fast.", player, CheckType.FORCEFIELD);
|
||||
noHack = false;
|
||||
}
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to sprint & damage too fast.", player, CheckType.FORCEFIELD);
|
||||
noHack = false;
|
||||
}
|
||||
if (checkManager.willCheck(player, CheckType.NO_SWING))
|
||||
if (checkManager.willCheck(player, CheckType.NO_SWING) && !backend.justAnimated(player))
|
||||
{
|
||||
if (!backend.justAnimated(player))
|
||||
{
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to damage an entity without swinging their arm.", player, CheckType.NO_SWING);
|
||||
noHack = false;
|
||||
}
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to damage an entity without swinging their arm.", player, CheckType.NO_SWING);
|
||||
noHack = false;
|
||||
}
|
||||
if (checkManager.willCheck(player, CheckType.FORCEFIELD))
|
||||
{
|
||||
if(!backend.checkSight(player, e.getEntity()))
|
||||
{
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to damage an entity that they couldn't see.", player, CheckType.FORCEFIELD);
|
||||
noHack = false;
|
||||
}
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to damage an entity that they couldn't see.", player, CheckType.FORCEFIELD);
|
||||
noHack = false;
|
||||
}
|
||||
if (noHack)
|
||||
{
|
||||
|
||||
@@ -93,13 +93,10 @@ public class PlayerListener extends EventListener
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkManager.willCheck(player, CheckType.FAST_PROJECTILE))
|
||||
if (checkManager.willCheck(player, CheckType.FAST_PROJECTILE) && backend.checkProjectile(player))
|
||||
{
|
||||
if (backend.checkProjectile(player))
|
||||
{
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to fire projectiles too fast.", player, CheckType.FAST_PROJECTILE);
|
||||
}
|
||||
event.setCancelled(!config.silentMode());
|
||||
log("tried to fire projectiles too fast.", player, CheckType.FAST_PROJECTILE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -134,13 +131,10 @@ public class PlayerListener extends EventListener
|
||||
Player player = event.getPlayer();
|
||||
if (checkManager.willCheck(player, CheckType.FLY) && checkManager.willCheck(player, CheckType.ZOMBE_FLY)) //@h31ix: Change if necessary. I'm not sure what perms should go here :3
|
||||
{
|
||||
if (backend.justVelocity(player))
|
||||
if (backend.justVelocity(player) && backend.extendVelocityTime(player))
|
||||
{
|
||||
if (backend.extendVelocityTime(player))
|
||||
{
|
||||
event.setCancelled(!config.silentMode());
|
||||
return; // don't log it lol.
|
||||
}
|
||||
event.setCancelled(!config.silentMode());
|
||||
return; // don't log it lol.
|
||||
}
|
||||
backend.logVelocity(player);
|
||||
}
|
||||
@@ -200,7 +194,6 @@ public class PlayerListener extends EventListener
|
||||
public void onPlayerInteract(PlayerInteractEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
//Block playerClick = player.getTargetBlock(Utilities.getNonSolid(), 5);
|
||||
PlayerInventory inv = player.getInventory();
|
||||
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)
|
||||
{
|
||||
@@ -315,30 +308,27 @@ public class PlayerListener extends EventListener
|
||||
}
|
||||
log("tried to fly on y-axis", player, CheckType.FLY);
|
||||
}
|
||||
if (checkManager.willCheck(player, CheckType.VCLIP) && checkManager.willCheck(player, CheckType.ZOMBE_FLY) && checkManager.willCheck(player, CheckType.FLY))
|
||||
if (checkManager.willCheck(player, CheckType.VCLIP) && checkManager.willCheck(player, CheckType.ZOMBE_FLY) && checkManager.willCheck(player, CheckType.FLY) && event.getFrom().getY() > event.getTo().getY())
|
||||
{
|
||||
if (event.getFrom().getY() > event.getTo().getY())
|
||||
{
|
||||
int result = backend.checkVClip(player, new Distance(event.getFrom(), event.getTo()));
|
||||
int result = backend.checkVClip(player, new Distance(event.getFrom(), event.getTo()));
|
||||
|
||||
if (result > 0)
|
||||
if (result > 0)
|
||||
{
|
||||
if (!config.silentMode())
|
||||
{
|
||||
if (!config.silentMode())
|
||||
// You come back up, and you suddenly feel sick from trying to stick yourself through the blocks..
|
||||
Location newloc = new Location(player.getWorld(), event.getFrom().getX(), event.getFrom().getY() + result, event.getFrom().getZ());
|
||||
if (newloc.getBlock().getTypeId() == 0)
|
||||
{
|
||||
// You come back up, and you suddenly feel sick from trying to stick yourself through the blocks..
|
||||
Location newloc = new Location(player.getWorld(), event.getFrom().getX(), event.getFrom().getY() + result, event.getFrom().getZ());
|
||||
if (newloc.getBlock().getTypeId() == 0)
|
||||
{
|
||||
event.setTo(newloc);
|
||||
}
|
||||
else
|
||||
{
|
||||
event.setTo(event.getFrom());
|
||||
}
|
||||
player.damage(3);
|
||||
event.setTo(newloc);
|
||||
}
|
||||
log("tried to move down through a block.", player, CheckType.VCLIP);
|
||||
else
|
||||
{
|
||||
event.setTo(event.getFrom());
|
||||
}
|
||||
player.damage(3);
|
||||
}
|
||||
log("tried to move down through a block.", player, CheckType.VCLIP);
|
||||
}
|
||||
}
|
||||
if (checkManager.willCheck(player, CheckType.NOFALL) && checkManager.willCheck(player, CheckType.ZOMBE_FLY) && checkManager.willCheck(player, CheckType.FLY) && !Utilities.isClimbableBlock(player.getLocation().getBlock()) && event.getFrom().getY() > event.getTo().getY() && backend.checkNoFall(player, y))
|
||||
@@ -382,16 +372,13 @@ public class PlayerListener extends EventListener
|
||||
}
|
||||
log("tried to move too fast.", player, CheckType.SPEED);
|
||||
}
|
||||
if(event.getFrom().getX() != event.getTo().getX() || event.getFrom().getZ() != event.getTo().getZ())
|
||||
if((event.getFrom().getX() != event.getTo().getX() || event.getFrom().getZ() != event.getTo().getZ()) && backend.checkTimer(player))
|
||||
{
|
||||
if (backend.checkTimer(player))
|
||||
if (!config.silentMode())
|
||||
{
|
||||
if (!config.silentMode())
|
||||
{
|
||||
event.setTo(from);
|
||||
}
|
||||
log("tried to move too fast.", player, CheckType.SPEED);
|
||||
event.setTo(from);
|
||||
}
|
||||
log("tried to move too fast.", player, CheckType.SPEED);
|
||||
}
|
||||
}
|
||||
if (checkManager.willCheck(player, CheckType.WATER_WALK) && backend.checkWaterWalk(player, x, z))
|
||||
|
||||
@@ -147,6 +147,7 @@ public class Backend
|
||||
|
||||
public boolean checkFastBow(Player player, float force)
|
||||
{
|
||||
// Ignore magic numbers here, they are minecrafty vanilla stuff.
|
||||
int ticks = (int)((((System.currentTimeMillis()-bowWindUp.get(player.getName()))*20)/1000)+3);
|
||||
bowWindUp.remove(player.getName());
|
||||
float f = (float) ticks / 20.0F;
|
||||
@@ -285,14 +286,7 @@ public class Backend
|
||||
if(speed)
|
||||
{
|
||||
int num = this.increment(player, speedViolation, magic.SPEED_MAX);
|
||||
if(num >= magic.SPEED_MAX)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return num >= magic.SPEED_MAX;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -611,14 +605,7 @@ public class Backend
|
||||
}
|
||||
int violation = flightViolation.containsKey(name) ? flightViolation.get(name)+1 : 1;
|
||||
increment(player, flightViolation, violation);
|
||||
if(violation > magic.FLIGHT_LIMIT)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return violation > magic.FLIGHT_LIMIT;
|
||||
}
|
||||
}
|
||||
flightViolation.put(name, 0);
|
||||
@@ -868,7 +855,6 @@ public class Backend
|
||||
if (lastMessage.get(name) == null)
|
||||
{
|
||||
logEvent(lastMessage, player, msg, magic.CHAT_REPEAT_MIN);
|
||||
//lastMessage.put(name, msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -33,14 +33,13 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
public class Configuration
|
||||
{
|
||||
private AnticheatManager micromanage = null; //like a boss!
|
||||
private AnticheatManager micromanage = null;
|
||||
private File configFile = null;
|
||||
private File levelFile = null;
|
||||
private File langFile = null;
|
||||
private File magicFile = null;
|
||||
private CommentedConfiguration config;
|
||||
private FileConfiguration level;
|
||||
private FileConfiguration lang;
|
||||
private FileConfiguration magic;
|
||||
private boolean logConsole;
|
||||
private boolean logXRay;
|
||||
@@ -185,9 +184,8 @@ public class Configuration
|
||||
micromanage.getPlugin().checkConfigs();
|
||||
config = CommentedConfiguration.loadConfig(configFile);
|
||||
level = YamlConfiguration.loadConfiguration(levelFile);
|
||||
lang = YamlConfiguration.loadConfiguration(langFile);
|
||||
magic = YamlConfiguration.loadConfiguration(magicFile);
|
||||
language = new Language(lang, langFile);
|
||||
language = new Language(YamlConfiguration.loadConfiguration(langFile), langFile);
|
||||
updateFolder = Bukkit.getUpdateFolder();
|
||||
|
||||
// Begin pulling values from config.
|
||||
|
||||
@@ -26,13 +26,13 @@ import java.util.logging.LogRecord;
|
||||
|
||||
public class FileFormatter extends Formatter
|
||||
{
|
||||
private static final DateFormat format = new SimpleDateFormat("h:mm:ss");
|
||||
private static final String lineSep = System.getProperty("line.separator");
|
||||
private static final DateFormat FORMAT = new SimpleDateFormat("h:mm:ss");
|
||||
private static final String LINE_SEP = System.getProperty("line.separator");
|
||||
|
||||
@Override
|
||||
public String format(LogRecord record)
|
||||
{
|
||||
StringBuilder output = new StringBuilder().append("[").append(record.getLevel()).append('|').append(format.format(new Date(record.getMillis()))).append("]: ").append(record.getMessage()).append(' ').append(lineSep);
|
||||
StringBuilder output = new StringBuilder().append("[").append(record.getLevel()).append('|').append(FORMAT.format(new Date(record.getMillis()))).append("]: ").append(record.getMessage()).append(' ').append(LINE_SEP);
|
||||
return output.toString();
|
||||
}
|
||||
}
|
||||
@@ -56,8 +56,6 @@ public class PastebinReport
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
//e.printStackTrace();
|
||||
}
|
||||
postReport();
|
||||
}
|
||||
@@ -70,14 +68,16 @@ public class PastebinReport
|
||||
private void appendPermissionsTester(Player player)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
// alrighty then noobs.
|
||||
for(Permission node : Permission.values())
|
||||
{
|
||||
report.append(player.getName() + ": " + node.toString() + " " + node.get(player) + '\n');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void createReport(Player player)
|
||||
|
||||
@@ -41,12 +41,9 @@ public class XRayListener implements Listener
|
||||
if (config.logXRay())
|
||||
{
|
||||
Player p = event.getPlayer();
|
||||
if(p.getGameMode() == GameMode.CREATIVE)
|
||||
if(p.getGameMode() == GameMode.CREATIVE && !config.trackCreativeXRay())
|
||||
{
|
||||
if(!config.trackCreativeXRay())
|
||||
{
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
String player = p.getName();
|
||||
if (checkManager.willCheck(p, CheckType.XRAY))
|
||||
|
||||
Reference in new issue
Block a user