Search in sources :

Example 16 with Hologram

use of com.gmail.filoghost.holographicdisplays.api.Hologram in project HolographicMenus by DRE2N.

the class HolographicDisplaysWrapper method createHologram.

@Override
public de.erethon.holographicmenus.hologram.Hologram createHologram(Location location, ItemStack item, Collection<Player> viewers) {
    Hologram hdHolo = createHologram(viewers, location);
    de.erethon.holographicmenus.hologram.Hologram hmHolo = new de.erethon.holographicmenus.hologram.Hologram(plugin, location, hdHolo);
    ItemLine line = hdHolo.appendItemLine(item);
    line.setTouchHandler(p -> hmHolo.click(plugin.getHPlayerCache().getByPlayer(p)));
    return hmHolo;
}
Also used : Hologram(com.gmail.filoghost.holographicdisplays.api.Hologram) ItemLine(com.gmail.filoghost.holographicdisplays.api.line.ItemLine)

Example 17 with Hologram

use of com.gmail.filoghost.holographicdisplays.api.Hologram in project HolographicMenus by DRE2N.

the class HolographicDisplaysWrapper method createHologram.

@Override
public de.erethon.holographicmenus.hologram.Hologram createHologram(Location location, String label, Collection<Player> viewers) {
    Hologram hdHolo = createHologram(viewers, location);
    de.erethon.holographicmenus.hologram.Hologram hmHolo = new de.erethon.holographicmenus.hologram.Hologram(plugin, location, hdHolo);
    TextLine line = hdHolo.appendTextLine(label);
    line.setTouchHandler(p -> hmHolo.click(plugin.getHPlayerCache().getByPlayer(p)));
    return hmHolo;
}
Also used : Hologram(com.gmail.filoghost.holographicdisplays.api.Hologram) TextLine(com.gmail.filoghost.holographicdisplays.api.line.TextLine)

Example 18 with Hologram

use of com.gmail.filoghost.holographicdisplays.api.Hologram in project RoseStacker by Rosewood-Development.

the class HolographicDisplaysHologramHandler method deleteHologram.

@Override
public void deleteHologram(Location location) {
    Hologram hologram = this.holograms.get(location);
    if (hologram != null) {
        hologram.delete();
        this.holograms.remove(location);
    }
}
Also used : Hologram(com.gmail.filoghost.holographicdisplays.api.Hologram)

Example 19 with Hologram

use of com.gmail.filoghost.holographicdisplays.api.Hologram in project RoseStacker by Rosewood-Development.

the class HolographicDisplaysHologramHandler method isHologram.

@Override
public boolean isHologram(Entity entity) {
    NMSEntityBase entityBase = HolographicDisplays.getNMSManager().getNMSEntityBase(entity);
    if (entityBase == null)
        return false;
    HologramLine hologramLine = entityBase.getHologramLine();
    if (hologramLine == null)
        return false;
    Hologram target = entityBase.getHologramLine().getParent();
    if (target == null)
        return false;
    return this.holograms.values().stream().anyMatch(target::equals);
}
Also used : Hologram(com.gmail.filoghost.holographicdisplays.api.Hologram) HologramLine(com.gmail.filoghost.holographicdisplays.api.line.HologramLine) NMSEntityBase(com.gmail.filoghost.holographicdisplays.nms.interfaces.entity.NMSEntityBase)

Example 20 with Hologram

use of com.gmail.filoghost.holographicdisplays.api.Hologram in project NextEconomy by NextPlugins.

the class NextEconomy method unloadRanking.

private void unloadRanking() {
    if (CustomRankingRegistry.getInstance().isEnabled()) {
        if (CustomRankingRegistry.getInstance().isHolographicDisplays()) {
            HologramsAPI.getHolograms(this).forEach(Hologram::delete);
        } else {
            // jump concurrentmodificationexception
            val holograms = new ArrayList<CMIHologram>();
            val hologramManager = CMI.getInstance().getHologramManager();
            for (val entry : hologramManager.getHolograms().entrySet()) {
                if (entry.getKey().startsWith("NextEconomy"))
                    holograms.add(entry.getValue());
            }
            holograms.forEach(hologramManager::removeHolo);
        }
        String type = RankingValue.get(RankingValue::npcType);
        if (type.equalsIgnoreCase("npc")) {
            for (val id : NPCRunnable.NPCS) {
                val npc = CitizensAPI.getNPCRegistry().getById(id);
                if (npc == null)
                    continue;
                CitizensAPI.getNPCRegistry().deregister(npc);
            }
        }
        if (type.equalsIgnoreCase("armorstand")) {
            for (val stand : ArmorStandRunnable.STANDS) {
                stand.remove();
            }
        }
        getLogger().info("Sistema de ranking visual descarregado com sucesso");
    }
}
Also used : lombok.val(lombok.val) Hologram(com.gmail.filoghost.holographicdisplays.api.Hologram) CMIHologram(com.Zrips.CMI.Modules.Holograms.CMIHologram) RankingValue(com.nextplugins.economy.configuration.RankingValue) ArrayList(java.util.ArrayList)

Aggregations

Hologram (com.gmail.filoghost.holographicdisplays.api.Hologram)29 ArrayList (java.util.ArrayList)8 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)7 Player (org.bukkit.entity.Player)6 List (java.util.List)4 PracticeHologram (net.frozenorb.potpvp.hologram.PracticeHologram)4 TextLine (com.gmail.filoghost.holographicdisplays.api.line.TextLine)3 Location (org.bukkit.Location)3 CrateHologram (com.badbones69.crazycrates.api.objects.CrateHologram)2 ItemLine (com.gmail.filoghost.holographicdisplays.api.line.ItemLine)2 Map (java.util.Map)2 lombok.val (lombok.val)2 DialogHologram (me.iatog.characterdialogue.api.dialog.DialogHologram)2 NPC (net.citizensnpcs.api.npc.NPC)2 BasicConfigurationFile (net.frozenorb.potpvp.util.config.impl.BasicConfigurationFile)2 CMIHologram (com.Zrips.CMI.Modules.Holograms.CMIHologram)1 VisibilityManager (com.gmail.filoghost.holographicdisplays.api.VisibilityManager)1 HologramLine (com.gmail.filoghost.holographicdisplays.api.line.HologramLine)1 NMSEntityBase (com.gmail.filoghost.holographicdisplays.nms.interfaces.entity.NMSEntityBase)1 MPlayer (com.massivecraft.factions.entity.MPlayer)1