Codota Logo
Hologram
Code IndexAdd Codota to your IDE (free)

How to use
Hologram
in
com.gmail.filoghost.holographicdisplays.api

Best Java code snippets using com.gmail.filoghost.holographicdisplays.api.Hologram (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: filoghost/HolographicDisplays

  @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()));
    
  }
}
origin: BedwarsRel/BedwarsRel

@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")));
}
origin: Co0sh/BetonQuest

  @Override
  public void run() {
    if (npcHologram.hologram != null) {
      npcHologram.hologram.getVisibilityManager().showTo(player);
    }
  }
},2);
origin: filoghost/HolographicDisplays

  @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();
    
  }
});
origin: Co0sh/BetonQuest

if (npcHologram.hologram == null) {
  Hologram hologram = HologramsAPI.createHologram(BetonQuest.getInstance(), npc.getStoredLocation().add(npcHologram.config.vector));
  hologram.getVisibilityManager().setVisibleByDefault(false);
  for (String line : npcHologram.config.settings.getStringList("lines")) {
    if (line.startsWith("item:")) {
      hologram.appendItemLine(new ItemStack(Material.matchMaterial(line.substring(5))));
    } else {
      hologram.appendTextLine(line.replace('&', '§'));
npcHologram.hologram.delete();
npcHologram.hologram = null;
origin: DRE2N/DungeonsXL

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());
  }
}
origin: Co0sh/BetonQuest

hologram.getVisibilityManager().setVisibleByDefault(false);
for (String line : lines) {
    hologram.appendItemLine(new ItemStack(Material.matchMaterial(line.substring(5))));
  } else {
    hologram.appendTextLine(line.replace('&', '§'));
origin: io.github.bedwarsrel/BedwarsRel-Common

private void updatePlayerStatisticHologram(Player player, final Hologram holo) {
 PlayerStatistic statistic = BedwarsRel.getInstance().getPlayerStatisticManager()
   .getStatistic(player);
 holo.clearLines();
  TextLine textLine = holo.appendTextLine(line);
  textLine.setTouchHandler(new TouchHandler() {
origin: io.github.bedwarsrel/BedwarsRel-Common

public void unloadAllHolograms(Player player) {
 if (!this.holograms.containsKey(player)) {
  return;
 }
 for (Hologram holo : this.holograms.get(player)) {
  holo.delete();
 }
 this.holograms.remove(player);
}
origin: BedwarsRel/BedwarsRel

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;
}
origin: Co0sh/BetonQuest

  @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));
        }
      }
    }
  }
};
origin: filoghost/HolographicDisplays

hologram.appendTextLine(ChatColor.AQUA  + "" + ChatColor.BOLD + "Speed PowerUp");
ItemLine icon = hologram.appendItemLine(new ItemStack(Material.SUGAR));
origin: BedwarsRel/BedwarsRel

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();
  }
 }
}
origin: BedwarsRel/BedwarsRel

private void updatePlayerStatisticHologram(Player player, final Hologram holo) {
 PlayerStatistic statistic = BedwarsRel.getInstance().getPlayerStatisticManager()
   .getStatistic(player);
 holo.clearLines();
  TextLine textLine = holo.appendTextLine(line);
  textLine.setTouchHandler(new TouchHandler() {
origin: BedwarsRel/BedwarsRel

public void unloadAllHolograms(Player player) {
 if (!this.holograms.containsKey(player)) {
  return;
 }
 for (Hologram holo : this.holograms.get(player)) {
  holo.delete();
 }
 this.holograms.remove(player);
}
origin: io.github.bedwarsrel/BedwarsRel-Common

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;
}
origin: DRE2N/DungeonsXL

public void update() {
  hologram.teleport(player.getPlayer().getLocation().clone().add(0, 3.5, 0));
}
origin: DRE2N/DungeonsXL

@Override
public void onInit() {
  if (Bukkit.getPluginManager().getPlugin("HolographicDisplays") == null) {
    markAsErroneous("HolographicDisplays not enabled");
    return;
  }
  getSign().getBlock().setType(VanillaItem.AIR.getMaterial());
  String[] holoLines = lines[1].split("/");
  Location location = getSign().getLocation();
  location = location.add(0.5, NumberUtil.parseDouble(lines[2]), 0.5);
  hologram = HologramsAPI.createHologram(plugin, location);
  for (String line : holoLines) {
    if (line.startsWith("Item:")) {
      String id = line.replace("Item:", "");
      ItemStack item = null;
      ExItem exItem = plugin.getCaliburn().getExItem(id);
      if (exItem != null) {
        item = exItem.toItemStack();
      }
      hologram.appendItemLine(item);
    } else {
      hologram.appendTextLine(ChatColor.translateAlternateColorCodes('&', line));
    }
  }
}
origin: io.github.bedwarsrel/BedwarsRel-Common

@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")));
}
origin: io.github.bedwarsrel/BedwarsRel-Common

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();
  }
 }
}
com.gmail.filoghost.holographicdisplays.apiHologram

Javadoc

An object made of various lines, that can be items or holograms. Holographic lines appear as a nametag without any entity below. To create one, please see HologramsAPI#createHologram(org.bukkit.plugin.Plugin,Location).

Most used methods

  • appendTextLine
  • appendItemLine
    Appends an item line to end of this hologram.
  • delete
  • getVisibilityManager
  • getLocation
  • teleport
    Teleports a hologram to the given location.
  • clearLines
  • getX
  • getY
  • getZ

Popular in Java

  • Parsing JSON documents to java classes using gson
  • startActivity (Activity)
  • addToBackStack (FragmentTransaction)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • BoxLayout (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now