Search in sources :

Example 1 with EntityRemoveEffectMessage

use of net.glowstone.net.message.play.entity.EntityRemoveEffectMessage in project Glowstone by GlowstoneMC.

the class GlowLivingEntity method removePotionEffect.

@Override
public void removePotionEffect(PotionEffectType type) {
    if (!hasPotionEffect(type)) {
        return;
    }
    potionEffects.remove(type);
    potionEffectsChanged = true;
    EntityRemoveEffectMessage msg = new EntityRemoveEffectMessage(getEntityId(), type.getId());
    for (GlowPlayer player : world.getRawPlayers()) {
        if (player.canSeeEntity(this) || player == this) {
            player.getSession().send(msg);
        }
    }
}
Also used : EntityRemoveEffectMessage(net.glowstone.net.message.play.entity.EntityRemoveEffectMessage)

Aggregations

EntityRemoveEffectMessage (net.glowstone.net.message.play.entity.EntityRemoveEffectMessage)1