summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-10-01 20:28:09 +0100
committerKHobbits <rob@khobbits.co.uk>2012-10-01 20:32:10 +0100
commit2e115c73a252448804a8037b5c7564d0ef7b0f40 (patch)
treefb5455db37981a063d32c214bc9dd888e5d4f60a
parentc34167a135a054707a6e0a217e85a82b7295861b (diff)
downloadEssentials-2e115c73a252448804a8037b5c7564d0ef7b0f40.tar
Essentials-2e115c73a252448804a8037b5c7564d0ef7b0f40.tar.gz
Essentials-2e115c73a252448804a8037b5c7564d0ef7b0f40.tar.lz
Essentials-2e115c73a252448804a8037b5c7564d0ef7b0f40.tar.xz
Essentials-2e115c73a252448804a8037b5c7564d0ef7b0f40.zip
Cleanup sethome
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsethome.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java7
-rw-r--r--Essentials/src/messages.properties1
-rw-r--r--Essentials/src/messages_cs.properties1
-rw-r--r--Essentials/src/messages_da.properties1
-rw-r--r--Essentials/src/messages_de.properties1
-rw-r--r--Essentials/src/messages_en.properties1
-rw-r--r--Essentials/src/messages_es.properties1
-rw-r--r--Essentials/src/messages_fi.properties1
-rw-r--r--Essentials/src/messages_fr.properties1
-rw-r--r--Essentials/src/messages_it.properties1
-rw-r--r--Essentials/src/messages_nl.properties1
-rw-r--r--Essentials/src/messages_pl.properties1
-rw-r--r--Essentials/src/messages_pt.properties1
-rw-r--r--Essentials/src/messages_se.properties1
15 files changed, 19 insertions, 7 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
index c97761f8d..eb151077f 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
@@ -4,7 +4,6 @@ import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.Locale;
-import java.util.regex.Pattern;
import org.bukkit.Location;
import org.bukkit.Server;
@@ -47,7 +46,7 @@ public class Commandsethome extends EssentialsCommand
}
if (usersHome == null)
{
- throw new Exception(_("playerNotFound"));
+ throw new NoSuchFieldException(_("playerNotFound"));
}
name = args[1].toLowerCase(Locale.ENGLISH);
}
@@ -59,8 +58,7 @@ public class Commandsethome extends EssentialsCommand
}
if ("bed".equals(name) || Util.isInt(name))
{
- user.sendMessage(_("invalidHomeName"));
- throw new NoChargeException();
+ throw new NoSuchFieldException(_("invalidHomeName"));
}
usersHome.setHome(name, location);
user.sendMessage(_("homeSet", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ()));
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
index 42da62b85..ba8c71626 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
@@ -22,9 +22,10 @@ public class Commandsetwarp extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
-
- if (args[0].matches("[0-9]+")) {
- throw new NotEnoughArgumentsException();
+
+ if (Util.isInt(args[0]))
+ {
+ throw new NoSuchFieldException(_("invalidWarpName"));
}
final Location loc = user.getLocation();
diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties
index 4852f2bef..e8f36a2bb 100644
--- a/Essentials/src/messages.properties
+++ b/Essentials/src/messages.properties
@@ -458,3 +458,4 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties
index 26e039001..e4bd8de7d 100644
--- a/Essentials/src/messages_cs.properties
+++ b/Essentials/src/messages_cs.properties
@@ -461,3 +461,4 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties
index 9419ad45e..08ae21450 100644
--- a/Essentials/src/messages_da.properties
+++ b/Essentials/src/messages_da.properties
@@ -458,3 +458,4 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties
index 90e373b33..5c00b42d6 100644
--- a/Essentials/src/messages_de.properties
+++ b/Essentials/src/messages_de.properties
@@ -458,3 +458,4 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties
index 4852f2bef..e8f36a2bb 100644
--- a/Essentials/src/messages_en.properties
+++ b/Essentials/src/messages_en.properties
@@ -458,3 +458,4 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties
index b3b098d91..8f6bc071f 100644
--- a/Essentials/src/messages_es.properties
+++ b/Essentials/src/messages_es.properties
@@ -458,3 +458,4 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
diff --git a/Essentials/src/messages_fi.properties b/Essentials/src/messages_fi.properties
index 8dd5343ad..97fcea110 100644
--- a/Essentials/src/messages_fi.properties
+++ b/Essentials/src/messages_fi.properties
@@ -458,3 +458,4 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties
index 7468952a6..c6c9662f7 100644
--- a/Essentials/src/messages_fr.properties
+++ b/Essentials/src/messages_fr.properties
@@ -458,3 +458,4 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties
index 91e2e8f27..90f3c9fa9 100644
--- a/Essentials/src/messages_it.properties
+++ b/Essentials/src/messages_it.properties
@@ -458,3 +458,4 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties
index 62be530f1..94f37f378 100644
--- a/Essentials/src/messages_nl.properties
+++ b/Essentials/src/messages_nl.properties
@@ -458,3 +458,4 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties
index 1a1e73d65..2c1556d14 100644
--- a/Essentials/src/messages_pl.properties
+++ b/Essentials/src/messages_pl.properties
@@ -458,3 +458,4 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties
index 11a2c1df0..bcd032383 100644
--- a/Essentials/src/messages_pt.properties
+++ b/Essentials/src/messages_pt.properties
@@ -458,3 +458,4 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
diff --git a/Essentials/src/messages_se.properties b/Essentials/src/messages_se.properties
index c7685d6f4..67ee9a25d 100644
--- a/Essentials/src/messages_se.properties
+++ b/Essentials/src/messages_se.properties
@@ -458,3 +458,4 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name