org.bukkit.entity.Projectile.getEntityId()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中org.bukkit.entity.Projectile.getEntityId()方法的一些代码示例,展示了Projectile.getEntityId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Projectile.getEntityId()方法的具体详情如下:
包路径:org.bukkit.entity.Projectile
类名称:Projectile
方法名:getEntityId

Projectile.getEntityId介绍

暂无

代码示例

代码示例来源:origin: NyaaCat/RPGItems-reloaded

@EventHandler
public void onProjectileHit(ProjectileHitEvent e) {
  final Projectile entity = e.getEntity();
  if (removeProjectiles.contains(entity.getEntityId())) {
    Bukkit.getScheduler().runTask(plugin, () -> {
      removeProjectiles.remove(entity.getEntityId());
      entity.remove();
    });
  if (rpgProjectiles.containsKey(entity.getEntityId())) {
    try {
      RPGItem rItem = ItemManager.getItem(rpgProjectiles.get(entity.getEntityId())).orElse(null);
      Bukkit.getScheduler().runTask(plugin, () -> rpgProjectiles.remove(entity.getEntityId()));

代码示例来源:origin: ProjectKorra/ProjectKorra

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onProjectileHit(final ProjectileHitEvent event) {
  final Integer id = event.getEntity().getEntityId();
  final Smokescreen smokescreen = Smokescreen.getSnowballs().get(id);
  if (smokescreen != null) {
    final Location loc = event.getEntity().getLocation();
    Smokescreen.playEffect(loc);
    for (final Entity en : GeneralMethods.getEntitiesAroundPoint(loc, smokescreen.getRadius())) {
      smokescreen.applyBlindness(en);
    }
    Smokescreen.getSnowballs().remove(id);
  }
}

代码示例来源:origin: NyaaCat/RPGItems-reloaded

@SuppressWarnings("deprecation")
private void handleProjectile(Vector v, Projectile projectile) {
  projectile.setPersistent(false);
  projectile.setGravity(gravity);
  if (projectile instanceof Explosive) {
    if (yield != null) {
      ((Explosive) projectile).setYield(yield.floatValue());
    }
    if (isIncendiary != null) {
      ((Explosive) projectile).setIsIncendiary(isIncendiary);
    }
  }
  if (projectile instanceof Fireball && setFireballDirection) {
    ((Fireball) projectile).setDirection(v.clone().normalize().multiply(speed));
  }
  if (projectileType == Arrow.class) {
    Events.autoRemoveProjectile(projectile.getEntityId());
    ((Arrow) projectile).setPickupStatus(Arrow.PickupStatus.DISALLOWED);
  }
  if (!gravity) {
    (new BukkitRunnable() {
      @Override
      public void run() {
        projectile.remove();
      }
    }).runTaskLater(RPGItems.plugin, 80);
  }
}

代码示例来源:origin: NyaaCat/RPGItems-reloaded

return;
Integer projectileID = rpgProjectiles.get(projectile.getEntityId());
if (projectileID == null) return;
RPGItem rItem = ItemManager.getItem(projectileID).orElse(null);

代码示例来源:origin: NyaaCat/RPGItems-reloaded

throw new IllegalStateException();
  registerRPGProjectile(e.getEntity().getEntityId(), projectileRpgItem.getUid());
  projectileRpgItem.power(player, projectileItemStack, e, Trigger.LAUNCH_PROJECTILE);
  projectileRpgItem = null;
  return;
registerRPGProjectile(e.getEntity().getEntityId(), rItem.getUid());
rItem.power(player, item, e, Trigger.LAUNCH_PROJECTILE);

代码示例来源:origin: NyaaCat/RPGItems-reloaded

Events.registerRPGProjectile(p.getEntityId(), getItem().getUid());
Vector velocity = p.getVelocity();
Bukkit.getScheduler().runTaskLater(RPGItems.plugin, () -> {

相关文章