Search in sources :

Example 11 with Expansion

use of com.github.sirblobman.combatlogx.api.expansion.Expansion in project CombatLogX by SirBlobman.

the class CommandCombatLogXAbout method execute.

@Override
protected boolean execute(CommandSender sender, String[] args) {
    if (!checkPermission(sender, "combatlogx.command.combatlogx.about", true)) {
        return true;
    }
    if (args.length < 1) {
        return false;
    }
    String expansionName = args[0];
    Optional<Expansion> optionalExpansion = getExpansion(expansionName);
    if (!optionalExpansion.isPresent()) {
        Replacer replacer = message -> message.replace("{target}", expansionName);
        sendMessageWithPrefix(sender, "error.unknown-expansion", replacer, true);
        return true;
    }
    Expansion expansion = optionalExpansion.get();
    sendExpansionInformation(sender, expansion);
    return true;
}
Also used : ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) CommandSender(org.bukkit.command.CommandSender) CombatLogCommand(com.github.sirblobman.combatlogx.api.command.CombatLogCommand) Set(java.util.Set) Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX) ArrayList(java.util.ArrayList) MessageUtility(com.github.sirblobman.api.utility.MessageUtility) HashSet(java.util.HashSet) List(java.util.List) State(com.github.sirblobman.combatlogx.api.expansion.Expansion.State) Replacer(com.github.sirblobman.api.language.Replacer) Optional(java.util.Optional) ExpansionDescription(com.github.sirblobman.combatlogx.api.expansion.ExpansionDescription) Collections(java.util.Collections) Replacer(com.github.sirblobman.api.language.Replacer) Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion)

Example 12 with Expansion

use of com.github.sirblobman.combatlogx.api.expansion.Expansion in project CombatLogX by SirBlobman.

the class ListenerBuckets method getConfiguration.

private YamlConfiguration getConfiguration() {
    Expansion expansion = getExpansion();
    ConfigurationManager configurationManager = expansion.getConfigurationManager();
    return configurationManager.get("buckets.yml");
}
Also used : Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 13 with Expansion

use of com.github.sirblobman.combatlogx.api.expansion.Expansion in project CombatLogX by SirBlobman.

the class ListenerLegacyItemPickup method isAllowed.

private boolean isAllowed() {
    Expansion expansion = getExpansion();
    ConfigurationManager configurationManager = expansion.getConfigurationManager();
    YamlConfiguration configuration = configurationManager.get("items.yml");
    return !configuration.getBoolean("prevent-pickup");
}
Also used : YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 14 with Expansion

use of com.github.sirblobman.combatlogx.api.expansion.Expansion in project CombatLogX by SirBlobman.

the class ListenerInventories method getConfiguration.

private YamlConfiguration getConfiguration() {
    Expansion expansion = getExpansion();
    ConfigurationManager configurationManager = expansion.getConfigurationManager();
    return configurationManager.get("inventories.yml");
}
Also used : Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Example 15 with Expansion

use of com.github.sirblobman.combatlogx.api.expansion.Expansion in project CombatLogX by SirBlobman.

the class ListenerRiptide method getConfiguration.

private YamlConfiguration getConfiguration() {
    Expansion expansion = getExpansion();
    ConfigurationManager configurationManager = expansion.getConfigurationManager();
    return configurationManager.get("items.yml");
}
Also used : Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion) ConfigurationManager(com.github.sirblobman.api.configuration.ConfigurationManager)

Aggregations

Expansion (com.github.sirblobman.combatlogx.api.expansion.Expansion)32 ConfigurationManager (com.github.sirblobman.api.configuration.ConfigurationManager)19 YamlConfiguration (org.bukkit.configuration.file.YamlConfiguration)9 ICombatLogX (com.github.sirblobman.combatlogx.api.ICombatLogX)8 ExpansionManager (com.github.sirblobman.combatlogx.api.expansion.ExpansionManager)8 NewbieHelperExpansion (combatlogx.expansion.newbie.helper.NewbieHelperExpansion)7 LoggerExpansion (combatlogx.expansion.logger.LoggerExpansion)4 State (com.github.sirblobman.combatlogx.api.expansion.Expansion.State)3 PlaceholderExpansion (me.clip.placeholderapi.expansion.PlaceholderExpansion)3 LanguageManager (com.github.sirblobman.api.language.LanguageManager)2 RegionExpansion (com.github.sirblobman.combatlogx.api.expansion.region.RegionExpansion)2 MobTaggerExpansion (combatlogx.expansion.mob.tagger.MobTaggerExpansion)2 PVPManager (combatlogx.expansion.newbie.helper.manager.PVPManager)2 ProtectionManager (combatlogx.expansion.newbie.helper.manager.ProtectionManager)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 HashSet (java.util.HashSet)2 Replacer (com.github.sirblobman.api.language.Replacer)1 MessageUtility (com.github.sirblobman.api.utility.MessageUtility)1 CombatLogCommand (com.github.sirblobman.combatlogx.api.command.CombatLogCommand)1