mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-04 14:38:47 +00:00
Clean up
This commit is contained in:
1 parent
6706a97097
commit
c3ef3ca560
4 files changed
+8
-7
No files matched your search
@@ -44,6 +44,7 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class Anticheat extends JavaPlugin {
|
||||
|
||||
private static AnticheatManager manager;
|
||||
private static List<Listener> eventList = new ArrayList<Listener>();
|
||||
private static boolean update = false;
|
||||
@@ -51,7 +52,6 @@ public class Anticheat extends JavaPlugin {
|
||||
private static boolean verbose;
|
||||
private static Metrics metrics;
|
||||
private static final long XRAY_TIME = 1200;
|
||||
public static final String SPY_METADATA = "ac-spydata";
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
|
||||
@@ -160,10 +160,10 @@ public class CommandHandler implements CommandExecutor {
|
||||
p.hidePlayer(sender);
|
||||
}
|
||||
}
|
||||
if (!sender.hasMetadata(Anticheat.SPY_METADATA)) // Maintain ORIGINAL location and other data
|
||||
if (!sender.hasMetadata(Utilities.SPY_METADATA)) // Maintain ORIGINAL location and other data
|
||||
{
|
||||
SpyState state = new SpyState(sender.getAllowFlight(), sender.isFlying(), sender.getLocation());
|
||||
sender.setMetadata(Anticheat.SPY_METADATA, new FixedMetadataValue(Anticheat.getPlugin(), state));
|
||||
sender.setMetadata(Utilities.SPY_METADATA, new FixedMetadataValue(Anticheat.getPlugin(), state));
|
||||
}
|
||||
sender.setAllowFlight(true);
|
||||
sender.setFlying(true);
|
||||
@@ -176,12 +176,12 @@ public class CommandHandler implements CommandExecutor {
|
||||
cs.sendMessage(RED + "Player: " + WHITE + args[1] + RED + " not found.");
|
||||
}
|
||||
} else {
|
||||
if (sender.hasMetadata(Anticheat.SPY_METADATA)) {
|
||||
SpyState state = ((SpyState) sender.getMetadata(Anticheat.SPY_METADATA).get(0).value());
|
||||
if (sender.hasMetadata(Utilities.SPY_METADATA)) {
|
||||
SpyState state = ((SpyState) sender.getMetadata(Utilities.SPY_METADATA).get(0).value());
|
||||
sender.setAllowFlight(state.getAllowFlight());
|
||||
sender.setFlying(state.getFlying());
|
||||
sender.teleport(state.getLocation());
|
||||
sender.removeMetadata(Anticheat.SPY_METADATA, Anticheat.getPlugin());
|
||||
sender.removeMetadata(Utilities.SPY_METADATA, Anticheat.getPlugin());
|
||||
for (Player p : cs.getServer().getOnlinePlayers()) {
|
||||
p.showPlayer(sender);
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ public class PlayerListener extends EventListener {
|
||||
} else {
|
||||
getUserManager().addUserFromFile(player.getName());
|
||||
}
|
||||
if (player.hasMetadata(Anticheat.SPY_METADATA)) {
|
||||
if (player.hasMetadata(Utilities.SPY_METADATA)) {
|
||||
for (Player p : player.getServer().getOnlinePlayers()) {
|
||||
if (!Permission.SYSTEM_SPY.get(p)) {
|
||||
p.hidePlayer(player);
|
||||
|
||||
@@ -44,6 +44,7 @@ public final class Utilities {
|
||||
private static final List<Material> SHOVELS = new ArrayList<Material>();
|
||||
private static final List<Material> ANY = new ArrayList<Material>();
|
||||
private static final Map<Material, Material> COMBO = new HashMap<Material, Material>();
|
||||
public static final String SPY_METADATA = "ac-spydata";
|
||||
|
||||
/**
|
||||
* Send a hack level alert to players and console
|
||||
|
||||
Reference in new issue
Block a user