Run through new formatter.

This commit is contained in:
SuPaH sPii committed 2012-12-22 00:28:37 -06:00
1 parent b48e97a799
commit 170f4dd946
34 files changed
+5636 -7150

No files matched your search

@@ -21,137 +21,102 @@ package net.h31ix.anticheat.manage;
import net.h31ix.anticheat.Anticheat;
import net.h31ix.anticheat.util.Configuration;
import net.h31ix.anticheat.util.Utilities;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
public class User
{
private final String name;
private int level = 0;
private int high;
private int med;
private Location goodLocation;
private boolean silentMode;
public User(String name)
{
this.name = name;
getConfigInfo();
}
public User(String name, int level)
{
this.name = name;
this.level = level;
getConfigInfo();
}
private void getConfigInfo()
{
Configuration config = Anticheat.getManager().getConfiguration();
silentMode = config.silentMode();
med = config.medThreshold();
high = config.highThreshold();
}
public String getName()
{
return name;
}
public Player getPlayer()
{
return Bukkit.getPlayer(name);
}
public int getLevel()
{
return level;
}
public boolean increaseLevel(CheckType type)
{
if(getPlayer() != null && getPlayer().isOnline())
{
if(silentMode && type.getUses(name) % 4 != 0)
{
// Prevent silent mode from increasing the level way too fast
return false;
}
else
{
level++;
if(level == med)
{
Anticheat.getManager().getUserManager().alertMed(this, type);
}
else if(level == high)
{
Anticheat.getManager().getUserManager().alertHigh(this, type);
// Prevent the player from going over the high limit
level = high-10;
}
return true;
}
}
else
{
return false;
}
}
public void decreaseLevel()
{
level = level != 0 ? level-1 : 0;
}
public void setLevel(int level)
{
if(level > 0 && level <= high)
{
this.level = level;
}
}
public void resetLevel()
{
level = 0;
for (CheckType type : CheckType.values())
{
type.clearUse(name);
}
}
public Location getGoodLocation(Location e)
{
if(goodLocation == null)
{
return e;
}
return goodLocation;
}
public boolean hasGoodLocation()
{
return goodLocation != null;
}
public void setGoodLocation(Location e)
{
if(Utilities.cantStandAtExp(e))
{
return;
}
if(e.getBlock().isLiquid() && !Utilities.isFullyInWater(e))
{
return;
}
goodLocation = e;
}
public class User {
private final String name;
private int level = 0;
private int high;
private int med;
private Location goodLocation;
private boolean silentMode;
public User(String name) {
this.name = name;
getConfigInfo();
}
public User(String name, int level) {
this.name = name;
this.level = level;
getConfigInfo();
}
private void getConfigInfo() {
Configuration config = Anticheat.getManager().getConfiguration();
silentMode = config.silentMode();
med = config.medThreshold();
high = config.highThreshold();
}
public String getName() {
return name;
}
public Player getPlayer() {
return Bukkit.getPlayer(name);
}
public int getLevel() {
return level;
}
public boolean increaseLevel(CheckType type) {
if (getPlayer() != null && getPlayer().isOnline()) {
if (silentMode && type.getUses(name) % 4 != 0) {
// Prevent silent mode from increasing the level way too fast
return false;
} else {
level++;
if (level == med) {
Anticheat.getManager().getUserManager().alertMed(this, type);
} else if (level == high) {
Anticheat.getManager().getUserManager().alertHigh(this, type);
// Prevent the player from going over the high limit
level = high - 10;
}
return true;
}
} else {
return false;
}
}
public void decreaseLevel() {
level = level != 0 ? level - 1 : 0;
}
public void setLevel(int level) {
if (level > 0 && level <= high) {
this.level = level;
}
}
public void resetLevel() {
level = 0;
for (CheckType type : CheckType.values()) {
type.clearUse(name);
}
}
public Location getGoodLocation(Location e) {
if (goodLocation == null) { return e; }
return goodLocation;
}
public boolean hasGoodLocation() {
return goodLocation != null;
}
public void setGoodLocation(Location e) {
if (Utilities.cantStandAtExp(e)) { return; }
if (e.getBlock().isLiquid() && !Utilities.isFullyInWater(e)) { return; }
goodLocation = e;
}
}