summaryrefslogtreecommitdiffstats
path: root/Essentials2Compat
diff options
context:
space:
mode:
authormd_5 <md_5@bigpond.com>2012-06-27 20:27:27 +1000
committermd_5 <md_5@bigpond.com>2012-06-27 20:27:27 +1000
commit06f54fdbac1874c549b5181d92b4a9474da55dcc (patch)
tree0390c78353d15cc239512fd2b9a1990df58b7300 /Essentials2Compat
parent4561a7f0106adb7bd62e2d42114cb80a3a30b570 (diff)
downloadEssentials-06f54fdbac1874c549b5181d92b4a9474da55dcc.tar
Essentials-06f54fdbac1874c549b5181d92b4a9474da55dcc.tar.gz
Essentials-06f54fdbac1874c549b5181d92b4a9474da55dcc.tar.lz
Essentials-06f54fdbac1874c549b5181d92b4a9474da55dcc.tar.xz
Essentials-06f54fdbac1874c549b5181d92b4a9474da55dcc.zip
That just leaves the big ol' core. Largely ignore Compat as it is very temporary.
Diffstat (limited to 'Essentials2Compat')
-rw-r--r--Essentials2Compat/src/com/earth2me/essentials/Essentials.java8
-rw-r--r--Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java105
-rw-r--r--Essentials2Compat/src/com/earth2me/essentials/api/Economy.java27
3 files changed, 72 insertions, 68 deletions
diff --git a/Essentials2Compat/src/com/earth2me/essentials/Essentials.java b/Essentials2Compat/src/com/earth2me/essentials/Essentials.java
index dc612e8d6..840ef7d37 100644
--- a/Essentials2Compat/src/com/earth2me/essentials/Essentials.java
+++ b/Essentials2Compat/src/com/earth2me/essentials/Essentials.java
@@ -9,14 +9,8 @@ public class Essentials extends JavaPlugin
@Override
public void onEnable()
{
- Bukkit.getLogger().info("You can remove this compatibility plugin, when all plugins are updated to Essentials 3");
+ Bukkit.getLogger().info("You can remove this compatibility plugin, when all plugins are updated to Essentials-3");
//TODO: Update files to new 3.0 format
//TODO: Move Eco Api here
}
-
- @Override
- public void onDisable()
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
}
diff --git a/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java
index 865af41e3..d912caf7e 100644
--- a/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java
+++ b/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java
@@ -386,7 +386,6 @@ public class EssentialsUpgrade
* ((Number)vals.get(4)).floatValue())); } } } } usersFile.renameTo(new File(usersFile.getAbsolutePath() + ".old"));
* }
*/
-
private void convertWarps()
{
final File warpsFolder = new File(ess.getDataFolder(), "warps");
@@ -461,56 +460,56 @@ public class EssentialsUpgrade
}
/*final File warpFile = new File(ess.getDataFolder(), "warps.txt");
- if (warpFile.exists())
- {
- try
- {
- final BufferedReader rx = new BufferedReader(new FileReader(warpFile));
- try
- {
- for (String[] parts = new String[0]; rx.ready(); parts = rx.readLine().split(":"))
- {
- if (parts.length < 6)
- {
- continue;
- }
- final String name = parts[0];
- final double x = Double.parseDouble(parts[1].trim());
- final double y = Double.parseDouble(parts[2].trim());
- final double z = Double.parseDouble(parts[3].trim());
- final float yaw = Float.parseFloat(parts[4].trim());
- final float pitch = Float.parseFloat(parts[5].trim());
- if (name.isEmpty())
- {
- continue;
- }
- World w = null;
- for (World world : ess.getServer().getWorlds())
- {
- if (world.getEnvironment() != World.Environment.NETHER)
- {
- w = world;
- break;
- }
- }
- final Location loc = new Location(name, x, y, z, yaw, pitch);
- ess.getWarps().setWarp(name, loc);
- if (!warpFile.renameTo(new File(ess.getDataFolder(), "warps.txt.old")))
- {
- throw new Exception(_("fileRenameError", "warps.txt"));
- }
- }
- }
- finally
- {
- rx.close();
- }
- }
- catch (Exception ex)
- {
- LOGGER.log(Level.SEVERE, null, ex);
- }
- }*/
+ if (warpFile.exists())
+ {
+ try
+ {
+ final BufferedReader rx = new BufferedReader(new FileReader(warpFile));
+ try
+ {
+ for (String[] parts = new String[0]; rx.ready(); parts = rx.readLine().split(":"))
+ {
+ if (parts.length < 6)
+ {
+ continue;
+ }
+ final String name = parts[0];
+ final double x = Double.parseDouble(parts[1].trim());
+ final double y = Double.parseDouble(parts[2].trim());
+ final double z = Double.parseDouble(parts[3].trim());
+ final float yaw = Float.parseFloat(parts[4].trim());
+ final float pitch = Float.parseFloat(parts[5].trim());
+ if (name.isEmpty())
+ {
+ continue;
+ }
+ World w = null;
+ for (World world : ess.getServer().getWorlds())
+ {
+ if (world.getEnvironment() != World.Environment.NETHER)
+ {
+ w = world;
+ break;
+ }
+ }
+ final Location loc = new Location(name, x, y, z, yaw, pitch);
+ ess.getWarps().setWarp(name, loc);
+ if (!warpFile.renameTo(new File(ess.getDataFolder(), "warps.txt.old")))
+ {
+ throw new Exception(_("fileRenameError", "warps.txt"));
+ }
+ }
+ }
+ finally
+ {
+ rx.close();
+ }
+ }
+ catch (Exception ex)
+ {
+ LOGGER.log(Level.SEVERE, null, ex);
+ }
+ }*/
}
/*
@@ -532,7 +531,7 @@ public class EssentialsUpgrade
* ess.getDataFolder().getParentFile().getParentFile(); final File worldDirectory = new File(bukkitDirectory, name);
* if (worldDirectory.exists() && worldDirectory.isDirectory()) { return new FakeWorld(worldDirectory.getName(),
* World.Environment.NORMAL); } return null;
- }
+ }
*/
public Location getFakeLocation(EssentialsConf config, String path)
{
@@ -697,7 +696,7 @@ public class EssentialsUpgrade
return;
}
//todo - metrics
- // ess.getSettings().setMetricsEnabled(false);
+ // ess.getSettings().setMetricsEnabled(false);
doneFile.setProperty("warnMetrics", true);
doneFile.save();
}
diff --git a/Essentials2Compat/src/com/earth2me/essentials/api/Economy.java b/Essentials2Compat/src/com/earth2me/essentials/api/Economy.java
index cf8cb640c..663c451c6 100644
--- a/Essentials2Compat/src/com/earth2me/essentials/api/Economy.java
+++ b/Essentials2Compat/src/com/earth2me/essentials/api/Economy.java
@@ -4,8 +4,7 @@ import com.earth2me.essentials.utils.Util;
/**
- * Instead of using this api directly, we recommend to use the register plugin:
- * http://bit.ly/RegisterMethod
+ * Instead of using this api directly, we recommend to use the register plugin: http://bit.ly/RegisterMethod
*/
public final class Economy
{
@@ -17,9 +16,10 @@ public final class Economy
/**
* Returns the balance of a user
+ *
* @param name Name of the user
* @return balance
- * @throws UserDoesNotExistException
+ * @throws UserDoesNotExistException
*/
public static double getMoney(String name) throws UserDoesNotExistException
{
@@ -32,6 +32,7 @@ public final class Economy
/**
* Sets the balance of a user
+ *
* @param name Name of the user
* @param balance The balance you want to set
* @throws UserDoesNotExistException If a user by that name does not exists
@@ -48,6 +49,7 @@ public final class Economy
/**
* Adds money to the balance of a user
+ *
* @param name Name of the user
* @param amount The money you want to add
* @throws UserDoesNotExistException If a user by that name does not exists
@@ -61,6 +63,7 @@ public final class Economy
/**
* Substracts money from the balance of a user
+ *
* @param name Name of the user
* @param amount The money you want to substract
* @throws UserDoesNotExistException If a user by that name does not exists
@@ -74,6 +77,7 @@ public final class Economy
/**
* Divides the balance of a user by a value
+ *
* @param name Name of the user
* @param value The balance is divided by this value
* @throws UserDoesNotExistException If a user by that name does not exists
@@ -87,6 +91,7 @@ public final class Economy
/**
* Multiplies the balance of a user by a value
+ *
* @param name Name of the user
* @param value The balance is multiplied by this value
* @throws UserDoesNotExistException If a user by that name does not exists
@@ -100,6 +105,7 @@ public final class Economy
/**
* Resets the balance of a user to the starting balance
+ *
* @param name Name of the user
* @throws UserDoesNotExistException If a user by that name does not exists
* @throws NoLoanPermittedException If the user is not allowed to have a negative balance
@@ -148,6 +154,7 @@ public final class Economy
/**
* Test if the user has a negative balance
+ *
* @param name Name of the user
* @return true, if the user has a negative balance
* @throws UserDoesNotExistException If a user by that name does not exists
@@ -158,8 +165,8 @@ public final class Economy
}
/**
- * Formats the amount of money like all other Essentials functions.
- * Example: $100000 or $12345.67
+ * Formats the amount of money like all other Essentials functions. Example: $100000 or $12345.67
+ *
* @param amount The amount of money
* @return Formatted money
*/
@@ -174,6 +181,7 @@ public final class Economy
/**
* Test if a player exists to avoid the UserDoesNotExistException
+ *
* @param name Name of the user
* @return true, if the user exists
*/
@@ -188,9 +196,10 @@ public final class Economy
/**
* Test if a player is a npc
+ *
* @param name Name of the player
* @return true, if it's a npc
- * @throws UserDoesNotExistException
+ * @throws UserDoesNotExistException
*/
public static boolean isNPC(String name) throws UserDoesNotExistException
{
@@ -203,6 +212,7 @@ public final class Economy
/**
* Creates dummy files for a npc, if there is no player yet with that name.
+ *
* @param name Name of the player
* @return true, if a new npc was created
*/
@@ -216,9 +226,10 @@ public final class Economy
}
/**
- * Deletes a user, if it is marked as npc.
+ * Deletes a user, if it is marked as npc.
+ *
* @param name Name of the player
- * @throws UserDoesNotExistException
+ * @throws UserDoesNotExistException
*/
public static void removeNPC(String name) throws UserDoesNotExistException
{