mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 22:15:28 +00:00
Merge branch 'master' of github.com:h31ix/AntiCheat
This commit is contained in:
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.event.*;
|
||||||
import net.h31ix.anticheat.manage.AnticheatManager;
|
import net.h31ix.anticheat.manage.AnticheatManager;
|
||||||
import net.h31ix.anticheat.manage.CheckType;
|
import net.h31ix.anticheat.manage.CheckType;
|
||||||
import net.h31ix.anticheat.util.Utilities;
|
|
||||||
import net.h31ix.anticheat.metrics.Metrics;
|
import net.h31ix.anticheat.metrics.Metrics;
|
||||||
import net.h31ix.anticheat.metrics.Metrics.Graph;
|
import net.h31ix.anticheat.metrics.Metrics.Graph;
|
||||||
|
import net.h31ix.anticheat.util.Utilities;
|
||||||
import net.h31ix.anticheat.xray.XRayListener;
|
import net.h31ix.anticheat.xray.XRayListener;
|
||||||
import net.h31ix.anticheat.xray.XRayTracker;
|
import net.h31ix.anticheat.xray.XRayTracker;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@@ -78,7 +78,7 @@ public class Anticheat extends JavaPlugin
|
|||||||
updateFolder = config.updateFolder();
|
updateFolder = config.updateFolder();
|
||||||
if (verbose)
|
if (verbose)
|
||||||
{
|
{
|
||||||
logger.log(Level.INFO, "[AC] Setup the config.");
|
logger.log(Level.INFO, "Setup the config.");
|
||||||
}
|
}
|
||||||
checkForUpdate();
|
checkForUpdate();
|
||||||
eventList.add(new PlayerListener());
|
eventList.add(new PlayerListener());
|
||||||
@@ -112,7 +112,7 @@ public class Anticheat extends JavaPlugin
|
|||||||
}, XRAY_TIME, XRAY_TIME);
|
}, XRAY_TIME, XRAY_TIME);
|
||||||
if (verbose)
|
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);
|
getServer().getPluginManager().registerEvents(listener, this);
|
||||||
if (verbose)
|
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());
|
getCommand("anticheat").setExecutor(new CommandHandler());
|
||||||
if (verbose)
|
if (verbose)
|
||||||
{
|
{
|
||||||
logger.log(Level.INFO, "[AC] Registered commands.");
|
logger.log(Level.INFO, "Registered commands.");
|
||||||
logger.log(Level.INFO, "[AC] Finished loading.");
|
|
||||||
}
|
}
|
||||||
if (update && config.autoUpdate())
|
if (update && config.autoUpdate())
|
||||||
{
|
{
|
||||||
if (verbose)
|
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);
|
File file = new File("plugins/" + updateFolder);
|
||||||
if (!file.exists())
|
if (!file.exists())
|
||||||
@@ -192,7 +191,7 @@ public class Anticheat extends JavaPlugin
|
|||||||
metrics.start();
|
metrics.start();
|
||||||
if (verbose)
|
if (verbose)
|
||||||
{
|
{
|
||||||
logger.log(Level.INFO, "[AC] Metrics started.");
|
logger.log(Level.INFO, "Metrics started.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
@@ -202,7 +201,15 @@ public class Anticheat extends JavaPlugin
|
|||||||
{
|
{
|
||||||
String name = player.getName();
|
String name = player.getName();
|
||||||
manager.getPlayerManager().setLevel(player,config.getLevel(name));
|
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)
|
private void saveFile(String file, String url)
|
||||||
@@ -242,7 +249,7 @@ public class Anticheat extends JavaPlugin
|
|||||||
}
|
}
|
||||||
if (verbose)
|
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();
|
saveDefaultConfig();
|
||||||
if (verbose)
|
if (verbose)
|
||||||
{
|
{
|
||||||
logger.log(Level.INFO, "[AC] Config file created.");
|
logger.log(Level.INFO, "Config file created.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!new File(getDataFolder() + "/lang.yml").exists())
|
if (!new File(getDataFolder() + "/lang.yml").exists())
|
||||||
@@ -262,7 +269,7 @@ public class Anticheat extends JavaPlugin
|
|||||||
saveResource("lang.yml",false);
|
saveResource("lang.yml",false);
|
||||||
if (verbose)
|
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)
|
if (verbose)
|
||||||
{
|
{
|
||||||
logger.log(Level.INFO, "[AC] Checking for updates...");
|
logger.log(Level.INFO, "Checking for updates...");
|
||||||
}
|
}
|
||||||
URL url;
|
URL url;
|
||||||
URLConnection urlConn;
|
URLConnection urlConn;
|
||||||
@@ -299,9 +306,9 @@ public class Anticheat extends JavaPlugin
|
|||||||
catch (Exception ex)
|
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.endsWith("-PRE") || version.endsWith("-DEV"))
|
||||||
{
|
{
|
||||||
if (version.replaceAll("-PRE", "").replaceAll("-DEV", "").equalsIgnoreCase(v))
|
if (version.replaceAll("-PRE", "").replaceAll("-DEV", "").equalsIgnoreCase(v))
|
||||||
@@ -309,7 +316,7 @@ public class Anticheat extends JavaPlugin
|
|||||||
update = true;
|
update = true;
|
||||||
if (verbose)
|
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
|
else
|
||||||
@@ -317,7 +324,7 @@ public class Anticheat extends JavaPlugin
|
|||||||
update = false;
|
update = false;
|
||||||
if (verbose)
|
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;
|
update = true;
|
||||||
if (verbose)
|
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)
|
if (verbose)
|
||||||
{
|
{
|
||||||
logger.log(Level.INFO, "[AC] No update found.");
|
logger.log(Level.INFO, "No update found.");
|
||||||
}
|
}
|
||||||
update = false;
|
update = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -477,7 +477,7 @@ public class Backend
|
|||||||
|
|
||||||
public boolean checkSwing(Player player, Block block)
|
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)
|
public boolean checkFastBreak(Player player, Block block)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ name: AntiCheat
|
|||||||
softdepend: [AntiCheat]
|
softdepend: [AntiCheat]
|
||||||
startup: postworld
|
startup: postworld
|
||||||
url: http://H31IX.NET/
|
url: http://H31IX.NET/
|
||||||
version: '1.3-DEV'
|
version: ${project.version}-b${BUILD_NUMBER}
|
||||||
commands:
|
commands:
|
||||||
anticheat:
|
anticheat:
|
||||||
description: Control and view info about AntiCheat
|
description: Control and view info about AntiCheat
|
||||||
|
|||||||
Reference in new issue
Block a user