Adding starter/newbie kit to EssentialsSpawn

Optimization to EssentialsSpawn join event.
This commit is contained in:
KHobbits 2012-03-04 20:06:50 +00:00
parent c3d5b32986
commit c7a6677d52
7 changed files with 45 additions and 13 deletions

View file

@ -9,6 +9,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitScheduler;
/**
* @deprecated This will be moved to the api package soon
*/

View file

@ -20,6 +20,8 @@ public interface ISettings extends IConf
boolean getAnnounceNewPlayers();
String getNewPlayerKit();
String getBackupCommand();
long getBackupInterval();
@ -115,11 +117,11 @@ public interface ISettings extends IConf
boolean warnOnSmite();
double getMaxMoney();
double getMinMoney();
boolean isEcoLogEnabled();
boolean isEcoLogUpdateEnabled();
boolean removeGodOnDisconnect();

View file

@ -63,10 +63,11 @@ public class Kit
public static List<String> getItems(final User user, final Map<String, Object> kit) throws Exception
{
if (kit == null) {
if (kit == null)
{
throw new Exception(_("kitError2"));
}
try
{
return (List<String>)kit.get("items");

View file

@ -351,6 +351,12 @@ public class Settings implements ISettings
return new SimpleTextInput(Util.replaceColor(config.getString("newbies.announce-format", "&dWelcome {DISPLAYNAME} to the server!")));
}
@Override
public String getNewPlayerKit()
{
return config.getString("newbies.kit", "");
}
@Override
public String getNewbieSpawn()
{

View file

@ -38,7 +38,7 @@ public class Commandkit extends EssentialsCommand
{
throw new Exception(_("noKitPermission", "essentials.kit." + kitName));
}
final List<String> items = Kit.getItems(user, kit);
Kit.checkTime(user, kitName, kit);
@ -47,7 +47,7 @@ public class Commandkit extends EssentialsCommand
charge.isAffordableFor(user);
Kit.expandItems(ess, user, items);
charge.charge(user);
user.sendMessage(_("kitGive", kitName));