diff options
author | ementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-02 00:37:57 +0000 |
---|---|---|
committer | ementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-02 00:37:57 +0000 |
commit | 25d77eff590ae0af4616bf1c9a6a2955d039702b (patch) | |
tree | 2bb4ff6df099394e75579eae4bee0de21d9e6d87 | |
parent | 9d41ffcc624f8d2027c89aa48375147d6e34bfc8 (diff) | |
download | Essentials-25d77eff590ae0af4616bf1c9a6a2955d039702b.tar Essentials-25d77eff590ae0af4616bf1c9a6a2955d039702b.tar.gz Essentials-25d77eff590ae0af4616bf1c9a6a2955d039702b.tar.lz Essentials-25d77eff590ae0af4616bf1c9a6a2955d039702b.tar.xz Essentials-25d77eff590ae0af4616bf1c9a6a2955d039702b.zip |
[trunk] formatting
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1306 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java index 31d127e7f..5b5e0f7df 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java @@ -12,13 +12,14 @@ import org.bukkit.inventory.ItemStack; public class EssentialsEcoBlockListener extends BlockListener { - public static DecimalFormat df = new DecimalFormat ("0.##"); + public static DecimalFormat df = new DecimalFormat("0.##"); Essentials ess; + public EssentialsEcoBlockListener(Essentials ess) { this.ess = ess; } - + @Override public void onBlockBreak(BlockBreakEvent event) { @@ -57,14 +58,14 @@ public class EssentialsEcoBlockListener extends BlockListener double q1 = Double.parseDouble(m1 ? l1[0].substring(1) : l1[0]); double q2 = Double.parseDouble(m2 ? l2[0].substring(1) : l2[0]); double r1 = Double.parseDouble(l1[m1 ? 1 : 2]); - double r2 = Double.parseDouble(l2[m2 ? 1 : 2]); + double r2 = Double.parseDouble(l2[m2 ? 1 : 2]); if (q1 < 1 || q2 < 1) { throw new Exception("Quantities must be greater than 0."); } - ItemStack i1 = m1 || r1 <= 0 ? null : ItemDb.get(l1[1], (int) r1); - ItemStack i2 = m2 || r2 <= 0 ? null : ItemDb.get(l2[1], (int) r2); + ItemStack i1 = m1 || r1 <= 0 ? null : ItemDb.get(l1[1], (int)r1); + ItemStack i2 = m2 || r2 <= 0 ? null : ItemDb.get(l2[1], (int)r2); if (m1) { @@ -115,9 +116,9 @@ public class EssentialsEcoBlockListener extends BlockListener { throw new Exception("Don't sell air."); } - String d = df.format (Double.parseDouble(event.getLine(3).replaceAll("[^0-9\\.]", ""))); - Double dbl = new Double (d); - event.setLine(3, "$" + (double) dbl); + String d = df.format(Double.parseDouble(event.getLine(3).replaceAll("[^0-9\\.]", ""))); + Double dbl = new Double(d); + event.setLine(3, "$" + (double)dbl); } catch (Throwable ex) { @@ -141,9 +142,9 @@ public class EssentialsEcoBlockListener extends BlockListener { throw new Exception("Don't buy air."); } - String d = df.format (Double.parseDouble(event.getLine(3).replaceAll("[^0-9\\.]", ""))); - Double dbl = new Double (d); - event.setLine(3, "$" + (double) dbl); + String d = df.format(Double.parseDouble(event.getLine(3).replaceAll("[^0-9\\.]", ""))); + Double dbl = new Double(d); + event.setLine(3, "$" + (double)dbl); } catch (Throwable ex) { @@ -188,7 +189,7 @@ public class EssentialsEcoBlockListener extends BlockListener } else { - ItemStack i2 = ItemDb.get(l2[1], (int) r2); + ItemStack i2 = ItemDb.get(l2[1], (int)r2); if (!InventoryWorkaround.containsItem(user.getInventory(), true, i2)) { throw new Exception("You do not have " + r2 + "x " + l2[1] + "."); |