Beispiel #1
0
  public static float getWeaponSpeedMod(EntityLivingBase entity) {
    WeaponType weapon = InventoryUtil.getMainWeapon(entity);

    if (WeaponType.NONE.equals(weapon)) {
      MonsterModel monster = ((IMonster) entity).getModel();
      if (entity instanceof IMonster) {}
    }

    return weapon.getSpeed();
  }
Beispiel #2
0
  public static boolean isWieldingLightWeapon(EntityLivingBase entity) {
    WeaponType weapon = InventoryUtil.getMainWeapon(entity);

    if (WeaponType.NONE.equals(weapon) && entity instanceof IMonster) {
      // TODO handle secondary attacks
      return false;
    }

    return weapon.getHandedness().equals(Handedness.LIGHT);
  }
Beispiel #3
0
  public static CritRoll getAttackDamage(EntityLivingBase entity) {
    WeaponType weapon = InventoryUtil.getMainWeapon(entity);

    if (WeaponType.NONE.equals(weapon)) {
      MonsterModel monster = ((IMonster) entity).getModel();
      if (entity instanceof IMonster && !monster.damage.isEmpty()) {
        // TODO determine which weapon is being used
        return monster.damage.get(0);
      }
    }

    return weapon.getDamage((int) BuffableType.SIZE.get(entity));
  }