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
+178 -178

No files matched your search

@@ -186,7 +186,9 @@ public enum BlockHardness {
public static BlockHardness getHardness(Material m) {
for (BlockHardness e : BlockHardness.values()) {
if (e.mat.equals(m)) return e;
if (e.mat.equals(m)) {
return e;
}
}
return null;
}
@@ -23,7 +23,6 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import net.h31ix.anticheat.Anticheat;
import net.h31ix.anticheat.manage.AnticheatManager;
import net.h31ix.anticheat.util.yaml.CommentedConfiguration;
@@ -21,7 +21,6 @@ package net.h31ix.anticheat.util;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -18,11 +18,10 @@
package net.h31ix.anticheat.util;
import net.h31ix.anticheat.Anticheat;
import org.bukkit.ChatColor;
import java.util.ArrayList;
import java.util.List;
import net.h31ix.anticheat.Anticheat;
import org.bukkit.ChatColor;
public class Level {
@@ -29,7 +29,6 @@ import org.bukkit.block.BlockFace;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.NumberConversions;
public final class Utilities {
@@ -108,9 +107,11 @@ public final class Utilities {
public static boolean isHoveringOverWater(Location player, int blocks) {
for (int i = player.getBlockY(); i > player.getBlockY() - blocks; i--) {
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;
else if (newloc.getTypeId() != 0) return false;
} else if (newloc.getTypeId() != 0) {
return false;
}
}
return false;
@@ -193,12 +194,15 @@ public final class Utilities {
result += 150;
if (enchantlvl > 0)
if (enchantlvl > 0) {
result /= enchantlvl * enchantlvl + 1L;
}
if (result > 25000)
if (result > 25000) {
result = 25000;
else if (result < 0) result = 0;
} else if (result < 0) {
result = 0;
}
return result;
}
@@ -206,7 +210,9 @@ public final class Utilities {
public static boolean blockIsnt(Block block, Material[] materials) {
Material type = block.getType();
for(Material m : materials) {
if(m == type) return false;
if(m == type) {
return false;
}
}
return false;
}