Search in sources :

Example 1 with MobEffectPacket

use of org.dragonet.net.packet.minecraft.MobEffectPacket in project Dragonet-Legacy by DragonetMC.

the class EntityEffectMessageTranslator method handleSpecific.

@Override
public PEPacket[] handleSpecific(EntityEffectMessage packet) {
    MobEffectPacket pk = new MobEffectPacket();
    pk.eid = packet.id;
    pk.action = MobEffectPacket.EffectAction.ADD;
    PocketPotionEffect effect = PocketPotionEffect.getByID(packet.effect);
    effect.setAmpilifier(packet.amplifier);
    effect.setParticles(!packet.hideParticles);
    effect.setDuration(packet.duration);
    pk.effect = effect;
    return new PEPacket[] { pk };
}
Also used : PocketPotionEffect(org.dragonet.PocketPotionEffect) PEPacket(org.dragonet.net.packet.minecraft.PEPacket) MobEffectPacket(org.dragonet.net.packet.minecraft.MobEffectPacket)

Aggregations

PocketPotionEffect (org.dragonet.PocketPotionEffect)1 MobEffectPacket (org.dragonet.net.packet.minecraft.MobEffectPacket)1 PEPacket (org.dragonet.net.packet.minecraft.PEPacket)1