@Override public void run() { ArmorStand hologram = getArmorStand(b); hologram.setCustomName(ChatColor.translateAlternateColorCodes('&', name)); } });
@Override public void run() { ArmorStand hologram = getArmorStand(l); if (!hologram.isCustomNameVisible()) hologram.setCustomNameVisible(true); hologram.setCustomName(ChatColor.translateAlternateColorCodes('&', name)); } });
public static ArmorStand getArmorStand(Location reactor) { Location l = new Location(reactor.getWorld(), reactor.getX() + 0.5, reactor.getY(), reactor.getZ() + 0.5); for (Entity n : l.getChunk().getEntities()) { if (n instanceof ArmorStand) { if (l.distanceSquared(n.getLocation()) < 0.4D) return (ArmorStand) n; } } ArmorStand hologram = ArmorStandFactory.createHidden(l); hologram.setCustomNameVisible(false); hologram.setCustomName(null); return hologram; }
public static void update(final Block b, final String name) { ArmorStand hologram = getArmorStand(b); hologram.setCustomName(name); }
public void createTimedHologram(final Location location, String text, Long timeout) { ArmorStand as = (ArmorStand) location.add(0.5, 1, 0.5).getWorld().spawnEntity(location, EntityType.ARMOR_STAND); //Spawn the ArmorStand as.setVisible(false); //Makes the ArmorStand invisible as.setGravity(false); //Make sure it doesn't fall as.setCanPickupItems(false); //I'm not sure what happens if you leave this as it is, but you might as well disable it as.setCustomName(SavageFactions.plugin.color(text)); //Set this to the text you want as.setCustomNameVisible(true); //This makes the text appear no matter if your looking at the entity or not final ArmorStand armorStand = as; Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, () -> { armorStand.remove(); getLogger().info("Removing Hologram."); } , timeout * 20); }
@Override public void run() { ArmorStand hologram = getArmorStand(b); hologram.setCustomName(ChatColor.translateAlternateColorCodes('&', name)); } });
public static ArmorStand getArmorStand(Block hopper) { Location l = new Location(hopper.getWorld(), hopper.getX() + 0.5, hopper.getY(), hopper.getZ() + 0.5); for (Entity n: l.getChunk().getEntities()) { if (n instanceof ArmorStand) { if (n.getCustomName() == null && l.distanceSquared(n.getLocation()) < 0.4D) return (ArmorStand) n; } } ArmorStand hologram = ArmorStandFactory.createHidden(l); hologram.setCustomNameVisible(false); hologram.setCustomName(null); return hologram; }
public static ArmorStand getArmorStand(Block projector) { String nametag = ChatColor.translateAlternateColorCodes('&', BlockStorage.getLocationInfo(projector.getLocation(), "text")); double offset = Double.valueOf(BlockStorage.getLocationInfo(projector.getLocation(), "offset")); Location l = new Location(projector.getWorld(), projector.getX() + 0.5, projector.getY() + offset, projector.getZ() + 0.5); for (Entity n: l.getChunk().getEntities()) { if (n instanceof ArmorStand) { if (n.getCustomName() != null && n.getCustomName().equals(nametag) && l.distanceSquared(n.getLocation()) < 0.4D) return (ArmorStand) n; } } ArmorStand hologram = ArmorStandFactory.createHidden(l); hologram.setCustomName(nametag); return hologram; }
public static ArmorStand getArmorStand(Block hopper) { Location l = new Location(hopper.getWorld(), hopper.getX() + 0.5, hopper.getY() + offset, hopper.getZ() + 0.5); for (Entity n: l.getChunk().getEntities()) { if (n instanceof ArmorStand) { if (n.getCustomName() == null && l.distanceSquared(n.getLocation()) < 0.4D) return (ArmorStand) n; } } ArmorStand hologram = ArmorStandFactory.createHidden(l); hologram.setCustomNameVisible(false); hologram.setCustomName(null); return hologram; }
private static ArmorStand getArmorStand(Block b) { Location l = new Location(b.getWorld(), b.getX() + 0.5, b.getY() + offset, b.getZ() + 0.5); for (Entity n: l.getChunk().getEntities()) { if (n instanceof ArmorStand) { if (n.getCustomName() == null && l.distanceSquared(n.getLocation()) < 0.4D) return (ArmorStand) n; } } ArmorStand hologram = ArmorStandFactory.createHidden(l); hologram.setCustomNameVisible(false); hologram.setCustomName(null); return hologram; }
public static ArmorStand getArmorStand(Block hopper) { Location l = new Location(hopper.getWorld(), hopper.getX() + 0.5, hopper.getY() + offset, hopper.getZ() + 0.5); for (Entity n: l.getChunk().getEntities()) { if (n instanceof ArmorStand) { if (n.getCustomName() == null && l.distanceSquared(n.getLocation()) < 0.4D) return (ArmorStand) n; } } ArmorStand hologram = ArmorStandFactory.createHidden(l); hologram.setCustomNameVisible(false); hologram.setCustomName(null); return hologram; }
public static ArmorStand getArmorStand(Block hopper, boolean createIfNoneFound) { Location l = new Location(hopper.getWorld(), hopper.getX() + 0.5, hopper.getY() + offset, hopper.getZ() + 0.5); for (Entity n: l.getChunk().getEntities()) { if (n instanceof ArmorStand) { if (n.getCustomName() == null && l.distanceSquared(n.getLocation()) < 0.4D) return (ArmorStand) n; } } if (!createIfNoneFound) { return null; } ArmorStand hologram = ArmorStandFactory.createHidden(l); hologram.setCustomNameVisible(false); hologram.setCustomName(null); return hologram; }
CustomHitbox(Location location, BukkitBall ball) { super(((CraftWorld) location.getWorld()).getHandle()); this.ball = ball; final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); final NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); compound.setBoolean("NoBasePlate", true); this.a(compound); this.getSpigotEntity().setCustomName("ResourceBallsPlugin"); this.getSpigotEntity().setCustomNameVisible(false); }
CustomHitbox(Location location, BukkitBall ball) { super(((CraftWorld) location.getWorld()).getHandle()); this.ball = ball; final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); final NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); compound.setBoolean("NoBasePlate", true); this.a(compound); this.getSpigotEntity().setCustomName("ResourceBallsPlugin"); this.getSpigotEntity().setCustomNameVisible(false); }
CustomHitbox(Location location, BukkitBall ball) { super(((CraftWorld) location.getWorld()).getHandle()); this.ball = ball; final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); final NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); compound.setBoolean("NoBasePlate", true); this.a(compound); this.getSpigotEntity().setCustomName("ResourceBallsPlugin"); this.getSpigotEntity().setCustomNameVisible(false); }
CustomHitbox(Location location, BukkitBall ball) { super(((CraftWorld) location.getWorld()).getHandle()); this.ball = ball; final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); final NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); compound.setBoolean("NoBasePlate", true); this.a(compound); this.getSpigotEntity().setCustomName("ResourceBallsPlugin"); this.getSpigotEntity().setCustomNameVisible(false); }
CustomHitbox(Location location, BukkitBall ball) { super(((CraftWorld) location.getWorld()).getHandle()); this.ball = ball; final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); final NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); compound.setBoolean("NoBasePlate", true); this.a(compound); this.getSpigotEntity().setCustomName("ResourceBallsPlugin"); this.getSpigotEntity().setCustomNameVisible(false); }
CustomHitbox(Location location, BukkitBall ball) { super(((CraftWorld) location.getWorld()).getHandle()); this.ball = ball; final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); final NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); compound.setBoolean("NoBasePlate", true); this.a(compound); this.getSpigotEntity().setCustomName("ResourceBallsPlugin"); this.getSpigotEntity().setCustomNameVisible(false); }
CustomHitbox(Location location, BukkitBall ball) { super(((CraftWorld) location.getWorld()).getHandle()); this.ball = ball; final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); final NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); compound.setBoolean("NoBasePlate", true); this.a(compound); this.getSpigotEntity().setCustomName("ResourceBallsPlugin"); this.getSpigotEntity().setCustomNameVisible(false); }
CustomHitbox(Location location, BukkitBall ball) { super(((CraftWorld) location.getWorld()).getHandle()); this.ball = ball; final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); final NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); compound.setBoolean("NoBasePlate", true); this.a(compound); this.getSpigotEntity().setCustomName("ResourceBallsPlugin"); this.getSpigotEntity().setCustomNameVisible(false); }