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 unloadAllHolograms(Player player) { if (!this.holograms.containsKey(player)) { return; } for (Hologram holo : this.holograms.get(player)) { holo.delete(); } this.holograms.remove(player); }
/** * 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; } } } }
public void unloadHolograms() { if (BedwarsRel.getInstance().isHologramsEnabled()) { Iterator<Hologram> iterator = HologramsAPI.getHolograms(BedwarsRel.getInstance()).iterator(); while (iterator.hasNext()) { iterator.next().delete(); } } }
public void unloadHolograms() { if (BedwarsRel.getInstance().isHologramsEnabled()) { Iterator<Hologram> iterator = HologramsAPI.getHolograms(BedwarsRel.getInstance()).iterator(); while (iterator.hasNext()) { iterator.next().delete(); } } }
private void updatePlayerHologram(Player player, Location holoLocation) { List<Hologram> holograms = null; if (!this.holograms.containsKey(player)) { this.holograms.put(player, new ArrayList<Hologram>()); } holograms = this.holograms.get(player); Hologram holo = this.getHologramByLocation(holograms, holoLocation); if (holo == null && player.getWorld() == holoLocation.getWorld()) { holograms.add(this.createPlayerStatisticHologram(player, holoLocation)); } else if (holo != null) { if (holo.getLocation().getWorld() == player.getWorld()) { this.updatePlayerStatisticHologram(player, holo); } else { holograms.remove(holo); holo.delete(); } } }
private void updatePlayerHologram(Player player, Location holoLocation) { List<Hologram> holograms = null; if (!this.holograms.containsKey(player)) { this.holograms.put(player, new ArrayList<Hologram>()); } holograms = this.holograms.get(player); Hologram holo = this.getHologramByLocation(holograms, holoLocation); if (holo == null && player.getWorld() == holoLocation.getWorld()) { holograms.add(this.createPlayerStatisticHologram(player, holoLocation)); } else if (holo != null) { if (holo.getLocation().getWorld() == player.getWorld()) { this.updatePlayerStatisticHologram(player, holo); } else { holograms.remove(holo); holo.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 run() { // remove all player holograms on this location for (Entry<Player, List<Hologram>> entry : HolographicDisplaysInteraction.this .getHolograms().entrySet()) { Iterator<Hologram> iterator = entry.getValue().iterator(); while (iterator.hasNext()) { Hologram hologram = iterator.next(); if (hologram.getX() == holo.getX() && hologram.getY() == holo.getY() && hologram.getZ() == holo.getZ()) { hologram.delete(); iterator.remove(); } } } Location holoLocation = HolographicDisplaysInteraction.this .getHologramLocationByLocation(holo.getLocation()); if (holoLocation != null) { HolographicDisplaysInteraction.this.hologramLocations.remove(holoLocation); HolographicDisplaysInteraction.this.updateHologramDatabase(); } player.sendMessage( ChatWriter.pluginMessage(ChatColor.GREEN + BedwarsRel._l("success.holoremoved"))); }
@Override public void run() { // remove all player holograms on this location for (Entry<Player, List<Hologram>> entry : HolographicDisplaysInteraction.this .getHolograms().entrySet()) { Iterator<Hologram> iterator = entry.getValue().iterator(); while (iterator.hasNext()) { Hologram hologram = iterator.next(); if (hologram.getX() == holo.getX() && hologram.getY() == holo.getY() && hologram.getZ() == holo.getZ()) { hologram.delete(); iterator.remove(); } } } Location holoLocation = HolographicDisplaysInteraction.this .getHologramLocationByLocation(holo.getLocation()); if (holoLocation != null) { HolographicDisplaysInteraction.this.hologramLocations.remove(holoLocation); HolographicDisplaysInteraction.this.updateHologramDatabase(); } player.sendMessage( ChatWriter.pluginMessage(ChatColor.GREEN + BedwarsRel._l("success.holoremoved"))); }
npcHologram.hologram.delete(); npcHologram.hologram = null;