use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class StoredInventory method saveItemStack.
private static void saveItemStack(CitizensExpansion expansion, ConfigurationSection section, String path, ItemStack item) {
if (item == null) {
section.set(path, null);
return;
}
ICombatLogX plugin = expansion.getPlugin();
MultiVersionHandler multiVersionHandler = plugin.getMultiVersionHandler();
ItemHandler itemHandler = multiVersionHandler.getItemHandler();
String base64 = itemHandler.toBase64String(item);
section.set(path, base64);
}
use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class ActionBarExpansion method onEnable.
@Override
public void onEnable() {
ICombatLogX plugin = getPlugin();
int minorVersion = VersionUtility.getMinorVersion();
if (minorVersion < 8) {
Logger logger = getLogger();
logger.warning("This expansion requires Spigot 1.8.8 or higher.");
ExpansionManager expansionManager = plugin.getExpansionManager();
expansionManager.disableExpansion(this);
return;
}
ITimerManager timerManager = plugin.getTimerManager();
timerManager.addUpdaterTask(new ActionBarUpdater(this));
}
use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class ActionBarUpdater method replacePlaceholders.
private String replacePlaceholders(Player player, String message, long timeLeftMillis) {
if (message.contains("{bars}")) {
String bars = getBars(player, timeLeftMillis);
message = message.replace("{bars}", bars);
}
ICombatLogX combatLogX = getCombatLogX();
ICombatManager combatManager = combatLogX.getCombatManager();
LivingEntity enemy = combatManager.getEnemy(player);
return combatManager.replaceVariables(player, enemy, message);
}
use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class EssentialsExpansion method onEnable.
@Override
public void onEnable() {
if (!checkDependency("Essentials", true)) {
ICombatLogX plugin = getPlugin();
ExpansionManager expansionManager = plugin.getExpansionManager();
expansionManager.disableExpansion(this);
return;
}
new ListenerEssentials(this).register();
}
use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class FabledSkyBlockExpansion method onEnable.
@Override
public void onEnable() {
if (!checkDependency("FabledSkyBlock", true)) {
ICombatLogX plugin = getPlugin();
ExpansionManager expansionManager = plugin.getExpansionManager();
expansionManager.disableExpansion(this);
return;
}
new ListenerFabledSkyBlock(this).register();
}
Aggregations