summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-07 11:13:26 +0000
committerementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-07 11:13:26 +0000
commitaec008418c987fd3e4f144192c73f87c8dfcf3e6 (patch)
tree9c90723dfa56676fa1447f0023830fad1668926a
parent609a2e61714a1807e0622ded02e8a05fbfc2f1c0 (diff)
downloadEssentials-aec008418c987fd3e4f144192c73f87c8dfcf3e6.tar
Essentials-aec008418c987fd3e4f144192c73f87c8dfcf3e6.tar.gz
Essentials-aec008418c987fd3e4f144192c73f87c8dfcf3e6.tar.lz
Essentials-aec008418c987fd3e4f144192c73f87c8dfcf3e6.tar.xz
Essentials-aec008418c987fd3e4f144192c73f87c8dfcf3e6.zip
[trunk] more trade sign fixes, upon breaking
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1361 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
index 6b70a1a84..ee2c1a96e 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
@@ -53,11 +53,11 @@ public class EssentialsEcoBlockListener extends BlockListener
String[] l2 = sign.getLines()[2].split("[ :-]+");
boolean m1 = l1[0].matches("\\$[0-9]+(\\.[0-9]+)?");
boolean m2 = l2[0].matches("\\$[0-9]+(\\.[0-9]+)?");
- int q1 = Integer.parseInt(m1 ? l1[0].substring(1) : l1[0]);
- int q2 = Integer.parseInt(m2 ? l2[0].substring(1) : l2[0]);
+ 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]);
- if (q1 < 1 || q2 < 1)
+ if ((!m1 & q1 < 1) || (!m2 & q2 < 1))
{
throw new Exception("Quantities must be greater than 0.");
}