use of com.github.sirblobman.combatlogx.api.expansion.Expansion in project CombatLogX by SirBlobman.
the class ListenerDamage method isDisabled.
private boolean isDisabled(DamageCause damageCause) {
Expansion expansion = getExpansion();
ConfigurationManager configurationManager = expansion.getConfigurationManager();
YamlConfiguration configuration = configurationManager.get("config.yml");
if (configuration.getBoolean("all-damage"))
return false;
String damageCauseName = damageCause.name().toLowerCase();
return !configuration.getBoolean("damage-type." + damageCauseName);
}
use of com.github.sirblobman.combatlogx.api.expansion.Expansion in project CombatLogX by SirBlobman.
the class LandsExpansion method afterEnable.
@Override
public void afterEnable() {
ICombatLogX plugin = getPlugin();
ExpansionManager expansionManager = plugin.getExpansionManager();
Optional<Expansion> optionalNewbieHelper = expansionManager.getExpansion("NewbieHelper");
if (optionalNewbieHelper.isPresent()) {
new ListenerLands(this).register();
}
}
use of com.github.sirblobman.combatlogx.api.expansion.Expansion in project CombatLogX by SirBlobman.
the class HookMVdWPlaceholderAPI method getNewbieHelperPVPStatus.
private String getNewbieHelperPVPStatus(Player player) {
ICombatLogX plugin = this.expansion.getPlugin();
LanguageManager languageManager = plugin.getLanguageManager();
boolean pvp = true;
Expansion expansion = getNewbieHelper();
if (expansion != null) {
NewbieHelperExpansion newbieHelperExpansion = (NewbieHelperExpansion) expansion;
PVPManager pvpManager = newbieHelperExpansion.getPVPManager();
pvp = !pvpManager.isDisabled(player);
}
String messagePath = ("placeholder.pvp-status." + (pvp ? "enabled" : "disabled"));
return languageManager.getMessage(player, messagePath, null, true);
}
use of com.github.sirblobman.combatlogx.api.expansion.Expansion in project CombatLogX by SirBlobman.
the class CommandCombatLogXVersion method addExpansionInformation.
private void addExpansionInformation(List<String> messageList) {
ExpansionManager expansionManager = getExpansionManager();
List<Expansion> enabledExpansionList = expansionManager.getEnabledExpansions();
int enabledExpansionListSize = enabledExpansionList.size();
messageList.add("&f&lEnabled Expansions (&7" + enabledExpansionListSize + "&f&l):");
for (Expansion expansion : enabledExpansionList) {
String expansionName = expansion.getName();
messageList.add("&f&l - &7" + expansionName);
}
}
use of com.github.sirblobman.combatlogx.api.expansion.Expansion in project CombatLogX by SirBlobman.
the class CommandCombatLogXAbout method getExpansionNames.
private Set<String> getExpansionNames() {
ExpansionManager expansionManager = getExpansionManager();
Set<String> expansionNameSet = new HashSet<>();
List<Expansion> expansionList = expansionManager.getAllExpansions();
for (Expansion expansion : expansionList) {
String expansionName = expansion.getName();
expansionNameSet.add(expansionName);
}
return Collections.unmodifiableSet(expansionNameSet);
}
Aggregations