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;
}
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;
}
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);
}
}
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);
}
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");
}
}
Aggregations