summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/nbproject/project.properties156
-rw-r--r--Essentials/src/com/earth2me/essentials/Essentials.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java12
-rw-r--r--Essentials/src/com/earth2me/essentials/UserData.java33
-rw-r--r--Essentials/src/com/earth2me/essentials/Util.java19
-rw-r--r--Essentials/src/com/earth2me/essentials/api/Economy.java (renamed from Essentials/src/com/earth2me/essentials/EcoAPI.java)17
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandworth.java13
-rw-r--r--Essentials/src/plugin.yml2
-rw-r--r--EssentialsChat/src/plugin.yml2
-rw-r--r--EssentialsGeoIP/src/plugin.yml2
-rw-r--r--EssentialsProtect/src/plugin.yml2
-rw-r--r--EssentialsSpawn/src/plugin.yml2
-rw-r--r--EssentialsiConomyBridge/nbproject/project.properties156
-rw-r--r--EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/existCheck.java22
-rw-r--r--EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/iConomy.java71
-rw-r--r--EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java66
-rw-r--r--EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.java65
-rw-r--r--EssentialsiConomyBridge/src/plugin.yml5
20 files changed, 350 insertions, 320 deletions
diff --git a/Essentials/nbproject/project.properties b/Essentials/nbproject/project.properties
index 1d6a5d5bd..705c62f01 100644
--- a/Essentials/nbproject/project.properties
+++ b/Essentials/nbproject/project.properties
@@ -1,78 +1,78 @@
-annotation.processing.enabled=true
-annotation.processing.enabled.in.editor=false
-annotation.processing.run.all.processors=true
-annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
-application.title=Essentials
-application.vendor=Paul
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-# Uncomment to specify the preferred debugger connection transport:
-#debug.transport=dt_socket
-debug.classpath=\
- ${run.classpath}
-debug.test.classpath=\
- ${run.test.classpath}
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/Essentials.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-endorsed.classpath=
-excludes=
-file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=..\\lib\\craftbukkit-0.0.1-SNAPSHOT.jar
-file.reference.EssentialsiConomyBridge.jar=..\\lib\\EssentialsiConomyBridge.jar
-file.reference.junit-4.5.jar=..\\lib\\junit_4\\junit-4.5.jar
-file.reference.Permissions.jar=..\\lib\\Permissions.jar
-includes=**
-jar.compress=false
-javac.classpath=\
- ${file.reference.Permissions.jar}:\
- ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\
- ${file.reference.EssentialsiConomyBridge.jar}
-# Space-separated list of extra javac options
-javac.compilerargs=
-javac.deprecation=false
-javac.processorpath=\
- ${javac.classpath}
-javac.source=1.5
-javac.target=1.5
-javac.test.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}:\
- ${file.reference.junit-4.5.jar}
-javac.test.processorpath=\
- ${javac.test.classpath}
-javadoc.additionalparam=
-javadoc.author=false
-javadoc.encoding=${source.encoding}
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=true
-javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
-meta.inf.dir=${src.dir}/META-INF
-mkdist.disabled=false
-platform.active=default_platform
-run.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project
-# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
-# or test-sys-prop.name=value to set system properties for unit tests):
-run.jvmargs=-Djline.terminal=jline.UnsupportedTerminal
-run.test.classpath=\
- ${javac.test.classpath}:\
- ${build.test.classes.dir}
-source.encoding=UTF-8
-src.dir=src
-test.src.dir=test
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=Essentials
+application.vendor=Paul
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/Essentials.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=..\\lib\\craftbukkit-0.0.1-SNAPSHOT.jar
+file.reference.iConomy.jar=../lib/iConomy.jar
+file.reference.junit-4.5.jar=..\\lib\\junit_4\\junit-4.5.jar
+file.reference.Permissions.jar=..\\lib\\Permissions.jar
+includes=**
+jar.compress=false
+javac.classpath=\
+ ${file.reference.Permissions.jar}:\
+ ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\
+ ${file.reference.iConomy.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.5
+javac.target=1.5
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}:\
+ ${file.reference.junit-4.5.jar}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=-Djline.terminal=jline.UnsupportedTerminal
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java
index 8f32b85c8..94e9f73bb 100644
--- a/Essentials/src/com/earth2me/essentials/Essentials.java
+++ b/Essentials/src/com/earth2me/essentials/Essentials.java
@@ -41,6 +41,7 @@ public class Essentials extends JavaPlugin
private Backup backup;
private Map<String, User> users = new HashMap<String, User>();
private EssentialsTimer timer;
+ private boolean iConomyFallback = true;
public Essentials()
{
@@ -605,4 +606,12 @@ public class Essentials extends JavaPlugin
}
return null;
}
+
+ public void setIConomyFallback(boolean iConomyFallback) {
+ this.iConomyFallback = iConomyFallback;
+ }
+
+ public boolean isIConomyFallbackEnabled() {
+ return iConomyFallback;
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
index 0d45082b4..8c1eca6d8 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
@@ -1,6 +1,5 @@
package com.earth2me.essentials;
-import java.text.DecimalFormat;
import org.bukkit.Material;
import org.bukkit.block.Sign;
import org.bukkit.craftbukkit.block.CraftSign;
@@ -12,7 +11,6 @@ import org.bukkit.inventory.ItemStack;
public class EssentialsEcoBlockListener extends BlockListener
{
- public static DecimalFormat df = new DecimalFormat("0.##");
Essentials ess;
public EssentialsEcoBlockListener(Essentials ess)
@@ -116,8 +114,8 @@ public class EssentialsEcoBlockListener extends BlockListener
{
throw new Exception("Don't sell air.");
}
- String d = df.format(Double.parseDouble(event.getLine(3).replaceAll("[^0-9\\.]", "")));
- event.setLine(3, "$" + d);
+ double price = Double.parseDouble(event.getLine(3).replaceAll("[^0-9\\.]", ""));
+ event.setLine(3, Util.formatCurrency(price));
}
catch (Throwable ex)
{
@@ -141,8 +139,8 @@ public class EssentialsEcoBlockListener extends BlockListener
{
throw new Exception("Don't buy air.");
}
- String d = df.format(Double.parseDouble(event.getLine(3).replaceAll("[^0-9\\.]", "")));
- event.setLine(3, "$" + d);
+ double price = Double.parseDouble(event.getLine(3).replaceAll("[^0-9\\.]", ""));
+ event.setLine(3, Util.formatCurrency(price));
}
catch (Throwable ex)
{
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java
index 5d562a53b..f7eb4011d 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java
@@ -125,7 +125,7 @@ public class EssentialsEcoPlayerListener extends PlayerListener
user.updateInventory();
}
r1 = 0;
- sign.setLine(1, (m1 ? "$" + q1 : q1 + " " + l1[1]) + ":" + r1);
+ sign.setLine(1, (m1 ? Util.formatCurrency(q1) : (int)q1 + " " + l1[1]) + ":" + r1);
}
else
{
@@ -177,8 +177,8 @@ public class EssentialsEcoPlayerListener extends PlayerListener
r2 -= q2;
sign.setLine(0, "§1[Trade]");
- sign.setLine(1, (m1 ? "$" + q1 : q1 + " " + l1[1]) + ":" + r1);
- sign.setLine(2, (m2 ? "$" + q2 : q2 + " " + l2[1]) + ":" + r2);
+ sign.setLine(1, (m1 ? Util.formatCurrency(q1) : (int)q1 + " " + l1[1]) + ":" + r1);
+ sign.setLine(2, (m2 ? Util.formatCurrency(q2) : (int)q2 + " " + l2[1]) + ":" + r2);
user.sendMessage("§7Trade completed.");
}
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index aa0b16157..4ca4b21d2 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -19,7 +19,6 @@ public class User extends UserData implements Comparable<User>, IReplyTo
private boolean teleportRequestHere;
private Teleport teleport;
private long lastActivity;
- private static DecimalFormat df = new DecimalFormat("0.##");
User(Player base, Essentials ess)
{
@@ -86,8 +85,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo
return;
}
setMoney(getMoney() + value);
- String d = df.format(Double.parseDouble(Double.toString(value)));
- sendMessage("§a$" + d + " has been added to your account.");
+ sendMessage("§a" + Util.formatCurrency(value) + " has been added to your account.");
}
public void payUser(User reciever, double value) throws Exception
@@ -104,9 +102,8 @@ public class User extends UserData implements Comparable<User>, IReplyTo
{
setMoney(getMoney() - value);
reciever.setMoney(reciever.getMoney() + value);
- String d = df.format(Double.parseDouble(Double.toString(value)));
- sendMessage("§a$" + d + " has been sent to " + reciever.getDisplayName());
- reciever.sendMessage("§a$" + d + " has been recieved from " + getDisplayName());
+ sendMessage("§a" + Util.formatCurrency(value) + " has been sent to " + reciever.getDisplayName());
+ reciever.sendMessage("§a" + Util.formatCurrency(value) + " has been recieved from " + getDisplayName());
}
}
@@ -117,8 +114,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo
return;
}
setMoney(getMoney() - value);
- String d = df.format(Double.parseDouble(Double.toString(value)));
- sendMessage("§c$" + d + " has been taken from your account.");
+ sendMessage("§c$" + Util.formatCurrency(value) + " has been taken from your account.");
}
public void charge(String cmd) throws Exception
diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java
index 170394014..12a028a6b 100644
--- a/Essentials/src/com/earth2me/essentials/UserData.java
+++ b/Essentials/src/com/earth2me/essentials/UserData.java
@@ -63,28 +63,33 @@ public abstract class UserData extends PlayerExtension implements IConf
{
return config.getDouble("money", ess.getSettings().getStartingBalance());
}
-
- try
- {
- return com.nijiko.coelho.iConomy.iConomy.getBank().getAccount(getName()).getBalance();
- }
- catch (Throwable ex)
+ if (ess.isIConomyFallbackEnabled())
{
- return ess.getSettings().getStartingBalance();
+ try
+ {
+ return com.nijiko.coelho.iConomy.iConomy.getBank().getAccount(getName()).getBalance();
+ }
+ catch (Throwable ex)
+ {
+ }
}
+ return ess.getSettings().getStartingBalance();
}
public void setMoney(double value)
{
- try
+ if (ess.isIConomyFallbackEnabled())
{
- com.nijiko.coelho.iConomy.iConomy.getBank().getAccount(getName()).setBalance(value);
- }
- catch (Throwable ex)
- {
- config.setProperty("money", value);
- config.save();
+ try
+ {
+ com.nijiko.coelho.iConomy.iConomy.getBank().getAccount(getName()).setBalance(value);
+ }
+ catch (Throwable ex)
+ {
+ }
}
+ config.setProperty("money", value);
+ config.save();
}
public boolean hasHome()
diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java
index e7911fdb5..ddcfe1522 100644
--- a/Essentials/src/com/earth2me/essentials/Util.java
+++ b/Essentials/src/com/earth2me/essentials/Util.java
@@ -1,5 +1,6 @@
package com.earth2me.essentials;
+import java.text.DecimalFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.regex.Matcher;
@@ -256,19 +257,9 @@ public class Util
}
return isBlockAboveAir(world, x, y, z);
}
- public static boolean detectFay()
- {
- try
- {
- if (com.nijiko.coelho.iConomy.iConomy.isFay())
- {
- return true;
- }
- }
- catch (Throwable ex)
- {
- return false;
- }
- return false;
+
+ private static DecimalFormat df = new DecimalFormat("0.##");
+ public static String formatCurrency(double value) {
+ return "$"+df.format(value);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/EcoAPI.java b/Essentials/src/com/earth2me/essentials/api/Economy.java
index 401b2cc34..3aaeab42a 100644
--- a/Essentials/src/com/earth2me/essentials/EcoAPI.java
+++ b/Essentials/src/com/earth2me/essentials/api/Economy.java
@@ -1,5 +1,8 @@
-package com.earth2me.essentials;
+package com.earth2me.essentials.api;
+import com.earth2me.essentials.Essentials;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
@@ -8,11 +11,10 @@ import java.text.DecimalFormat;
import org.bukkit.Bukkit;
-
-public class EcoAPI
+public class Economy
{
- protected static Essentials ess=Essentials.getStatic();
-
+ protected static Essentials ess = Essentials.getStatic();
+
//Does the file exists?
protected static boolean accountCreated(String name)
{
@@ -29,7 +31,7 @@ public class EcoAPI
File folder = new File(ess.getDataFolder(), "userdata");
File npcFile = new File(folder, name + ".yml");
-
+
try
{
if (!npcFile.createNewFile())
@@ -125,7 +127,7 @@ public class EcoAPI
{
if (accountCreated(name))
{
- User user = usrConv(name);
+ User user = usrConv(name);
return user.getMoney();
}
return 0;
@@ -314,7 +316,6 @@ public class EcoAPI
//Eco remove account, only use this for NPCS!
public static void removeAccount(String name)
{
-
if (!exist(name))
{
if (accountCreated(name))
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
index c5ab9cd26..171a97420 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
@@ -4,13 +4,13 @@ import org.bukkit.Server;
import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.ItemDb;
import com.earth2me.essentials.User;
-import java.text.DecimalFormat;
+import com.earth2me.essentials.Util;
import org.bukkit.inventory.ItemStack;
public class Commandworth extends EssentialsCommand
{
- private static DecimalFormat df = new DecimalFormat("0.##");
+
public Commandworth()
{
super("worth");
@@ -46,9 +46,10 @@ public class Commandworth extends EssentialsCommand
throw new Exception("That item cannot be sold to the server.");
}
- user.charge(this);
- String d = df.format(Double.parseDouble(Double.toString(worth)));
- String d2 = df.format(Double.parseDouble(Double.toString(Double.parseDouble(d)*amount)));
- user.sendMessage("§7Stack of " + is.getType().toString().toLowerCase().replace("_", "") + " worth §c$" + d2 + "§7 (" + amount + " item(s) at $" + d + " each)");
+ user.charge(this);
+ user.sendMessage("§7Stack of "
+ + is.getType().toString().toLowerCase().replace("_", "")
+ + " worth §c$" + Util.formatCurrency(worth*amount) + "§7 ("
+ + amount + " item(s) at $" + Util.formatCurrency(worth) + " each)");
}
}
diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml
index bbf65d7c3..e17b52e9a 100644
--- a/Essentials/src/plugin.yml
+++ b/Essentials/src/plugin.yml
@@ -5,7 +5,7 @@ main: com.earth2me.essentials.Essentials
version: TeamCity
website: http://www.earth2me.net:8001/
description: Provides an essential, core set of commands for Bukkit.
-authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo]
+authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
commands:
afk:
description: Marks you as away-from-keyboard.
diff --git a/EssentialsChat/src/plugin.yml b/EssentialsChat/src/plugin.yml
index b4f7bb9c9..d0cc4616d 100644
--- a/EssentialsChat/src/plugin.yml
+++ b/EssentialsChat/src/plugin.yml
@@ -5,4 +5,4 @@ main: com.earth2me.essentials.chat.EssentialsChat
version: TeamCity
website: http://www.earth2me.net:8001/
description: Provides chat control features for Essentials. Requires Permissions.
-authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo] \ No newline at end of file
+authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology] \ No newline at end of file
diff --git a/EssentialsGeoIP/src/plugin.yml b/EssentialsGeoIP/src/plugin.yml
index 26d75ce77..3ca12eb93 100644
--- a/EssentialsGeoIP/src/plugin.yml
+++ b/EssentialsGeoIP/src/plugin.yml
@@ -5,4 +5,4 @@ main: com.earth2me.essentials.geoip.EssentialsGeoIP
version: TeamCity
website: http://www.earth2me.net:8001/
description: Shows the country or city of a user on login and /whois.
-authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo] \ No newline at end of file
+authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology] \ No newline at end of file
diff --git a/EssentialsProtect/src/plugin.yml b/EssentialsProtect/src/plugin.yml
index c6f7830c1..c8b77dbd9 100644
--- a/EssentialsProtect/src/plugin.yml
+++ b/EssentialsProtect/src/plugin.yml
@@ -5,4 +5,4 @@ main: com.earth2me.essentials.protect.EssentialsProtect
version: TeamCity
website: http://www.earth2me.net:8001/
description: Provides protection for various parts of the world.
-authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo] \ No newline at end of file
+authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology] \ No newline at end of file
diff --git a/EssentialsSpawn/src/plugin.yml b/EssentialsSpawn/src/plugin.yml
index de4e39b15..35f8172dd 100644
--- a/EssentialsSpawn/src/plugin.yml
+++ b/EssentialsSpawn/src/plugin.yml
@@ -5,7 +5,7 @@ main: com.earth2me.essentials.spawn.EssentialsSpawn
version: TeamCity
website: http://www.earth2me.net:8001/
description: Provides spawn control commands, utilizing Essentials.
-authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo]
+authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
commands:
setspawn:
description: Set the spawnpoint to your current position.
diff --git a/EssentialsiConomyBridge/nbproject/project.properties b/EssentialsiConomyBridge/nbproject/project.properties
index ad222814c..22251c50d 100644
--- a/EssentialsiConomyBridge/nbproject/project.properties
+++ b/EssentialsiConomyBridge/nbproject/project.properties
@@ -1,78 +1,78 @@
-annotation.processing.enabled=true
-annotation.processing.enabled.in.editor=false
-annotation.processing.run.all.processors=true
-annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
-application.title=EssentialsiConomyBridge
-application.vendor=schlex
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-# Uncomment to specify the preferred debugger connection transport:
-#debug.transport=dt_socket
-debug.classpath=\
- ${run.classpath}
-debug.test.classpath=\
- ${run.test.classpath}
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/EssentialsiConomyBridge.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-endorsed.classpath=
-excludes=
-file.reference.bukkit-0.0.1-SNAPSHOT.jar=..\\lib\\bukkit-0.0.1-SNAPSHOT.jar
-file.reference.Essentials.jar=..\\Essentials\\dist\\Essentials.jar
-file.reference.Essentials.jar=..\\lib\\bukkit-0.0.1-SNAPSHOT.jar
-includes=**
-jar.compress=false
-javac.classpath=\
- ${reference.Essentials.jar}:\
- ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}
-javac.compilerargs=
-javac.deprecation=false
-javac.processorpath=\
- ${javac.classpath}
-javac.source=1.6
-javac.target=1.6
-javac.test.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-javac.test.processorpath=\
- ${javac.test.classpath}
-javadoc.additionalparam=
-javadoc.author=false
-javadoc.encoding=${source.encoding}
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=true
-javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
-main.class=
-manifest.file=manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-mkdist.disabled=false
-platform.active=default_platform
-project.Essentials=../Essentials
-reference.Essentials.jar=${project.Essentials}/dist/Essentials.jar
-run.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project
-# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
-# or test-sys-prop.name=value to set system properties for unit tests):
-run.jvmargs=
-run.test.classpath=\
- ${javac.test.classpath}:\
- ${build.test.classes.dir}
-source.encoding=UTF-8
-src.dir=src
-test.src.dir=test
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=EssentialsiConomyBridge
+application.vendor=schlex
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/EssentialsiConomyBridge.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+file.reference.bukkit-0.0.1-SNAPSHOT.jar=..\\lib\\bukkit-0.0.1-SNAPSHOT.jar
+file.reference.Essentials.jar=..\\Essentials\\dist\\Essentials.jar
+file.reference.Essentials.jar=..\\lib\\bukkit-0.0.1-SNAPSHOT.jar
+includes=**
+jar.compress=false
+javac.classpath=\
+ ${reference.Essentials.jar}:\
+ ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.6
+javac.target=1.6
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+project.Essentials=../Essentials
+reference.Essentials.jar=${project.Essentials}/dist/Essentials.jar
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
diff --git a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/existCheck.java b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/existCheck.java
index e0966fa3f..f01e686bf 100644
--- a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/existCheck.java
+++ b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/existCheck.java
@@ -1,19 +1,25 @@
package com.nijiko.coelho.iConomy;
+import java.util.logging.Logger;
import org.bukkit.Bukkit;
-public class existCheck {
+public class existCheck
+{
+ private static final Logger logger = Logger.getLogger("Minecraft");
//We have to make sure the user exists!
-
- public static boolean exist(String name){
- if (name==null){
- System.out.println("Essentials iConpomy Bridge - Whatever plugin is calling for users that are null is BROKEN!");
+ public static boolean exist(String name)
+ {
+
+ if (name == null)
+ {
+ logger.info("Essentials iConomy Bridge - Whatever plugin is calling for users that are null is BROKEN!");
return false;
}
- if (Bukkit.getServer().getPlayer(name)!=null){
- return true;
- }
+ if (Bukkit.getServer().getPlayer(name) != null)
+ {
+ return true;
+ }
return false;
}
} \ No newline at end of file
diff --git a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/iConomy.java b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/iConomy.java
index 1690040b0..6cb2e7c3f 100644
--- a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/iConomy.java
+++ b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/iConomy.java
@@ -1,39 +1,58 @@
package com.nijiko.coelho.iConomy;
+import com.earth2me.essentials.Essentials;
import org.bukkit.plugin.java.JavaPlugin;
import com.nijiko.coelho.iConomy.system.Bank;
-
-//This is not iConomy and I take NO credit for iConomy!
-//This is FayConomy, a iConomy Essentials Eco bridge!
-//@author Xeology
-
-//Pretend we are iConomy
-
-public class iConomy extends JavaPlugin{
- public static Bank Bank=null;
-
- //This is for the Essentials to detect FayConomy!
-
- public static boolean isFay(){
- return true;
- }
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.bukkit.plugin.Plugin;
+import org.bukkit.plugin.PluginManager;
+
+/**
+ * This is not iConomy and I take NO credit for iConomy!
+ * This is FayConomy, a iConomy Essentials Eco bridge!
+ * @author Xeology
+ */
+
+public class iConomy extends JavaPlugin
+{
+ public static Bank Bank = null;
+ private static final Logger logger = Logger.getLogger("Minecraft");
@Override
- public void onDisable() {
+ public void onDisable()
+ {
}
@Override
- public void onEnable() {
- Bank=new Bank();
-
- //Can not announce my plugin.yml file, this is NOT iConomy!
+ public void onEnable()
+ {
+ PluginManager pm = this.getServer().getPluginManager();
+ Plugin p = pm.getPlugin("Essentials");
+ if (p != null)
+ {
+ if (!pm.isPluginEnabled(p))
+ {
+ pm.enablePlugin(p);
+ }
+ }
+
+ String version = this.getDescription().getDescription().replaceAll(".*: ", "");
+ if (!version.equals(Essentials.getStatic().getDescription().getVersion()))
+ {
+ logger.log(Level.WARNING, "Version mismatch! Please update all Essentials jars to the same version.");
+ }
+ Essentials.getStatic().setIConomyFallback(false);
+
+ Bank = new Bank();
- System.out.println("Essentials iConomy Bridge v1.0 iz in ur Bukkitz emulating ur iConomyz!");
+ logger.info("Loaded " + this.getDescription().getDescription() + " by " + Essentials.AUTHORS);
+ logger.info("Make sure you don't have iConomy installed, if you use this.");
}
-
+
//Fake bank
-
- public static Bank getBank() {
- return Bank;
- }
+ public static Bank getBank()
+ {
+ return Bank;
+ }
}
diff --git a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java
index 740b31f58..a4a48b2ca 100644
--- a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java
+++ b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java
@@ -1,6 +1,6 @@
package com.nijiko.coelho.iConomy.system;
-import com.earth2me.essentials.EcoAPI;
+import com.earth2me.essentials.api.Economy;
import com.nijiko.coelho.iConomy.existCheck;
@@ -8,13 +8,15 @@ public class Account
{
private String name;
- //Fake getname
public String getName()
{
return name;
}
- //Essentials doesnt have hidden accounts so just say yeah whatever!
+ /**
+ * Essentials does not support hidden accounts.
+ * @return false
+ */
public boolean setHidden(boolean hidden)
{
return true;
@@ -26,122 +28,118 @@ public class Account
this.name = name;
}
- //Fake return balance
public double getBalance()
{
if (!existCheck.exist(name))
{
- if (EcoAPI.accountExist(name))
+ if (Economy.accountExist(name))
{
- return EcoAPI.getMoney(name);
+ return Economy.getMoney(name);
}
return 0;
}
- return EcoAPI.getMoney(name);
+ return Economy.getMoney(name);
}
- //Fake Set balance
public void setBalance(double bal)
{
if (!existCheck.exist(name))
{
- if (EcoAPI.accountExist(name))
+ if (Economy.accountExist(name))
{
- EcoAPI.setMoney(name, bal);
+ Economy.setMoney(name, bal);
}
return;
}
- EcoAPI.setMoney(name, bal);
+ Economy.setMoney(name, bal);
}
- //Fake add balance
public void add(double money)
{
if (!existCheck.exist(name))
{
- if (EcoAPI.accountExist(name))
+ if (Economy.accountExist(name))
{
- EcoAPI.add(name, money);
+ Economy.add(name, money);
}
return;
}
- EcoAPI.add(name, money);
+ Economy.add(name, money);
}
- //Fake divide balance
public void divide(double money)
{
if (!existCheck.exist(name))
{
- if (EcoAPI.accountExist(name))
+ if (Economy.accountExist(name))
{
- EcoAPI.divide(name, money);
+ Economy.divide(name, money);
}
return;
}
- EcoAPI.divide(name, money);
+ Economy.divide(name, money);
}
- //Fake multiply balance
public void multiply(double money)
{
if (!existCheck.exist(name))
{
- if (EcoAPI.accountExist(name))
+ if (Economy.accountExist(name))
{
- EcoAPI.multiply(name, money);
+ Economy.multiply(name, money);
}
return;
}
- EcoAPI.multiply(name, money);
+ Economy.multiply(name, money);
}
- //Fake subtract balance
public void subtract(double money)
{
if (!existCheck.exist(name))
{
- if (EcoAPI.accountExist(name))
+ if (Economy.accountExist(name))
{
- EcoAPI.subtract(name, money);
+ Economy.subtract(name, money);
}
return;
}
- EcoAPI.subtract(name, money);
+ Economy.subtract(name, money);
}
- //fake reset balance!
public void resetBalance()
{
this.setBalance(0);
}
- //fake bal check
public boolean hasEnough(double amount)
{
return amount <= this.getBalance();
}
- //fake another balance check
public boolean hasOver(double amount)
{
return amount < this.getBalance();
}
- //Again we dont have hidden accounts here!
+ /**
+ * Essentials does not support hidden accounts.
+ * @return false
+ */
public boolean isHidden()
{
return false;
}
- //Fake is negative check!
public boolean isNegative()
{
return this.getBalance() < 0.0;
}
- //Because some plugins like to use depricated methods I must save
- //admins' log from the overflow of dumb
+ /**
+ * Because some plugins like to use depricated methods I must save
+ * admins' log from the overflow of dumb
+ */
+ @Deprecated
public void save()
{
}
diff --git a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.java b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.java
index b70803dda..54e8e6387 100644
--- a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.java
+++ b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.java
@@ -1,53 +1,56 @@
package com.nijiko.coelho.iConomy.system;
-import com.earth2me.essentials.EcoAPI;
+import com.earth2me.essentials.api.Economy;
import com.nijiko.coelho.iConomy.existCheck;
-public class Bank {
-
- //The fake formatter
-
- public String format(double amount) {
- return EcoAPI.format(amount);
- }
+public class Bank
+{
+ //The fake formatter
+ public String format(double amount)
+ {
+ return Economy.format(amount);
+ }
//Fake currency!
-
- public String getCurrency() {
- return EcoAPI.getCurrency();
- }
+ public String getCurrency()
+ {
+ return Economy.getCurrency();
+ }
//Fake "does player have an account?" but essentials eco doesnt need to make one, so TRUE, unless its an NPC.
-
- public boolean hasAccount(String account) {
- if (!existCheck.exist(account)){
- if (!EcoAPI.accountExist(account)){
- EcoAPI.newAccount(account);
- }
+ public boolean hasAccount(String account)
+ {
+ if (!existCheck.exist(account))
+ {
+ if (!Economy.accountExist(account))
+ {
+ Economy.newAccount(account);
+ }
}
return true;
}
-
+
//simply switches the name to an account type?
-
- public Account getAccount(String name){
- Account Account=null;
- Account=new Account(name);
+ public Account getAccount(String name)
+ {
+ Account Account = null;
+ Account = new Account(name);
hasAccount(name);
return Account;
}
-
+
//Fake remove account
-
- public void removeAccount(String name){
- if (!existCheck.exist(name)){
- if (EcoAPI.accountExist(name)){
- EcoAPI.removeAccount(name);
+ public void removeAccount(String name)
+ {
+ if (!existCheck.exist(name))
+ {
+ if (Economy.accountExist(name))
+ {
+ Economy.removeAccount(name);
}
return;
}
- EcoAPI.setMoney(name, 0);
+ Economy.setMoney(name, 0);
}
-
}
diff --git a/EssentialsiConomyBridge/src/plugin.yml b/EssentialsiConomyBridge/src/plugin.yml
index 4e4eb7d4d..9e088681b 100644
--- a/EssentialsiConomyBridge/src/plugin.yml
+++ b/EssentialsiConomyBridge/src/plugin.yml
@@ -1,3 +1,6 @@
name: iConomy
version: 4.65
-main: com.nijiko.coelho.iConomy.iConomy \ No newline at end of file
+main: com.nijiko.coelho.iConomy.iConomy
+website: http://www.earth2me.net:8001/
+description: "Essentials iConomy Bridge version: TeamCity"
+authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]