Package org.spout.vanilla.component.entity.misc

Examples of org.spout.vanilla.component.entity.misc.Damage


    setEntityProtocol(new CreatureProtocol(CreatureType.GIANT));
    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(100);
    }

    Damage damage = getOwner().add(Damage.class);
    damage.getDamageLevel(Difficulty.EASY).setAmount(50);
    damage.getDamageLevel(Difficulty.NORMAL).setAmount(damage.getDamageLevel(Difficulty.EASY).getAmount());
    damage.getDamageLevel(Difficulty.HARD).setAmount(damage.getDamageLevel(Difficulty.NORMAL).getAmount());
    damage.getDamageLevel(Difficulty.HARDCORE).setAmount(damage.getDamageLevel(Difficulty.HARD).getAmount());
  }
View Full Code Here


public class DamageTest {
  @Test
  public void testLevelComponent() {
    Entity entity = EntityMocker.mockEntity();
    Damage damageComponent = entity.add(Damage.class);
    damageComponent.getDamageLevel(Difficulty.EASY).setAmount(40);
    assertEquals(40, damageComponent.getDamageLevel(Difficulty.EASY).getAmount());
    assertNull(damageComponent.getDamageLevel(null));
    assertEquals(0, damageComponent.getDamageLevel(Difficulty.HARD).getAmount());
    EntityEffect container = new EntityEffect(EntityEffectType.HASTE, 4);
    damageComponent.getDamageLevel(Difficulty.EASY).setEffect(container);
    assertEquals(container, damageComponent.getDamageLevel(Difficulty.EASY).getEffect());
    assertEquals(null, damageComponent.getDamageLevel(Difficulty.HARD).getEffect());
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.component.entity.misc.Damage

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.