mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-05 20:12:54 +00:00
Adding starter/newbie kit to EssentialsSpawn
Optimization to EssentialsSpawn join event.
This commit is contained in:
parent
e55aa3cea7
commit
6a9027da6d
7 changed files with 45 additions and 13 deletions
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue