mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
1 parent
ff040703ca
commit
565bcc4b25
3 files changed
+32
-32
No files matched your search
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>net.h31ix.anticheat</groupId>
|
||||
<artifactId>AntiCheat</artifactId>
|
||||
<version>1.4</version>
|
||||
<version>1.3.8-U4</version>
|
||||
<name>AntiCheat</name>
|
||||
<url>http://gravitydevelopment.net</url>
|
||||
<repositories>
|
||||
@@ -43,7 +43,7 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.4.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.3.2-R2.0</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -51,7 +51,7 @@ public class Anticheat extends JavaPlugin
|
||||
private static boolean verbose;
|
||||
private static Metrics metrics;
|
||||
private static final long XRAY_TIME = 1200;
|
||||
|
||||
|
||||
@Override
|
||||
public void onEnable()
|
||||
{
|
||||
@@ -59,9 +59,9 @@ public class Anticheat extends JavaPlugin
|
||||
eventList.add(new PlayerListener());
|
||||
eventList.add(new BlockListener());
|
||||
eventList.add(new EntityListener());
|
||||
eventList.add(new VehicleListener());
|
||||
eventList.add(new VehicleListener());
|
||||
// Order is important in some cases, don't screw with these unless needed, especially config
|
||||
setupConfig();
|
||||
setupConfig();
|
||||
// Xray must come before events
|
||||
setupXray();
|
||||
setupEvents();
|
||||
@@ -73,7 +73,7 @@ public class Anticheat extends JavaPlugin
|
||||
{
|
||||
getLogger().log(Level.INFO, "Finished loading.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable()
|
||||
@@ -87,13 +87,13 @@ public class Anticheat extends JavaPlugin
|
||||
getServer().getScheduler().cancelAllTasks();
|
||||
cleanup();
|
||||
}
|
||||
|
||||
private void save(InputStream in, File file)
|
||||
|
||||
private void save(InputStream in, File file)
|
||||
{
|
||||
if (!file.exists())
|
||||
{
|
||||
{
|
||||
file.getParentFile().mkdirs();
|
||||
try
|
||||
try
|
||||
{
|
||||
OutputStream out = new FileOutputStream(file);
|
||||
byte[] buf = new byte[1024];
|
||||
@@ -104,18 +104,18 @@ public class Anticheat extends JavaPlugin
|
||||
}
|
||||
out.close();
|
||||
in.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
getLogger().log(Level.INFO, file.getName()+" created.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void setupXray()
|
||||
{
|
||||
final XRayTracker xtracker = manager.getXRayTracker();
|
||||
@@ -148,9 +148,9 @@ public class Anticheat extends JavaPlugin
|
||||
getLogger().log(Level.INFO, "Scheduled the XRay checker.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void setupEvents()
|
||||
{
|
||||
for (Listener listener : eventList)
|
||||
@@ -160,18 +160,18 @@ public class Anticheat extends JavaPlugin
|
||||
{
|
||||
getLogger().log(Level.INFO, "Registered events for ".concat(listener.toString().split("@")[0].split(".anticheat.")[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void setupCommands()
|
||||
{
|
||||
getCommand("anticheat").setExecutor(new CommandHandler());
|
||||
if (verbose)
|
||||
{
|
||||
getLogger().log(Level.INFO, "Registered commands.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void setupUpdater()
|
||||
{
|
||||
if (config.autoUpdate())
|
||||
@@ -179,16 +179,16 @@ public class Anticheat extends JavaPlugin
|
||||
if (verbose)
|
||||
{
|
||||
getLogger().log(Level.INFO, "Checking for a new update...");
|
||||
}
|
||||
}
|
||||
Updater updater = new Updater(this, "anticheat", this.getFile(), Updater.UpdateType.DEFAULT, false);
|
||||
update = updater.getResult() != Updater.UpdateResult.NO_UPDATE;
|
||||
if (verbose)
|
||||
{
|
||||
getLogger().log(Level.INFO, "Update avaliable: "+update);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void setupMetrics()
|
||||
{
|
||||
try
|
||||
@@ -233,9 +233,9 @@ public class Anticheat extends JavaPlugin
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void setupConfig()
|
||||
{
|
||||
config = manager.getConfiguration();
|
||||
@@ -244,9 +244,9 @@ public class Anticheat extends JavaPlugin
|
||||
if (verbose)
|
||||
{
|
||||
getLogger().log(Level.INFO, "Setup the config.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void restoreLevels()
|
||||
{
|
||||
for (Player player : getServer().getOnlinePlayers())
|
||||
@@ -257,14 +257,14 @@ public class Anticheat extends JavaPlugin
|
||||
{
|
||||
getLogger().log(Level.INFO, "Data for " + player.getName() + " re-applied from flatfile");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void checkConfigs()
|
||||
{
|
||||
save(getResource("config.yml"), new File(getDataFolder() + "/config.yml"));
|
||||
save(getResource("lang.yml"), new File(getDataFolder() + "/lang.yml"));
|
||||
save(getResource("magic.yml"), new File(getDataFolder() + "/magic.yml"));
|
||||
save(getResource("magic.yml"), new File(getDataFolder() + "/magic.yml"));
|
||||
}
|
||||
|
||||
public static Anticheat getPlugin()
|
||||
@@ -286,7 +286,7 @@ public class Anticheat extends JavaPlugin
|
||||
{
|
||||
return manager.getPlugin().getDescription().getVersion();
|
||||
}
|
||||
|
||||
|
||||
private void cleanup()
|
||||
{
|
||||
eventList = null;
|
||||
|
||||
@@ -6,7 +6,7 @@ name: AntiCheat
|
||||
softdepend: [AntiCheat]
|
||||
startup: postworld
|
||||
url: http://gravitydevelopment.net
|
||||
version: ${project.version}
|
||||
version: ${project.version}-DEV-b${BUILD_NUMBER}
|
||||
commands:
|
||||
anticheat:
|
||||
description: Control and view info about AntiCheat
|
||||
|
||||
Reference in new issue
Block a user