Package com.comphenix.protocol.injector

Examples of com.comphenix.protocol.injector.PacketConstructor


  @Test
  public void testPotionEffect() {
    PotionEffect effect = new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 20 * 60, 1);
   
    // The constructor we want to call
    PacketConstructor creator = PacketConstructor.DEFAULT.withPacket(
        PacketType.Play.Server.ENTITY_EFFECT, new Class<?>[] { int.class, PotionEffect.class });
    PacketContainer packet = creator.createPacket(1, effect);
   
    assertEquals(1, (int) packet.getIntegers().read(0));
    assertEquals(effect.getType().getId(), (byte) packet.getBytes().read(0));
    assertEquals(effect.getAmplifier(), (byte) packet.getBytes().read(1));
    assertEquals(effect.getDuration(), (short) packet.getShorts().read(0));
View Full Code Here

TOP

Related Classes of com.comphenix.protocol.injector.PacketConstructor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.