summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkukelekuuk00 <luuk3904@hotmail.com>2012-05-13 13:44:41 +0200
committerkukelekuuk00 <luuk3904@hotmail.com>2012-05-13 13:44:41 +0200
commit1c1bdc1c2584c6a3253e24576bdb5b2b88496e93 (patch)
treeb1c851643c880d54453e322c874b2a5b9111cd87
parentf7e038dba1bb11a5981b4fa4a2a2f8179ce91392 (diff)
downloadEssentials-1c1bdc1c2584c6a3253e24576bdb5b2b88496e93.tar
Essentials-1c1bdc1c2584c6a3253e24576bdb5b2b88496e93.tar.gz
Essentials-1c1bdc1c2584c6a3253e24576bdb5b2b88496e93.tar.lz
Essentials-1c1bdc1c2584c6a3253e24576bdb5b2b88496e93.tar.xz
Essentials-1c1bdc1c2584c6a3253e24576bdb5b2b88496e93.zip
Added an /exp command that shows the amount of exp you have and how much you need for the next level.
Permissions are essentials.exp and essentials.exp.needed
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandexp.java39
-rw-r--r--Essentials/src/messages.properties2
-rw-r--r--Essentials/src/plugin.yml4
3 files changed, 45 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java
new file mode 100644
index 000000000..15efc02f7
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java
@@ -0,0 +1,39 @@
+package com.earth2me.essentials.commands;
+
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import com.earth2me.essentials.craftbukkit.SetExpFix;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+
+public class Commandexp extends EssentialsCommand
+{
+ public Commandexp()
+ {
+ super("exp");
+ }
+
+ @Override
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args)throws Exception
+ {
+ for (Player onlinePlayer : server.getOnlinePlayers())
+ {
+ final User user = ess.getUser(onlinePlayer);
+ {
+ if (user.isAuthorized("essentials.exp.needed"))
+ {
+ int totalexp = SetExpFix.getTotalExperience(user);
+ int expleft = (int)Util.roundDouble(((((3.5 * user.getLevel()) + 6.7) - (totalexp - ((1.75 *(user.getLevel() * user.getLevel())) + (5.00 * user.getLevel())))) + 1));
+ sender.sendMessage(_("expneeded", SetExpFix.getTotalExperience(user),"" + expleft));
+ }
+ else if (user.isAuthorized("essentials.exp"))
+ {
+ sender.sendMessage(_("exp", SetExpFix.getTotalExperience(user)));
+ }
+ }
+ }
+ }
+}
diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties
index 73ce00bee..21390d893 100644
--- a/Essentials/src/messages.properties
+++ b/Essentials/src/messages.properties
@@ -85,6 +85,8 @@ errorWithMessage=\u00a7cError: {0}
essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat
essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat
essentialsReload=\u00a77Essentials Reloaded {0}
+exp=\u00a79You have \u00a7c{0} \u00a79exp.
+expneeded=\u00a79You have \u00a7c{0} \u00a79exp and you need \u00a7c{1} more to level up.
extinguish=\u00a77You extinguished yourself.
extinguishOthers=\u00a77You extinguished {0}.
failedToCloseConfig=Failed to close config {0}
diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml
index 3e1dc52c0..6b1e8a038 100644
--- a/Essentials/src/plugin.yml
+++ b/Essentials/src/plugin.yml
@@ -90,6 +90,10 @@ commands:
essentials:
description: Reloads essentials.
usage: /<command>
+ exp:
+ description: States how much exp you have.
+ usage: /<command>
+ aliases: [eexp]
ext:
description: Extinguish players.
usage: /<command> [player]