@Override public void run() { if (npcHologram.hologram != null) { npcHologram.hologram.getVisibilityManager().showTo(player); } } },2);
@Override public void run() { if (npcHologram.hologram != null) { npcHologram.hologram.getVisibilityManager().hideTo(player); } } },2);
private Hologram createPlayerStatisticHologram(Player player, Location holoLocation) { final Hologram holo = HologramsAPI.createHologram(BedwarsRel.getInstance(), holoLocation); holo.getVisibilityManager().setVisibleByDefault(false); holo.getVisibilityManager().showTo(player); this.updatePlayerStatisticHologram(player, holo); return holo; }
public DGroupTag(DungeonsXL plugin, DGamePlayer player) { this.player = player; DGroup group = player.getDGroup(); if (group != null) { hologram = HologramsAPI.createHologram(plugin, player.getPlayer().getLocation().clone().add(0, 3.5, 0)); hologram.appendItemLine(group.getDColor().getWoolMaterial().toItemStack()); hologram.appendTextLine(group.getName()); } }
@EventHandler public void onPlayerDeath(PlayerDeathEvent event) { Hologram hologram = HologramsAPI.createHologram(this, event.getEntity().getEyeLocation()); hologram.appendTextLine(ChatColor.RED + "Player " + ChatColor.GOLD + event.getEntity().getName() + ChatColor.RED + " died here!"); hologram.appendTextLine(ChatColor.GRAY + "Time of death: " + new SimpleDateFormat("H:m").format(new Date())); } }
@Override public void run() { for (Player player : Bukkit.getOnlinePlayers()) { String playerID = PlayerConverter.getID(player); holograms: for (Entry<Hologram, ConditionID[]> entry : holograms.entrySet()) { for (ConditionID condition : entry.getValue()) { if (!BetonQuest.condition(playerID, condition)) { entry.getKey().getVisibilityManager().hideTo(player); continue holograms; } } entry.getKey().getVisibilityManager().showTo(player); } } } };
public void unloadAllHolograms(Player player) { if (!this.holograms.containsKey(player)) { return; } for (Hologram holo : this.holograms.get(player)) { holo.delete(); } this.holograms.remove(player); }
public void unloadHolograms() { if (BedwarsRel.getInstance().isHologramsEnabled()) { Iterator<Hologram> iterator = HologramsAPI.getHolograms(BedwarsRel.getInstance()).iterator(); while (iterator.hasNext()) { iterator.next().delete(); } } }
@Override public void onPickup(Player player) { // Play an effect. player.playEffect(hologram.getLocation(), Effect.MOBSPAWNER_FLAMES, null); // 30 seconds of speed II. player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 30 * 20, 1), true); // Delete the hologram. hologram.delete(); } });
@Override public void handleItemLinePickup(Player player, PickupHandler pickupHandler, Hologram hologram) { try { if (hologram.getVisibilityManager().isVisibleTo(player)) { pickupHandler.onPickup(player); } } catch (Throwable t) { Plugin plugin = hologram instanceof PluginHologram ? ((PluginHologram) hologram).getOwner() : HolographicDisplays.getInstance(); ConsoleLogger.log(Level.WARNING, "The plugin " + plugin.getName() + " generated an exception when the player " + player.getName() + " picked up an item from a hologram.", t); } }
private Hologram getHologramByLocation(List<Hologram> holograms, Location holoLocation) { for (Hologram holo : holograms) { if (holo.getLocation().getX() == holoLocation.getX() && holo.getLocation().getY() == holoLocation.getY() && holo.getLocation().getZ() == holoLocation.getZ()) { return holo; } } return null; }
@Override public void run() { for (NPC npc : npcs.keySet()) { for (NPCHologram npcHologram : npcs.get(npc)) { if (npcHologram.hologram != null) { npcHologram.hologram.teleport(npc.getStoredLocation().add(npcHologram.config.vector)); } } } } };
@Deprecated public static boolean isHologramEntity(Entity bukkitEntity) { return HologramsAPI.isHologramEntity(bukkitEntity); }
private Hologram createPlayerStatisticHologram(Player player, Location holoLocation) { final Hologram holo = HologramsAPI.createHologram(BedwarsRel.getInstance(), holoLocation); holo.getVisibilityManager().setVisibleByDefault(false); holo.getVisibilityManager().showTo(player); this.updatePlayerStatisticHologram(player, holo); return holo; }
public void unloadAllHolograms(Player player) { if (!this.holograms.containsKey(player)) { return; } for (Hologram holo : this.holograms.get(player)) { holo.delete(); } this.holograms.remove(player); }
public void unloadHolograms() { if (BedwarsRel.getInstance().isHologramsEnabled()) { Iterator<Hologram> iterator = HologramsAPI.getHolograms(BedwarsRel.getInstance()).iterator(); while (iterator.hasNext()) { iterator.next().delete(); } } }
private Hologram getHologramByLocation(List<Hologram> holograms, Location holoLocation) { for (Hologram holo : holograms) { if (holo.getLocation().getX() == holoLocation.getX() && holo.getLocation().getY() == holoLocation.getY() && holo.getLocation().getZ() == holoLocation.getZ()) { return holo; } } return null; }
public void update() { hologram.teleport(player.getPlayer().getLocation().clone().add(0, 3.5, 0)); }
/** * Cancels hologram updating loop and removes all BetonQuest-registered holograms. */ public void cancel() { if (runnable == null) return; runnable.cancel(); for (Hologram hologram : holograms.keySet()) { hologram.delete(); } }
private void cleanUp() { // Cancel Updater if (updater != null) { updater.cancel(); updater = null; } // Destroy all holograms for (NPC npc : npcs.keySet()) { for (NPCHologram npcHologram : npcs.get(npc)) { if (npcHologram.hologram != null) { npcHologram.hologram.delete(); npcHologram.hologram = null; } } } }