Search in sources :

Example 6 with MultiVersionHandler

use of com.github.sirblobman.api.nms.MultiVersionHandler 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);
}
Also used : MultiVersionHandler(com.github.sirblobman.api.nms.MultiVersionHandler) ItemHandler(com.github.sirblobman.api.nms.ItemHandler) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX)

Example 7 with MultiVersionHandler

use of com.github.sirblobman.api.nms.MultiVersionHandler in project CombatLogX by SirBlobman.

the class PlaceholderHelper method getEnemyName.

public static String getEnemyName(ICombatLogX plugin, Player player) {
    ICombatManager combatManager = plugin.getCombatManager();
    LivingEntity enemy = combatManager.getEnemy(player);
    if (enemy == null)
        return getUnknownEnemy(plugin, player);
    MultiVersionHandler multiVersionHandler = plugin.getMultiVersionHandler();
    EntityHandler entityHandler = multiVersionHandler.getEntityHandler();
    return entityHandler.getName(enemy);
}
Also used : LivingEntity(org.bukkit.entity.LivingEntity) MultiVersionHandler(com.github.sirblobman.api.nms.MultiVersionHandler) ICombatManager(com.github.sirblobman.combatlogx.api.manager.ICombatManager) EntityHandler(com.github.sirblobman.api.nms.EntityHandler)

Example 8 with MultiVersionHandler

use of com.github.sirblobman.api.nms.MultiVersionHandler in project CombatLogX by SirBlobman.

the class ActionBarUpdater method getPlayerHandler.

private PlayerHandler getPlayerHandler() {
    ICombatLogX combatLogX = getCombatLogX();
    MultiVersionHandler multiVersionHandler = combatLogX.getMultiVersionHandler();
    return multiVersionHandler.getPlayerHandler();
}
Also used : MultiVersionHandler(com.github.sirblobman.api.nms.MultiVersionHandler) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX)

Example 9 with MultiVersionHandler

use of com.github.sirblobman.api.nms.MultiVersionHandler in project CombatLogX by SirBlobman.

the class ListenerDamage method getName.

private String getName(Entity entity) {
    ICombatLogX plugin = getCombatLogX();
    if (entity == null) {
        CommandSender console = Bukkit.getConsoleSender();
        LanguageManager languageManager = plugin.getLanguageManager();
        return languageManager.getMessage(console, "placeholder.unknown-enemy", null, true);
    }
    MultiVersionHandler multiVersionHandler = plugin.getMultiVersionHandler();
    EntityHandler entityHandler = multiVersionHandler.getEntityHandler();
    return entityHandler.getName(entity);
}
Also used : MultiVersionHandler(com.github.sirblobman.api.nms.MultiVersionHandler) LanguageManager(com.github.sirblobman.api.language.LanguageManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX) CommandSender(org.bukkit.command.CommandSender) EntityHandler(com.github.sirblobman.api.nms.EntityHandler)

Example 10 with MultiVersionHandler

use of com.github.sirblobman.api.nms.MultiVersionHandler in project CombatLogX by SirBlobman.

the class CombatManager method getEntityName.

private String getEntityName(Player player, LivingEntity entity) {
    if (entity == null) {
        LanguageManager languageManager = this.plugin.getLanguageManager();
        return languageManager.getMessage(player, "placeholder.unknown-enemy", null, true);
    }
    MultiVersionHandler multiVersionHandler = this.plugin.getMultiVersionHandler();
    EntityHandler entityHandler = multiVersionHandler.getEntityHandler();
    return entityHandler.getName(entity);
}
Also used : MultiVersionHandler(com.github.sirblobman.api.nms.MultiVersionHandler) LanguageManager(com.github.sirblobman.api.language.LanguageManager) EntityHandler(com.github.sirblobman.api.nms.EntityHandler)

Aggregations

MultiVersionHandler (com.github.sirblobman.api.nms.MultiVersionHandler)11 ICombatLogX (com.github.sirblobman.combatlogx.api.ICombatLogX)9 EntityHandler (com.github.sirblobman.api.nms.EntityHandler)7 LanguageManager (com.github.sirblobman.api.language.LanguageManager)4 ItemHandler (com.github.sirblobman.api.nms.ItemHandler)2 ICombatManager (com.github.sirblobman.combatlogx.api.manager.ICombatManager)2 CommandSender (org.bukkit.command.CommandSender)2 LivingEntity (org.bukkit.entity.LivingEntity)2 Player (org.bukkit.entity.Player)2 ScoreboardHandler (com.github.sirblobman.api.nms.scoreboard.ScoreboardHandler)1 CitizensExpansion (combatlogx.expansion.compatibility.citizens.CitizensExpansion)1 CombatNPC (combatlogx.expansion.compatibility.citizens.object.CombatNPC)1 UUID (java.util.UUID)1 NPC (net.citizensnpcs.api.npc.NPC)1 NPCRegistry (net.citizensnpcs.api.npc.NPCRegistry)1 Location (org.bukkit.Location)1 OfflinePlayer (org.bukkit.OfflinePlayer)1 YamlConfiguration (org.bukkit.configuration.file.YamlConfiguration)1 Entity (org.bukkit.entity.Entity)1 EntityType (org.bukkit.entity.EntityType)1