Removed coal from xray stats - fixes issue #74

This commit is contained in:
H31IX committed 2012-06-22 00:22:34 -04:00
1 parent 9af1e652e4
commit a0fcfc7013
3 files changed
+4 -26

No files matched your search

@@ -52,10 +52,6 @@ public class XRayListener implements Listener
{
tracker.addIron(player);
}
else if (m == Material.COAL_ORE)
{
tracker.addCoal(player);
}
else if (m == Material.GOLD_ORE)
{
tracker.addGold(player);
@@ -27,12 +27,11 @@ public class XRayStats
private double d = 0;
private double g = 0;
private double i = 0;
private double c = 0;
private double l = 0;
private double r = 0;
private double o = 0;
public XRayStats(String player, Map<String, Integer> diamond, Map<String, Integer> gold, Map<String, Integer> iron, Map<String, Integer> coal, Map<String, Integer> lapis, Map<String, Integer> redstone, Map<String, Integer> other, Map<String, Integer> total)
public XRayStats(String player, Map<String, Integer> diamond, Map<String, Integer> gold, Map<String, Integer> iron, Map<String, Integer> lapis, Map<String, Integer> redstone, Map<String, Integer> other, Map<String, Integer> total)
{
if (total.get(player) != null)
{
@@ -50,10 +49,6 @@ public class XRayStats
{
i = (iron.get(player) / t) * DIVISOR;
}
if (coal.get(player) != null)
{
c = (coal.get(player) / t) * DIVISOR;
}
if (lapis.get(player) != null)
{
l = (lapis.get(player) / t) * DIVISOR;
@@ -88,11 +83,6 @@ public class XRayStats
return i;
}
public double getCoal()
{
return c;
}
public double getLapis()
{
return l;
@@ -30,7 +30,6 @@ public class XRayTracker
private Map<String, Integer> diamond = new HashMap<String, Integer>();
private Map<String, Integer> gold = new HashMap<String, Integer>();
private Map<String, Integer> iron = new HashMap<String, Integer>();
private Map<String, Integer> coal = new HashMap<String, Integer>();
private Map<String, Integer> lapis = new HashMap<String, Integer>();
private Map<String, Integer> redstone = new HashMap<String, Integer>();
private Map<String, Integer> block = new HashMap<String, Integer>();
@@ -70,9 +69,9 @@ public class XRayTracker
public boolean hasAbnormal(String player)
{
XRayStats stats = new XRayStats(player, diamond, gold, iron, coal, lapis, redstone, block, totalblock);
XRayStats stats = new XRayStats(player, diamond, gold, iron, lapis, redstone, block, totalblock);
double total = stats.getOther();
return calculate(player, stats.getDiamond(), total) || calculate(player, stats.getGold(), total) || calculate(player, stats.getIron(), total) || calculate(player, stats.getCoal(), total) || calculate(player, stats.getLapis(), total) || calculate(player, stats.getRedstone(), total);
return calculate(player, stats.getDiamond(), total) || calculate(player, stats.getGold(), total) || calculate(player, stats.getIron(), total) || calculate(player, stats.getLapis(), total) || calculate(player, stats.getRedstone(), total);
}
public boolean hasAlerted(String player)
@@ -92,7 +91,7 @@ public class XRayTracker
public void getStats(CommandSender cs, String player)
{
XRayStats stats = new XRayStats(player, diamond, gold, iron, coal, lapis, redstone, block, totalblock);
XRayStats stats = new XRayStats(player, diamond, gold, iron, lapis, redstone, block, totalblock);
double total = stats.getOther();
cs.sendMessage("--------------------[" + GREEN + "X-Ray Stats" + WHITE + "]---------------------");
cs.sendMessage(GRAY + "Player: " + WHITE + player);
@@ -100,7 +99,6 @@ public class XRayTracker
calculate(cs, player, stats.getDiamond(), total, "diamond");
calculate(cs, player, stats.getGold(), total, "gold");
calculate(cs, player, stats.getIron(), total, "iron");
calculate(cs, player, stats.getCoal(), total, "coal");
calculate(cs, player, stats.getLapis(), total, "lapis");
calculate(cs, player, stats.getRedstone(), total, "redstone");
cs.sendMessage(GRAY + "Percent all other blocks: " + WHITE + round(stats.getOther()) + "%");
@@ -117,11 +115,6 @@ public class XRayTracker
addOre(player, gold);
}
public void addCoal(String player)
{
addOre(player, coal);
}
public void addIron(String player)
{
addOre(player, iron);
@@ -175,7 +168,6 @@ public class XRayTracker
diamond.put(player, 0);
iron.put(player, 0);
gold.put(player, 0);
coal.put(player, 0);
redstone.put(player, 0);
lapis.put(player, 0);
totalblock.put(player, 0);