Merge branch 'master' of github.com:h31ix/AntiCheat

This commit is contained in:
Super Spy committed 2012-06-06 10:37:48 -05:00
commit 8234b94e1f
3 files changed
+27 -20

No files matched your search

@@ -30,9 +30,9 @@ import java.util.logging.Logger;
import net.h31ix.anticheat.event.*;
import net.h31ix.anticheat.manage.AnticheatManager;
import net.h31ix.anticheat.manage.CheckType;
import net.h31ix.anticheat.util.Utilities;
import net.h31ix.anticheat.metrics.Metrics;
import net.h31ix.anticheat.metrics.Metrics.Graph;
import net.h31ix.anticheat.util.Utilities;
import net.h31ix.anticheat.xray.XRayListener;
import net.h31ix.anticheat.xray.XRayTracker;
import org.bukkit.ChatColor;
@@ -78,7 +78,7 @@ public class Anticheat extends JavaPlugin
updateFolder = config.updateFolder();
if (verbose)
{
logger.log(Level.INFO, "[AC] Setup the config.");
logger.log(Level.INFO, "Setup the config.");
}
checkForUpdate();
eventList.add(new PlayerListener());
@@ -112,7 +112,7 @@ public class Anticheat extends JavaPlugin
}, XRAY_TIME, XRAY_TIME);
if (verbose)
{
logger.log(Level.INFO, "[AC] Scheduled the XRay checker.");
logger.log(Level.INFO, "Scheduled the XRay checker.");
}
}
}
@@ -121,20 +121,19 @@ public class Anticheat extends JavaPlugin
getServer().getPluginManager().registerEvents(listener, this);
if (verbose)
{
logger.log(Level.INFO, "[AC] Registered events for ".concat(listener.toString()));
logger.log(Level.INFO, "Registered events for ".concat(listener.toString()));
}
}
getCommand("anticheat").setExecutor(new CommandHandler());
if (verbose)
{
logger.log(Level.INFO, "[AC] Registered commands.");
logger.log(Level.INFO, "[AC] Finished loading.");
logger.log(Level.INFO, "Registered commands.");
}
if (update && config.autoUpdate())
{
if (verbose)
{
logger.log(Level.INFO, "[AC] Downloading the new update...");
logger.log(Level.INFO, "Downloading the new update...");
}
File file = new File("plugins/" + updateFolder);
if (!file.exists())
@@ -192,7 +191,7 @@ public class Anticheat extends JavaPlugin
metrics.start();
if (verbose)
{
logger.log(Level.INFO, "[AC] Metrics started.");
logger.log(Level.INFO, "Metrics started.");
}
}
catch (IOException ex)
@@ -202,7 +201,15 @@ public class Anticheat extends JavaPlugin
{
String name = player.getName();
manager.getPlayerManager().setLevel(player,config.getLevel(name));
if (verbose)
{
logger.log(Level.INFO, "Data for "+player.getName()+" re-applied from flatfile");
}
}
if (verbose)
{
logger.log(Level.INFO, "Finished loading.");
}
}
private void saveFile(String file, String url)
@@ -242,7 +249,7 @@ public class Anticheat extends JavaPlugin
}
if (verbose)
{
logger.log(Level.INFO,"[AC] AntiCheat update has been downloaded and will be installed on next launch.");
logger.log(Level.INFO,"AntiCheat update has been downloaded and will be installed on next launch.");
}
}
}
@@ -254,7 +261,7 @@ public class Anticheat extends JavaPlugin
saveDefaultConfig();
if (verbose)
{
logger.log(Level.INFO, "[AC] Config file created.");
logger.log(Level.INFO, "Config file created.");
}
}
if (!new File(getDataFolder() + "/lang.yml").exists())
@@ -262,7 +269,7 @@ public class Anticheat extends JavaPlugin
saveResource("lang.yml",false);
if (verbose)
{
logger.log(Level.INFO, "[AC] Lang file created.");
logger.log(Level.INFO, "Lang file created.");
}
}
}
@@ -271,7 +278,7 @@ public class Anticheat extends JavaPlugin
{
if (verbose)
{
logger.log(Level.INFO, "[AC] Checking for updates...");
logger.log(Level.INFO, "Checking for updates...");
}
URL url;
URLConnection urlConn;
@@ -299,9 +306,9 @@ public class Anticheat extends JavaPlugin
catch (Exception ex)
{
}
if (!this.getDescription().getVersion().equalsIgnoreCase(v))
String version = this.getDescription().getVersion().split("-b")[0];
if (!version.equalsIgnoreCase(v))
{
String version = this.getDescription().getVersion();
if (version.endsWith("-PRE") || version.endsWith("-DEV"))
{
if (version.replaceAll("-PRE", "").replaceAll("-DEV", "").equalsIgnoreCase(v))
@@ -309,7 +316,7 @@ public class Anticheat extends JavaPlugin
update = true;
if (verbose)
{
logger.log(Level.INFO,"[AC] Your dev build has been promoted to release. Downloading the update.");
logger.log(Level.INFO,"Your dev build has been promoted to release. Downloading the update.");
}
}
else
@@ -317,7 +324,7 @@ public class Anticheat extends JavaPlugin
update = false;
if (verbose)
{
logger.log(Level.INFO,"[AC] Dev build detected, so skipping update checking until this version is released.");
logger.log(Level.INFO,"Dev build detected, so skipping update checking until this version is released.");
}
}
}
@@ -326,7 +333,7 @@ public class Anticheat extends JavaPlugin
update = true;
if (verbose)
{
logger.log(Level.INFO, "[AC] An update was found.");
logger.log(Level.INFO, "An update was found.");
}
}
}
@@ -334,7 +341,7 @@ public class Anticheat extends JavaPlugin
{
if (verbose)
{
logger.log(Level.INFO, "[AC] No update found.");
logger.log(Level.INFO, "No update found.");
}
update = false;
}
@@ -477,7 +477,7 @@ public class Backend
public boolean checkSwing(Player player, Block block)
{
return !player.getInventory().getItemInHand().containsEnchantment(Enchantment.DIG_SPEED) && !Utilities.isInstantBreak(block.getType()) && !justAnimated(player) && !Utilities.isUsingMcMMOAbility(player);
return !player.getInventory().getItemInHand().containsEnchantment(Enchantment.DIG_SPEED) && !Utilities.isInstantBreak(block.getType()) && !justAnimated(player) && !Utilities.isUsingMcMMOAbility(player) && !(player.getInventory().getItemInHand().getType() == Material.SHEARS && block.getType() == Material.LEAVES);
}
public boolean checkFastBreak(Player player, Block block)