Examples of PotionEffect


Examples of org.bukkit.potion.PotionEffect

  }

  @SuppressWarnings("deprecation")
  @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

Examples of org.bukkit.potion.PotionEffect

            for (int i = 0; i < list.size(); i++) {
                NBTTagCompound effect = (NBTTagCompound)list.get(i);
                byte amp = effect.getByte("Amplifier");
                byte id = effect.getByte("Id");
                int time = effect.getInt("Duration");
                effects.add(new PotionEffect(PotionEffectType.getById(id), time, amp));
            }
        }
        return effects;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.