mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-25 02:27:33 +01:00
API & misc cleanup
This commit is contained in:
parent
42dc6a2e07
commit
1ab2a51550
@ -74,6 +74,7 @@ public class ItemDb implements IConf, IItemDb
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(final String id, final int quantity) throws Exception
|
||||
{
|
||||
final ItemStack retval = get(id.toLowerCase(Locale.ENGLISH));
|
||||
@ -81,12 +82,13 @@ public class ItemDb implements IConf, IItemDb
|
||||
return retval;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(final String id) throws Exception
|
||||
{
|
||||
int itemid = 0;
|
||||
String itemname = null;
|
||||
short metaData = 0;
|
||||
String[] parts = splitPattern.split(id);;
|
||||
String[] parts = splitPattern.split(id);
|
||||
if (id.matches("^\\d+[:+',;.]\\d+$"))
|
||||
{
|
||||
itemid = Integer.parseInt(parts[0]);
|
||||
|
@ -231,6 +231,7 @@ public class Teleport implements Runnable, ITeleport
|
||||
}
|
||||
|
||||
//The now function is used when you want to skip tp delay when teleporting someone to a location or player.
|
||||
@Override
|
||||
public void now(Location loc, boolean cooldown, TeleportCause cause) throws Exception
|
||||
{
|
||||
if (cooldown)
|
||||
|
@ -5,5 +5,9 @@ import java.util.Locale;
|
||||
|
||||
public interface II18n
|
||||
{
|
||||
/**
|
||||
* Gets the current locale setting
|
||||
* @return the current locale, if not set it will return the default locale
|
||||
*/
|
||||
Locale getCurrentLocale();
|
||||
}
|
||||
|
@ -6,15 +6,47 @@ import org.bukkit.Location;
|
||||
|
||||
public interface IJails extends IReload
|
||||
{
|
||||
/**
|
||||
* Gets the location of the jail with the given name
|
||||
* @param jailName The name of the jail
|
||||
* @return the location of the jail
|
||||
* @throws Exception if the jail does not exist
|
||||
*/
|
||||
Location getJail(String jailName) throws Exception;
|
||||
|
||||
/**
|
||||
* Gets a list of jails by names
|
||||
* @return a list of jails, if there are none the list will be empty
|
||||
* @throws Exception
|
||||
*/
|
||||
Collection<String> getList() throws Exception;
|
||||
|
||||
/**
|
||||
* Gets the number of jails
|
||||
* @return the size of the list of jails
|
||||
*/
|
||||
int getCount();
|
||||
|
||||
/**
|
||||
* Remove the jail with the given name
|
||||
* @param jail the jail to remove
|
||||
* @throws Exception if the jail does not exist
|
||||
*/
|
||||
void removeJail(String jail) throws Exception;
|
||||
|
||||
/**
|
||||
* Attempts to send the given user to the given jail
|
||||
* @param user the user to send to jail
|
||||
* @param jail the jail to send the user to
|
||||
* @throws Exception if the user is offline or jail does not exist
|
||||
*/
|
||||
void sendToJail(com.earth2me.essentials.IUser user, String jail) throws Exception;
|
||||
|
||||
/**
|
||||
* Set a new jail with the given name and location
|
||||
* @param jailName the name of the jail being set
|
||||
* @param loc the location of the jail being set
|
||||
* @throws Exception
|
||||
*/
|
||||
void setJail(String jailName, Location loc) throws Exception;
|
||||
}
|
||||
|
@ -6,5 +6,12 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
public interface ITeleport
|
||||
{
|
||||
/**
|
||||
* Used to skip teleport delay when teleporting someone to a location or player.
|
||||
* @param loc
|
||||
* @param cooldown
|
||||
* @param cause
|
||||
* @throws Exception
|
||||
*/
|
||||
void now(Location loc, boolean cooldown, TeleportCause cause) throws Exception;
|
||||
}
|
||||
|
@ -2,15 +2,19 @@ package com.earth2me.essentials.api;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
|
||||
public class InvalidWorldException extends Exception {
|
||||
|
||||
public class InvalidWorldException extends Exception
|
||||
{
|
||||
private final String world;
|
||||
|
||||
public InvalidWorldException(final String world) {
|
||||
public InvalidWorldException(final String world)
|
||||
{
|
||||
super(_("invalidWorld"));
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
public String getWorld() {
|
||||
public String getWorld()
|
||||
{
|
||||
return this.world;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user