use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class uSkyBlockExpansion method onEnable.
@Override
public void onEnable() {
if (!checkDependency("uSkyBlock", true)) {
ICombatLogX plugin = getPlugin();
ExpansionManager expansionManager = plugin.getExpansionManager();
expansionManager.disableExpansion(this);
return;
}
new ListeneruSkyBlock(this).register();
}
use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class ListenerDamage method onDamage.
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onDamage(EntityDamageEvent e) {
Entity entity = e.getEntity();
if (!(entity instanceof Player))
return;
if (checkDamageByEntity(e))
return;
Player player = (Player) entity;
DamageCause damageCause = e.getCause();
if (isDisabled(damageCause))
return;
ICombatLogX combatLogX = getCombatLogX();
ICombatManager combatManager = combatLogX.getCombatManager();
boolean wasInCombat = combatManager.isInCombat(player);
boolean tagged = combatManager.tag(player, null, TagType.UNKNOWN, TagReason.UNKNOWN);
if (tagged && !wasInCombat)
sendMessage(player, damageCause);
}
use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class ListenerDeathEffects method onDeath.
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onDeath(PlayerDeathEvent e) {
YamlConfiguration configuration = getConfiguration();
List<String> enabledDeathEffectList = configuration.getStringList("death-effect-list");
if (enabledDeathEffectList.isEmpty())
return;
Player player = e.getEntity();
boolean requireCombatDeath = configuration.getBoolean("combat-death-only");
if (requireCombatDeath) {
ICombatLogX combatLogX = getCombatLogX();
IDeathListener deathListener = combatLogX.getDeathListener();
if (!deathListener.contains(player))
return;
}
if (enabledDeathEffectList.contains("BLOOD")) {
playBloodEffect(player);
}
if (enabledDeathEffectList.contains("LIGHTNING")) {
playLightningEffect(player);
}
}
use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class HookPlaceholderAPI method getDescriptionFile.
private PluginDescriptionFile getDescriptionFile() {
ICombatLogX combatLogX = this.expansion.getPlugin();
JavaPlugin plugin = combatLogX.getPlugin();
return plugin.getDescription();
}
use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class PlaceholderAPIExpansion method onEnable.
@Override
public void onEnable() {
if (!checkDependency("PlaceholderAPI", true)) {
ICombatLogX plugin = getPlugin();
ExpansionManager expansionManager = plugin.getExpansionManager();
expansionManager.disableExpansion(this);
return;
}
HookPlaceholderAPI hook = new HookPlaceholderAPI(this);
hook.register();
}
Aggregations