Java 类org.bukkit.EntityEffect 实例源码

项目:geNAZt    文件:EntityManager.java   
public void spawnMonster(Player player) {
    Monster monster = TenJavaPlugin.getMonsterManager().getMonster(player);
    LinkedHashMap configurationSection = TenJavaPlugin.getConfigManager().getExact(monster.evolution);

    String entity = (String) configurationSection.get("entity");
    if(entity.equals("Chicken")) {
        final Entity chicken = player.getWorld().spawnEntity(player.getLocation().add(new Vector(0,1,0)), EntityType.CHICKEN);
        monster.entityId = chicken.getEntityId();

        playerEntityHashMap.put(player, chicken);
        Bukkit.getScheduler().runTaskLater(TenJavaPlugin.getInstance(), new Runnable() {
            @Override
            public void run() {
                chicken.playEffect(EntityEffect.WOLF_HEARTS);
            }
        }, 5*20);
    }
}
项目:MausWasHere    文件:EntityListener.java   
@EventHandler
public void onHit(EntityDamageByEntityEvent event) {
    Entity damager = event.getDamager();
    final Entity entity = event.getEntity();
    if (damager instanceof Player && toggleData.containsKey(((Player) damager).getName().toLowerCase()) && toggleData.get(((Player) damager).getName().toLowerCase())) {
        entity.getWorld().playSound(entity.getLocation(), Sound.CHICKEN_EGG_POP, 5F, 1F);
        entity.playEffect(EntityEffect.WOLF_SMOKE);
        Location location = entity.getLocation();
        entity.getWorld().spigot().playEffect(location, Effect.HEART, 1, 1, 0.35F, 1.5F, 0.35F, 0.5F, 15, 5);
        entity.getWorld().spigot().playEffect(location, Effect.FLAME, 1, 1, 0.5F, 2F, 0.5F, 0.5F, 15, 5);
        entity.getWorld().spigot().playEffect(location, Effect.CLOUD, 1, 1, 1F, 2F, 1F, 0.5F, 30, 5);
        entity.getWorld().spigot().playEffect(location, Effect.MAGIC_CRIT, 1, 1, 0.5F, 1F, 0.5F, 0.5F, 20, 5);
        entity.getWorld().spigot().playEffect(location, Effect.PARTICLE_SMOKE, 1, 1, 0.5F, 1F, 0.5F, 0.5F, 40, 5);
        event.setCancelled(true);
    }
}
项目:ExilePearl    文件:PearlBoundaryTask.java   
/**
 * Checks whether the exiled player is inside any bastion fields they don't have
 * permission on and deals them damage if they are.
 * @param player The player to check
 */
private void checkBastion(Player player) {
    if (pearlApi.isPlayerInUnpermittedBastion(player) && player.getHealth() > 0) {
        player.setHealth(Math.max(0, player.getHealth() - bastionDamage));
        player.playSound(player.getLocation(), Sound.ENTITY_GENERIC_HURT, 1.0F, 1.0F);
        player.playEffect(EntityEffect.HURT);
        msg(player, "<b>You aren't allowed in this bastion field when exiled.");
    }
}
项目:Skellett    文件:EffEntityEffect.java   
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] e, int matchedPattern, Kleenean isDelayed, ParseResult parser) {
    entity = (Expression<Entity>) e[0];
    effect = (Expression<EntityEffect>) e[1];
    return true;
}
项目:BukkitLib    文件:Utilities.java   
/**
 * Play heart particles at the given location.
 * <p>
 * <i>Implementation note:</i> This method accomplishes the desired behavior by spawning a wolf, playing the {@linkplain EntityEffect#WOLF_HEARTS wolf heart} effect, and removing the wolf.
 * Event handlers at the highest priority level are registered that will uncancel the spawn of this wolf.
 * </p>
 * @param location The location at which to play the heart effect.
 */
public static void playHeartEffect(@Nonnull Location location){
    Validate.notNull(location, "The location of the effect must not be null.");
    Validate.notNull(location.getWorld(), "The location must not have a null world.");

    _eventListener.getWolfSpawnLocSet().add(location);
    Wolf o = location.getWorld().spawn(location, Wolf.class);
    o.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, (int) Constants.TICKS_PER_MINUTE, 0));
    o.playEffect(EntityEffect.WOLF_HEARTS);
    o.remove();
}
项目:DeadHorses    文件:PlayerListener.java   
/**
 * Play effects triggered by an eating horse.
 * 
 * @param horse The horse
 * @param happy Show hearts?
 */
private void playFeedEffects(Horse horse, boolean happy) {
  horse.getWorld().playSound(horse.getLocation(), Sound.EAT, 1.0f, 0.75f);
  if (happy) {
    horse.playEffect(EntityEffect.WOLF_HEARTS);
  }
}
项目:MockBukkit    文件:PlayerMock.java   
@Override
public void playEffect(EntityEffect type)
{
    // TODO Auto-generated method stub
    throw new UnimplementedOperationException();
}
项目:GlowNPC    文件:GlowNPC.java   
@Override
public void damage(double amount, Entity source, DamageCause cause) {
    // fire resistance
    if (cause != null && hasPotionEffect(PotionEffectType.FIRE_RESISTANCE)) {
        switch (cause) {
        case PROJECTILE:
            if (!(source instanceof Fireball)) {
                break;
            }
        case FIRE:
        case FIRE_TICK:
        case LAVA:
            return;
        }
    }

    // armor damage protection
    // formula source:
    // http://minecraft.gamepedia.com/Armor#Damage_Protection
    double defensePoints = getAttributeManager().getPropertyValue(Key.KEY_ARMOR);
    double toughness = getAttributeManager().getPropertyValue(Key.KEY_ARMOR_TOUGHNESS);
    amount = amount * (1
            - Math.min(20.0, Math.max(defensePoints / 5.0, defensePoints - amount / (2.0 + toughness / 4.0))) / 25);

    // fire event
    NPCDamageEvent event;
    if (source == null) {
        event = new NPCDamageEvent(this, cause, amount);
    } else {
        event = new NPCDamageByEntityEvent(this, cause, amount, source);
    }
    if (!event.callEvent()) {
        return;
    }

    // apply damage
    amount = event.getFinalDamage();
    setLastDamage(amount);
    setHealth(health - amount);
    playEffect(EntityEffect.HURT);

    // play sounds, handle death
    if (health > 0) {
        Sound hurtSound = getHurtSound();
        if (hurtSound != null && !isSilent()) {
            world.playSound(location, hurtSound, getSoundVolume(), getSoundPitch());
        }
    }
    setLastDamager(source);
}
项目:Skript    文件:VisualEffect.java   
private Type(final EntityEffect effect) {
    this.effect = effect;
}
项目:Skript    文件:VisualEffect.java   
public boolean isEntityEffect() {
    return type.effect instanceof EntityEffect;
}
项目:ThermosRebased    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().worldObj.setEntityState(getHandle(), type.getData());
}
项目:Pokkit    文件:PokkitFakeEntity.java   
@Override
public void playEffect(EntityEffect type) {
    throw Pokkit.unsupported();

}
项目:Pokkit    文件:PokkitEntity.java   
@Override
public void playEffect(EntityEffect type) {
    // Not supported yet. As effects are usually unimportant, it's not worth
    // to crash a plugin over this, so let this method fail silently
}
项目:Thermos    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().worldObj.setEntityState(getHandle(), type.getData());
}
项目:KCauldron    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().worldObj.setEntityState(getHandle(), type.getData());
}
项目:CauldronGit    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().worldObj.setEntityState(getHandle(), type.getData());
}
项目:CanaryBukkit    文件:CanaryEntity.java   
public void playEffect(EntityEffect type) {
    throw new NotImplementedException("playEffect(EntityEffect)");
}
项目:Cauldron-Old    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().worldObj.setEntityState(getHandle(), type.getData());
}
项目:Cauldron-Reloaded    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().worldObj.setEntityState(getHandle(), type.getData());
}
项目:FFoKC    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().worldObj.setEntityState(getHandle(), type.getData());
}
项目:CraftBukkit    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().world.broadcastEntityEffect(getHandle(), type.getData());
}
项目:Craftbukkit    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().world.broadcastEntityEffect(getHandle(), type.getData());
}
项目:Almura-Server    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().world.broadcastEntityEffect(getHandle(), type.getData());
}
项目:SpongeBukkit    文件:BukkitEntity.java   
@Override
public void playEffect(EntityEffect entityEffect)
{
    entity.worldObj.setEntityState(entity, entityEffect.getData());
}
项目:BlockLocker    文件:TestPlayer.java   
@Override
public void playEffect(EntityEffect type) {
    throw new UnsupportedOperationException();

}
项目:MagicLib    文件:EffectPlayer.java   
public void setEntityEffect(EntityEffect entityEffect) {
    this.entityEffect = entityEffect;
}
项目:Tweakkit-Server    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().world.broadcastEntityEffect(getHandle(), type.getData());
}
项目:Cauldron    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().worldObj.setEntityState(getHandle(), type.getData());
}
项目:McMMOPlus    文件:Taming.java   
public static double processThickFur(Wolf wolf, double damage) {
    wolf.playEffect(EntityEffect.WOLF_SHAKE);
    return damage / thickFurModifier;
}
项目:McMMOPlus    文件:Taming.java   
public static void processThickFurFire(Wolf wolf) {
    wolf.playEffect(EntityEffect.WOLF_SMOKE);
    wolf.setFireTicks(0);
}
项目:McMMOPlus    文件:Taming.java   
public static double processShockProof(Wolf wolf, double damage) {
    wolf.playEffect(EntityEffect.WOLF_SHAKE);
    return damage / shockProofModifier;
}
项目:McMMOPlus    文件:Taming.java   
public static void processHolyHound(Wolf wolf, double damage) {
    double modifiedHealth = Math.min(wolf.getHealth() + damage, wolf.getMaxHealth());

    wolf.setHealth(modifiedHealth);
    wolf.playEffect(EntityEffect.WOLF_HEARTS);
}
项目:Pore    文件:PoreEntity.java   
@Override
public void playEffect(EntityEffect type) {
    throw new NotImplementedException("TODO");
}
项目:SpigotSource    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().world.broadcastEntityEffect(getHandle(), type.getData());
}
项目:MondoCommand    文件:MockPlayer.java   
@Override
public void playEffect(EntityEffect arg0) {
}
项目:OtherBounds    文件:PlayerWrapper.java   
@Override
public void playEffect(EntityEffect arg0) {
    // TODO Auto-generated method stub

}
项目:Craft-city    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().world.broadcastEntityEffect(getHandle(), type.getData());
}
项目:MCPBukkit    文件:CraftEntity.java   
public void playEffect(EntityEffect type) {
    this.getHandle().field_70170_p.func_72960_a(getHandle(), type.getData());
}
项目:GGS    文件:Entity.java   
@Override
public void playEffect(EntityEffect type) {
    // TODO Auto-generated method stub

}
项目:NXtimesync    文件:NXPlayer.java   
public void hurt(int amount){

    double hp = player.getHealth();
               double resultant = Math.max(0, hp - amount);

               player.playEffect(EntityEffect.HURT);
               player.setHealth(resultant);

}