Search in sources :

Example 21 with MobEffect

use of net.minecraft.server.v1_14_R1.MobEffect in project PaperDev by Kamillaova.

the class CraftAreaEffectCloud method addCustomEffect.

@Override
public boolean addCustomEffect(PotionEffect effect, boolean override) {
    int effectId = effect.getType().getId();
    MobEffect existing = null;
    for (MobEffect mobEffect : getHandle().effects) {
        if (MobEffectList.getId(mobEffect.getMobEffect()) == effectId) {
            existing = mobEffect;
        }
    }
    if (existing != null) {
        if (!override) {
            return false;
        }
        getHandle().effects.remove(existing);
    }
    getHandle().a(CraftPotionUtil.fromBukkit(effect));
    getHandle().refreshEffects();
    return true;
}
Also used : MobEffect(net.minecraft.server.v1_12_R1.MobEffect)

Aggregations

MobEffect (net.minecraft.server.v1_12_R1.MobEffect)7 MobEffect (net.minecraft.server.v1_10_R1.MobEffect)2 PacketPlayOutEntityEffect (net.minecraft.server.v1_10_R1.PacketPlayOutEntityEffect)2 MobEffect (net.minecraft.server.v1_11_R1.MobEffect)2 PacketPlayOutEntityEffect (net.minecraft.server.v1_11_R1.PacketPlayOutEntityEffect)2 PacketPlayOutEntityEffect (net.minecraft.server.v1_12_R1.PacketPlayOutEntityEffect)2 MobEffect (net.minecraft.server.v1_13_R2.MobEffect)2 PacketPlayOutEntityEffect (net.minecraft.server.v1_13_R2.PacketPlayOutEntityEffect)2 MobEffect (net.minecraft.server.v1_14_R1.MobEffect)2 PacketPlayOutEntityEffect (net.minecraft.server.v1_14_R1.PacketPlayOutEntityEffect)2 MobEffect (net.minecraft.server.v1_15_R1.MobEffect)2 PacketPlayOutEntityEffect (net.minecraft.server.v1_15_R1.PacketPlayOutEntityEffect)2 MobEffect (net.minecraft.server.v1_16_R3.MobEffect)2 PacketPlayOutEntityEffect (net.minecraft.server.v1_16_R3.PacketPlayOutEntityEffect)2 MobEffect (net.minecraft.server.v1_9_R2.MobEffect)2 PacketPlayOutEntityEffect (net.minecraft.server.v1_9_R2.PacketPlayOutEntityEffect)2 CraftPlayer (org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer)2