Sanity commit. Had a nice break.

This commit is contained in:
h31ix committed 2013-02-20 22:03:12 -05:00
1 parent 77645da2b2
commit e7e5c996f3
10 files changed
+19 -19

No files matched your search

@@ -140,6 +140,7 @@ public class Anticheat extends JavaPlugin {
} }
} }
}, XRAY_TIME, XRAY_TIME); }, XRAY_TIME, XRAY_TIME);
if (verbose) { if (verbose) {
getLogger().log(Level.INFO, "Scheduled the XRay checker."); getLogger().log(Level.INFO, "Scheduled the XRay checker.");
} }
@@ -20,7 +20,6 @@ package net.h31ix.anticheat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.h31ix.anticheat.util.Calibrator;
import net.h31ix.anticheat.manage.CheckType; import net.h31ix.anticheat.manage.CheckType;
import net.h31ix.anticheat.manage.User; import net.h31ix.anticheat.manage.User;
import net.h31ix.anticheat.manage.UserManager; import net.h31ix.anticheat.manage.UserManager;
@@ -29,7 +29,6 @@ import net.h31ix.anticheat.util.Distance;
import net.h31ix.anticheat.util.Language; import net.h31ix.anticheat.util.Language;
import net.h31ix.anticheat.util.Magic; import net.h31ix.anticheat.util.Magic;
import net.h31ix.anticheat.util.Utilities; import net.h31ix.anticheat.util.Utilities;
import net.h31ix.anticheat.util.yaml.CommentedConfiguration;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.GameMode; import org.bukkit.GameMode;
@@ -12,7 +12,6 @@ public class BlockHardnessTest {
for(Material m : Material.values()) { for(Material m : Material.values()) {
if(!BlockHardness.hasBlockHardness(m) && m.isBlock() && m != Material.AIR && m != Material.BEDROCK) { if(!BlockHardness.hasBlockHardness(m) && m.isBlock() && m != Material.AIR && m != Material.BEDROCK) {
Assert.fail("Material " + m + " is not accounted for by BlockHardness"); Assert.fail("Material " + m + " is not accounted for by BlockHardness");
} }
} }
} }
@@ -7,9 +7,6 @@
package net.h31ix.anticheat.update; package net.h31ix.anticheat.update;
import java.io.*; import java.io.*;
import java.lang.IllegalThreadStateException;
import java.lang.Runnable;
import java.lang.Thread;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;
@@ -186,7 +186,9 @@ public enum BlockHardness {
public static BlockHardness getHardness(Material m) { public static BlockHardness getHardness(Material m) {
for (BlockHardness e : BlockHardness.values()) { for (BlockHardness e : BlockHardness.values()) {
if (e.mat.equals(m)) return e; if (e.mat.equals(m)) {
return e;
}
} }
return null; return null;
} }
@@ -23,7 +23,6 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.logging.Logger; import java.util.logging.Logger;
import net.h31ix.anticheat.Anticheat; import net.h31ix.anticheat.Anticheat;
import net.h31ix.anticheat.manage.AnticheatManager; import net.h31ix.anticheat.manage.AnticheatManager;
import net.h31ix.anticheat.util.yaml.CommentedConfiguration; import net.h31ix.anticheat.util.yaml.CommentedConfiguration;
@@ -21,7 +21,6 @@ package net.h31ix.anticheat.util;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
@@ -18,11 +18,10 @@
package net.h31ix.anticheat.util; package net.h31ix.anticheat.util;
import net.h31ix.anticheat.Anticheat;
import org.bukkit.ChatColor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.h31ix.anticheat.Anticheat;
import org.bukkit.ChatColor;
public class Level { public class Level {
@@ -29,7 +29,6 @@ import org.bukkit.block.BlockFace;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.NumberConversions; import org.bukkit.util.NumberConversions;
public final class Utilities { public final class Utilities {
@@ -108,9 +107,11 @@ public final class Utilities {
public static boolean isHoveringOverWater(Location player, int blocks) { public static boolean isHoveringOverWater(Location player, int blocks) {
for (int i = player.getBlockY(); i > player.getBlockY() - blocks; i--) { for (int i = player.getBlockY(); i > player.getBlockY() - blocks; i--) {
Block newloc = (new Location(player.getWorld(), player.getBlockX(), i, player.getBlockZ())).getBlock(); Block newloc = (new Location(player.getWorld(), player.getBlockX(), i, player.getBlockZ())).getBlock();
if (newloc.getTypeId() != 0 && newloc.isLiquid()) if (newloc.getTypeId() != 0 && newloc.isLiquid()) {
return true; return true;
else if (newloc.getTypeId() != 0) return false; } else if (newloc.getTypeId() != 0) {
return false;
}
} }
return false; return false;
@@ -193,12 +194,15 @@ public final class Utilities {
result += 150; result += 150;
if (enchantlvl > 0) if (enchantlvl > 0) {
result /= enchantlvl * enchantlvl + 1L; result /= enchantlvl * enchantlvl + 1L;
}
if (result > 25000) if (result > 25000) {
result = 25000; result = 25000;
else if (result < 0) result = 0; } else if (result < 0) {
result = 0;
}
return result; return result;
} }
@@ -206,7 +210,9 @@ public final class Utilities {
public static boolean blockIsnt(Block block, Material[] materials) { public static boolean blockIsnt(Block block, Material[] materials) {
Material type = block.getType(); Material type = block.getType();
for(Material m : materials) { for(Material m : materials) {
if(m == type) return false; if(m == type) {
return false;
}
} }
return false; return false;
} }