summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIaccidentally <coryhuckaby@gmail.com>2013-05-26 10:50:58 -0400
committerIaccidentally <coryhuckaby@gmail.com>2013-05-26 10:50:58 -0400
commitf81688b25f676d18f890654fdd1e790b6eca4512 (patch)
tree0fc09af9fa404295f3ef8534a6ccfbe39f9888b9
parentcf3ab408b42ed43417cc43a4228540cc11a36a68 (diff)
downloadEssentials-f81688b25f676d18f890654fdd1e790b6eca4512.tar
Essentials-f81688b25f676d18f890654fdd1e790b6eca4512.tar.gz
Essentials-f81688b25f676d18f890654fdd1e790b6eca4512.tar.lz
Essentials-f81688b25f676d18f890654fdd1e790b6eca4512.tar.xz
Essentials-f81688b25f676d18f890654fdd1e790b6eca4512.zip
Cleanup and more API work
-rw-r--r--Essentials/src/net/ess3/I18n.java1
-rw-r--r--Essentials/src/net/ess3/Jails.java11
-rw-r--r--Essentials/src/net/ess3/MetaItemStack.java5
-rw-r--r--Essentials/src/net/ess3/Potions.java1
-rw-r--r--Essentials/src/net/ess3/api/IJails.java26
-rw-r--r--Essentials/src/net/ess3/api/IKits.java34
-rw-r--r--Essentials/src/net/ess3/commands/Commandfirework.java3
-rw-r--r--Essentials/src/net/ess3/commands/EssentialsCommandHandler.java2
-rw-r--r--Essentials/src/net/ess3/listener/EssentialsPlayerListener.java1
-rw-r--r--Essentials/src/net/ess3/storage/AbstractDelayedYamlFileReader.java1
-rw-r--r--Essentials/src/net/ess3/storage/AbstractDelayedYamlFileWriter.java1
-rw-r--r--Essentials/src/net/ess3/storage/AsyncStorageObjectHolder.java1
-rw-r--r--Essentials/src/net/ess3/storage/BukkitConstructor.java3
-rw-r--r--Essentials/src/net/ess3/utils/textreader/HelpInput.java1
-rw-r--r--Essentials/test/net/ess3/UserTest.java2
15 files changed, 48 insertions, 45 deletions
diff --git a/Essentials/src/net/ess3/I18n.java b/Essentials/src/net/ess3/I18n.java
index 6ea824e89..2a86e0bd3 100644
--- a/Essentials/src/net/ess3/I18n.java
+++ b/Essentials/src/net/ess3/I18n.java
@@ -9,7 +9,6 @@ import java.net.URL;
import java.text.MessageFormat;
import java.util.*;
import java.util.logging.Level;
-import java.util.logging.Logger;
import java.util.regex.Pattern;
import net.ess3.api.IEssentials;
import net.ess3.api.II18n;
diff --git a/Essentials/src/net/ess3/Jails.java b/Essentials/src/net/ess3/Jails.java
index 50c99cb51..18ab41418 100644
--- a/Essentials/src/net/ess3/Jails.java
+++ b/Essentials/src/net/ess3/Jails.java
@@ -6,13 +6,11 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Locale;
import java.util.logging.Level;
-import java.util.logging.Logger;
import static net.ess3.I18n._;
import net.ess3.api.IEssentials;
import net.ess3.api.IJails;
import net.ess3.api.IUser;
import net.ess3.storage.AsyncStorageObjectHolder;
-import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@@ -106,7 +104,14 @@ public class Jails extends AsyncStorageObjectHolder<net.ess3.settings.Jails> imp
@Override
public int getCount()
{
- throw new UnsupportedOperationException("Not supported yet.");
+ try
+ {
+ return getList().size();
+ }
+ catch (Exception ex)
+ {
+ return 0;
+ }
}
diff --git a/Essentials/src/net/ess3/MetaItemStack.java b/Essentials/src/net/ess3/MetaItemStack.java
index a067da49a..9a83efae1 100644
--- a/Essentials/src/net/ess3/MetaItemStack.java
+++ b/Essentials/src/net/ess3/MetaItemStack.java
@@ -1,7 +1,8 @@
package net.ess3;
+import java.util.*;
+import java.util.regex.Pattern;
import static net.ess3.I18n._;
-
import net.ess3.api.IEssentials;
import net.ess3.api.IUser;
import net.ess3.bukkit.Enchantments;
@@ -11,8 +12,6 @@ import net.ess3.utils.Util;
import net.ess3.utils.textreader.BookInput;
import net.ess3.utils.textreader.BookPager;
import net.ess3.utils.textreader.IText;
-import java.util.*;
-import java.util.regex.Pattern;
import org.bukkit.Color;
import org.bukkit.DyeColor;
import org.bukkit.FireworkEffect;
diff --git a/Essentials/src/net/ess3/Potions.java b/Essentials/src/net/ess3/Potions.java
index 592e0c768..3180b531e 100644
--- a/Essentials/src/net/ess3/Potions.java
+++ b/Essentials/src/net/ess3/Potions.java
@@ -5,7 +5,6 @@ import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-
import net.ess3.utils.Util;
import org.bukkit.potion.PotionEffectType;
diff --git a/Essentials/src/net/ess3/api/IJails.java b/Essentials/src/net/ess3/api/IJails.java
index a0a038003..c496a413c 100644
--- a/Essentials/src/net/ess3/api/IJails.java
+++ b/Essentials/src/net/ess3/api/IJails.java
@@ -7,45 +7,51 @@ import org.bukkit.Location;
public interface IJails extends IReload
{
/**
+ * Used to get the location of a jail with the given name
*
- * @param jailName
- * @return
- * @throws Exception
+ * @param jailName the name of the jail to get
+ * @return the location of the jail
+ * @throws Exception if the jail does not exist
*/
Location getJail(String jailName) throws Exception;
/**
+ * Used to get a list of jails by name
*
- * @return
+ * @return a list of jails
* @throws Exception
*/
Collection<String> getList() throws Exception;
/**
+ * Used to get the number of jails set
*
- * @return
+ * @return the number of jails
*/
int getCount();
/**
+ * Used to remove a jail
*
- * @param jail
+ * @param jail the name of the jail to remove
* @throws Exception
*/
void removeJail(String jail) throws Exception;
/**
+ * Used to send a user to jail
*
- * @param user
- * @param jail
+ * @param user the user to send to jail
+ * @param jail the name of the jail to send them to
* @throws Exception
*/
void sendToJail(IUser user, String jail) throws Exception;
/**
+ * Used to set a jail
*
- * @param jailName
- * @param loc
+ * @param jailName the name for the jail
+ * @param loc the location to set the jail at
* @throws Exception
*/
void setJail(String jailName, Location loc) throws Exception;
diff --git a/Essentials/src/net/ess3/api/IKits.java b/Essentials/src/net/ess3/api/IKits.java
index 50438e6b3..a5add03a6 100644
--- a/Essentials/src/net/ess3/api/IKits.java
+++ b/Essentials/src/net/ess3/api/IKits.java
@@ -8,47 +8,53 @@ import net.ess3.settings.Kit;
public interface IKits extends IReload
{
/**
+ * Used to get a kit by name
*
- * @param kit
- * @return
- * @throws Exception
+ * @param kit the name of the kit to get
+ * @return the kit
+ * @throws Exception if the kit does not exist or is improperly defined (due to broken config formatting)
*/
Kit getKit(String kit) throws Exception;
/**
+ * Sends a kit to a user
*
- * @param user
- * @param kit
- * @throws Exception
+ * @param user the user to send the kit to
+ * @param kit the kit to send
+ * @throws Exception if the user cannot afford the kit
*/
void sendKit(IUser user, String kit) throws Exception;
/**
+ * Sends a kit to a user
*
- * @param user
- * @param kit
- * @throws Exception
+ * @param user the user to send the kit to
+ * @param kit the kit to send
+ * @throws Exception if the user cannot afford the kit
*/
void sendKit(IUser user, Kit kit) throws Exception;
/**
+ * Used to get a list of kits by name
*
- * @return
+ * @return the list of kits
* @throws Exception
*/
Collection<String> getList() throws Exception;
/**
+ * Used to check if the list of kits is empty
*
- * @return
+ * @return true if the list is empty, false if not
*/
boolean isEmpty();
/**
+ * Used to check kit delay for cooldowns
*
- * @param user
- * @param kit
- * @throws NoChargeException
+ * @param user the user to check
+ * @param kit the kit to check
+ * @throws NoChargeException if the kit cannot be used **TODO: use a better exception here**
*/
void checkTime(final IUser user, Kit kit) throws NoChargeException;
}
diff --git a/Essentials/src/net/ess3/commands/Commandfirework.java b/Essentials/src/net/ess3/commands/Commandfirework.java
index ad398a6c1..3d8788c07 100644
--- a/Essentials/src/net/ess3/commands/Commandfirework.java
+++ b/Essentials/src/net/ess3/commands/Commandfirework.java
@@ -1,8 +1,7 @@
package net.ess3.commands;
-import static net.ess3.I18n._;
import java.util.regex.Pattern;
-
+import static net.ess3.I18n._;
import net.ess3.MetaItemStack;
import net.ess3.api.ISettings;
import net.ess3.api.IUser;
diff --git a/Essentials/src/net/ess3/commands/EssentialsCommandHandler.java b/Essentials/src/net/ess3/commands/EssentialsCommandHandler.java
index 5e0b461d5..1b356f9a1 100644
--- a/Essentials/src/net/ess3/commands/EssentialsCommandHandler.java
+++ b/Essentials/src/net/ess3/commands/EssentialsCommandHandler.java
@@ -2,10 +2,8 @@ package net.ess3.commands;
import java.util.*;
import java.util.logging.Level;
-import java.util.logging.Logger;
import static net.ess3.I18n._;
import net.ess3.api.*;
-import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.*;
import org.bukkit.entity.Player;
diff --git a/Essentials/src/net/ess3/listener/EssentialsPlayerListener.java b/Essentials/src/net/ess3/listener/EssentialsPlayerListener.java
index d2d3a5357..4bbc38941 100644
--- a/Essentials/src/net/ess3/listener/EssentialsPlayerListener.java
+++ b/Essentials/src/net/ess3/listener/EssentialsPlayerListener.java
@@ -5,7 +5,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.logging.Level;
-import java.util.logging.Logger;
import java.util.regex.Pattern;
import static net.ess3.I18n._;
import net.ess3.api.IEssentials;
diff --git a/Essentials/src/net/ess3/storage/AbstractDelayedYamlFileReader.java b/Essentials/src/net/ess3/storage/AbstractDelayedYamlFileReader.java
index e3bebfeac..054963e37 100644
--- a/Essentials/src/net/ess3/storage/AbstractDelayedYamlFileReader.java
+++ b/Essentials/src/net/ess3/storage/AbstractDelayedYamlFileReader.java
@@ -6,7 +6,6 @@ import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import net.ess3.api.IEssentials;
-import org.bukkit.Bukkit;
public abstract class AbstractDelayedYamlFileReader<T extends StorageObject> implements Runnable
diff --git a/Essentials/src/net/ess3/storage/AbstractDelayedYamlFileWriter.java b/Essentials/src/net/ess3/storage/AbstractDelayedYamlFileWriter.java
index 19962373e..3e91ddc5d 100644
--- a/Essentials/src/net/ess3/storage/AbstractDelayedYamlFileWriter.java
+++ b/Essentials/src/net/ess3/storage/AbstractDelayedYamlFileWriter.java
@@ -6,7 +6,6 @@ import java.io.PrintWriter;
import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Level;
import net.ess3.api.IEssentials;
-import org.bukkit.Bukkit;
public abstract class AbstractDelayedYamlFileWriter implements Runnable
diff --git a/Essentials/src/net/ess3/storage/AsyncStorageObjectHolder.java b/Essentials/src/net/ess3/storage/AsyncStorageObjectHolder.java
index 097b06308..bf4b40a85 100644
--- a/Essentials/src/net/ess3/storage/AsyncStorageObjectHolder.java
+++ b/Essentials/src/net/ess3/storage/AsyncStorageObjectHolder.java
@@ -5,7 +5,6 @@ import java.io.FileNotFoundException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import net.ess3.api.IEssentials;
-import org.bukkit.Bukkit;
public abstract class AsyncStorageObjectHolder<T extends StorageObject> implements IStorageObjectHolder<T>
diff --git a/Essentials/src/net/ess3/storage/BukkitConstructor.java b/Essentials/src/net/ess3/storage/BukkitConstructor.java
index 666c07931..d08f2d66c 100644
--- a/Essentials/src/net/ess3/storage/BukkitConstructor.java
+++ b/Essentials/src/net/ess3/storage/BukkitConstructor.java
@@ -407,8 +407,7 @@ public class BukkitConstructor extends Constructor
}
catch (Exception e)
{
- throw new YAMLException(
- "Cannot create property=" + key + " for JavaBean=" + object + "; " + e.getMessage(), e);
+ throw new YAMLException("Cannot create property=" + key + " for JavaBean=" + object + "; " + e.getMessage(), e);
}
}
return object;
diff --git a/Essentials/src/net/ess3/utils/textreader/HelpInput.java b/Essentials/src/net/ess3/utils/textreader/HelpInput.java
index eab35a677..4afb436cc 100644
--- a/Essentials/src/net/ess3/utils/textreader/HelpInput.java
+++ b/Essentials/src/net/ess3/utils/textreader/HelpInput.java
@@ -3,7 +3,6 @@ package net.ess3.utils.textreader;
import java.io.IOException;
import java.util.*;
import java.util.logging.Level;
-import java.util.logging.Logger;
import static net.ess3.I18n._;
import net.ess3.api.IEssentials;
import net.ess3.api.ISettings;
diff --git a/Essentials/test/net/ess3/UserTest.java b/Essentials/test/net/ess3/UserTest.java
index 418c8d155..4315c544e 100644
--- a/Essentials/test/net/ess3/UserTest.java
+++ b/Essentials/test/net/ess3/UserTest.java
@@ -1,7 +1,5 @@
package net.ess3;
-import net.ess3.api.IUser;
-
public class UserTest extends EssentialsTest
{