/** * @param armorStand Armor stand to check * @return Whether the given armor stand is part of the hologram */ public boolean contains(ArmorStand armorStand) { for (ArmorStandWrapper wrapper : wrappers) { if (wrapper.getUuid().equals(armorStand.getUniqueId())) { return true; } } return interactArmorStandWrapper != null && interactArmorStandWrapper.getUuid().equals(armorStand.getUniqueId()); }
@Override public boolean isAccepted(MobSelector.MobImpl value) { try { return e.getRightClicked().getUniqueId().equals(value.getDisplayMessage().getClass().getMethod("getUniqueId").invoke(value.getDisplayMessage())); } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e1) { return false; } } });
@SuppressWarnings("deprecation") @Override public void run() { if (arrow.isDead() || !arrow.isValid()) { cancel(); return; } if (arrow.isInBlock() || arrow.isOnGround()) { translocatorPlayerMap.invalidate(arrow.getUniqueId()); playerTranslocatorMap.invalidate(player.getUniqueId()); Location location = arrow.getLocation(); arrow.remove(); ArmorStand armorStand = location.getWorld().spawn(location, ArmorStand.class); armorStand.setCanPickupItems(false); armorStand.setSmall(true); armorStand.setMarker(false); armorStand.setPersistent(false); armorStand.setCustomName(I18n.format("message.translocator", player.getName())); armorStand.setCustomNameVisible(true); playerTranslocatorMap.put(player.getUniqueId(), armorStand.getUniqueId()); translocatorPlayerMap.put(armorStand.getUniqueId(), player.getUniqueId()); cancel(); } } }.runTaskTimer(plugin, 0L, 5L);
spawnPacket.getUUIDs().write(0, entity.getArmorStand().getUniqueId());
spawnPacket.getUUIDs().write(0, entity.getArmorStand().getUniqueId());