mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-27 01:40:48 +08:00
[Fix] Add option to not show one time use kits described in #188
* Adds toggleable config option 'skip-used-one-time-kits-from-kit-list' to exclude used kits with delay < 0 from displaying in the /kit list
This commit is contained in:
parent
23f3d69d38
commit
756ea346e6
@ -58,6 +58,8 @@ public interface ISettings extends IConf {
|
||||
|
||||
void addKit(String name, List<String> lines, long delay);
|
||||
|
||||
boolean isSkippingUsedOneTimeKitsFromKitList();
|
||||
|
||||
String getLocale();
|
||||
|
||||
String getNewbieSpawn();
|
||||
|
@ -56,7 +56,10 @@ public class Kit {
|
||||
}
|
||||
|
||||
Kit kit = new Kit(kitItem, ess);
|
||||
if (kit.getNextUse(user) != 0) {
|
||||
double nextUse = kit.getNextUse(user);
|
||||
if (nextUse == -1 && ess.getSettings().isSkippingUsedOneTimeKitsFromKitList()) {
|
||||
continue;
|
||||
} else if (nextUse != 0) {
|
||||
name = tl("kitDelay", name);
|
||||
}
|
||||
|
||||
|
@ -351,6 +351,11 @@ public class Settings implements net.ess3.api.ISettings {
|
||||
config.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSkippingUsedOneTimeKitsFromKitList() {
|
||||
return config.getBoolean("skip-used-one-time-kits-from-kit-list", false);
|
||||
}
|
||||
|
||||
private ChatColor operatorColor = null;
|
||||
|
||||
@Override
|
||||
|
@ -250,6 +250,10 @@ player-commands:
|
||||
- worth
|
||||
- xmpp
|
||||
|
||||
# When this option is enabled, one-time use kits (ie. delay < 0) will be
|
||||
# removed from the /kit list when a player can no longer use it
|
||||
skip-used-one-time-kits-from-kit-list: false
|
||||
|
||||
# Note: All items MUST be followed by a quantity!
|
||||
# All kit names should be lower case, and will be treated as lower in permissions/costs.
|
||||
# Syntax: - itemID[:DataValue/Durability] Amount [Enchantment:Level].. [itemmeta:value]...
|
||||
|
Loading…
Reference in New Issue
Block a user